CVS commit: src/sys/ddb

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 18 01:28:50 UTC 2021

Modified Files:
src/sys/ddb: db_interface.h

Log Message:
don't provide db_lstacktrace() for crash (yet?).


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/ddb/db_interface.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/ddb/db_interface.h
diff -u src/sys/ddb/db_interface.h:1.39 src/sys/ddb/db_interface.h:1.40
--- src/sys/ddb/db_interface.h:1.39	Sun Apr 18 01:05:23 2021
+++ src/sys/ddb/db_interface.h	Sun Apr 18 01:28:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.h,v 1.39 2021/04/18 01:05:23 mrg Exp $	*/
+/*	$NetBSD: db_interface.h,v 1.40 2021/04/18 01:28:50 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -87,8 +87,13 @@ void		db_show_disk(db_expr_t, bool, db_e
 	true, 65535, "", prfunc)
 #endif	/* !db_stacktrace_print */
 
+#define	db_stacktrace()		db_stacktrace_print(printf);
+#define	db_ustacktrace()	db_stacktrace_print(uprintf);
+
 #include 
 
+#ifdef _KERNEL
+
 static __inline__ void
 _db_log_wrapper(const char *fmt, ...)
 {
@@ -99,8 +104,8 @@ _db_log_wrapper(const char *fmt, ...)
 	va_end(ap);
 }
 
-#define	db_stacktrace()		db_stacktrace_print(printf);
-#define	db_ustacktrace()	db_stacktrace_print(uprintf);
 #define	db_lstacktrace()	db_stacktrace_print(_db_log_wrapper);
 
+#endif
+
 #endif /* _DDB_DB_INTERFACE_H_ */



CVS commit: src/sys/ddb

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 18 01:05:23 UTC 2021

Modified Files:
src/sys/ddb: db_interface.h

Log Message:
db_lstacktrace() can't use db_stacktrace_print and log() directly.

log() takes a 'int level' first argument, that must be supplied.
add an inline wrapper that calls vlog() with LOG_INFO, and the
supplied va_list.

(not noticed because this macro is not used anywhere in src but
i have a use in some uncommited code, that now failed to compile.)


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/ddb/db_interface.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/ddb/db_interface.h
diff -u src/sys/ddb/db_interface.h:1.38 src/sys/ddb/db_interface.h:1.39
--- src/sys/ddb/db_interface.h:1.38	Wed Feb 10 07:17:39 2021
+++ src/sys/ddb/db_interface.h	Sun Apr 18 01:05:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.h,v 1.38 2021/02/10 07:17:39 simonb Exp $	*/
+/*	$NetBSD: db_interface.h,v 1.39 2021/04/18 01:05:23 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -80,7 +80,6 @@ void		db_show_all_device(db_expr_t, bool
 /* kern/subr_disk.c, dev/dksubr.c */
 void		db_show_disk(db_expr_t, bool, db_expr_t, const char *);
 
-
 /* The db_stacktrace_print macro may be overridden by an MD macro */
 #ifndef db_stacktrace_print
 #define	db_stacktrace_print(prfunc) \
@@ -88,8 +87,20 @@ void		db_show_disk(db_expr_t, bool, db_e
 	true, 65535, "", prfunc)
 #endif	/* !db_stacktrace_print */
 
+#include 
+
+static __inline__ void
+_db_log_wrapper(const char *fmt, ...)
+{
+	va_list ap;
+
+	va_start(ap, fmt);
+	vlog(LOG_INFO, fmt, ap);
+	va_end(ap);
+}
+
 #define	db_stacktrace()		db_stacktrace_print(printf);
 #define	db_ustacktrace()	db_stacktrace_print(uprintf);
-#define	db_lstacktrace()	db_stacktrace_print(log);
+#define	db_lstacktrace()	db_stacktrace_print(_db_log_wrapper);
 
 #endif /* _DDB_DB_INTERFACE_H_ */



CVS commit: src/external/gpl3/gcc

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 22:03:58 UTC 2021

Modified Files:
src/external/gpl3/gcc: README.gcc10

Log Message:
arm64-gcc10 can run atf fine (with a GCC 9 kernel.)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/README.gcc10

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

Modified files:

Index: src/external/gpl3/gcc/README.gcc10
diff -u src/external/gpl3/gcc/README.gcc10:1.12 src/external/gpl3/gcc/README.gcc10:1.13
--- src/external/gpl3/gcc/README.gcc10:1.12	Sat Apr 17 22:01:02 2021
+++ src/external/gpl3/gcc/README.gcc10	Sat Apr 17 22:03:57 2021
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc10,v 1.12 2021/04/17 22:01:02 mrg Exp $
+$NetBSD: README.gcc10,v 1.13 2021/04/17 22:03:57 mrg Exp $
 
 
 new stuff:
@@ -32,7 +32,7 @@ switched:	has port switched?  y (yes), n
 
 architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf	switched
 	-	---	--	--			---	
-aarch64		y	n[3]	y	y		n		?	?	?
+aarch64		y	n[3]	y	y		n		?	y	?
 aarch64eb	y	n[3]	y	y		n		?	?	?
 alpha		y	y	y	y		y		y	y	y
 earmv4		y	y	y	y		y		y	?	n



CVS commit: src/external/gpl3/gcc

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 22:01:02 UTC 2021

Modified Files:
src/external/gpl3/gcc: README.gcc10
src/external/gpl3/gcc/lib/libgcc: Makefile.inc

Log Message:
it's spelled aarch64eb.  now aarch64eb userland builds, too.
update arm64 status (kernels still need new libkern help.)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/README.gcc10
cvs rdiff -u -r1.48 -r1.49 src/external/gpl3/gcc/lib/libgcc/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/external/gpl3/gcc/README.gcc10
diff -u src/external/gpl3/gcc/README.gcc10:1.11 src/external/gpl3/gcc/README.gcc10:1.12
--- src/external/gpl3/gcc/README.gcc10:1.11	Sat Apr 17 04:07:16 2021
+++ src/external/gpl3/gcc/README.gcc10	Sat Apr 17 22:01:02 2021
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc10,v 1.11 2021/04/17 04:07:16 mrg Exp $
+$NetBSD: README.gcc10,v 1.12 2021/04/17 22:01:02 mrg Exp $
 
 
 new stuff:
@@ -32,8 +32,8 @@ switched:	has port switched?  y (yes), n
 
 architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf	switched
 	-	---	--	--			---	
-aarch64		y	n[3]	n[3]	y		n		?	?	?
-aarch64be	y	n[3]	n[3]	y		n		?	?	?
+aarch64		y	n[3]	y	y		n		?	?	?
+aarch64eb	y	n[3]	y	y		n		?	?	?
 alpha		y	y	y	y		y		y	y	y
 earmv4		y	y	y	y		y		y	?	n
 earmv4eb	y	b	y	y		y		?	?	?
@@ -74,7 +74,7 @@ coldfire	?	N/A	?	?		?		N/A	N/A
 architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf
 
 [1] - ramdisk.fs is too large, needs fixing.
-[3] - missing __aarch64_swp1_acq in kernels.  missing lse.S in libgcc.
+[3] - missing __aarch64_swp1_acq in kernels.
 [6] - vax vs c++ exceptions issue, same as it ever was
 [7] - fails just as poorly in gxemul/landisk as GCC 9
 [8] - i386 seems to have a signal delivery issue.  pthread tests hang and then

Index: src/external/gpl3/gcc/lib/libgcc/Makefile.inc
diff -u src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.48 src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.49
--- src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.48	Sat Apr 17 10:54:46 2021
+++ src/external/gpl3/gcc/lib/libgcc/Makefile.inc	Sat Apr 17 22:01:02 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.48 2021/04/17 10:54:46 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.49 2021/04/17 22:01:02 mrg Exp $
 
 LIBGCC_MACHINE_ARCH?=${MACHINE_ARCH:S/earmv5/earm/}
 GCC_MACHINE_SUBDIR=${MACHINE_CPU:C/powerpc.*/rs6000/:C/x86_64/i386/}
@@ -170,7 +170,7 @@ ${LIB1ASMFUNCS}: ${.CURDIR}/Makefile
 
 .if ${LIB} == "gcc" && \
 (${LIBGCC_MACHINE_ARCH} == "aarch64" || \
- ${LIBGCC_MACHINE_ARCH} == "aarch64be") # {
+ ${LIBGCC_MACHINE_ARCH} == "aarch64eb") # {
 # XXX lse.S objects are placed directly into "libgcc-objects" for GCC, and
 # are not pulled out by mknative-gcc easily.
 . for s in 1 2 4 8 16



CVS commit: src/common/lib/libc/string

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 21:43:47 UTC 2021

Modified Files:
src/common/lib/libc/string: memset2.c

Log Message:
avoid redefinition warning for __OPTIMIZE_SIZE__.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/string/memset2.c

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

Modified files:

Index: src/common/lib/libc/string/memset2.c
diff -u src/common/lib/libc/string/memset2.c:1.8 src/common/lib/libc/string/memset2.c:1.9
--- src/common/lib/libc/string/memset2.c:1.8	Sat Apr 17 08:06:58 2021
+++ src/common/lib/libc/string/memset2.c	Sat Apr 17 21:43:47 2021
@@ -29,7 +29,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: memset2.c,v 1.8 2021/04/17 08:06:58 simonb Exp $");
+__RCSID("$NetBSD: memset2.c,v 1.9 2021/04/17 21:43:47 mrg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -47,7 +47,8 @@ __RCSID("$NetBSD: memset2.c,v 1.8 2021/0
 #include 
 #include 
 
-#define __OPTIMIZE_SIZE__	/* other code path is very broken */
+#undef __OPTIMIZE_SIZE__
+#define __OPTIMIZE_SIZE__ 1	/* other code path is very broken */
 
 #ifdef TEST
 #include 



CVS commit: src/sys/uvm

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 21:37:21 UTC 2021

Modified Files:
src/sys/uvm: uvm_map.c uvm_pdaemon.c

Log Message:
fix error in previous: UVMHIST_PDHIST_SIZE needs to stay next to pdhistbuf[].


To generate a diff of this commit:
cvs rdiff -u -r1.387 -r1.388 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.132 -r1.133 src/sys/uvm/uvm_pdaemon.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/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.387 src/sys/uvm/uvm_map.c:1.388
--- src/sys/uvm/uvm_map.c:1.387	Sat Apr 17 01:53:58 2021
+++ src/sys/uvm/uvm_map.c	Sat Apr 17 21:37:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.387 2021/04/17 01:53:58 mrg Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.388 2021/04/17 21:37:21 mrg Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.387 2021/04/17 01:53:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.388 2021/04/17 21:37:21 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -105,9 +105,6 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 
 #ifndef UVMHIST_MAPHIST_SIZE
 #define UVMHIST_MAPHIST_SIZE 100
 #endif
-#ifndef UVMHIST_PDHIST_SIZE
-#define UVMHIST_PDHIST_SIZE 100
-#endif
 static struct kern_history_ent maphistbuf[UVMHIST_MAPHIST_SIZE];
 UVMHIST_DEFINE(maphist) = UVMHIST_INITIALIZER(maphist, maphistbuf);
 #endif

Index: src/sys/uvm/uvm_pdaemon.c
diff -u src/sys/uvm/uvm_pdaemon.c:1.132 src/sys/uvm/uvm_pdaemon.c:1.133
--- src/sys/uvm/uvm_pdaemon.c:1.132	Sat Apr 17 01:53:58 2021
+++ src/sys/uvm/uvm_pdaemon.c	Sat Apr 17 21:37:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdaemon.c,v 1.132 2021/04/17 01:53:58 mrg Exp $	*/
+/*	$NetBSD: uvm_pdaemon.c,v 1.133 2021/04/17 21:37:21 mrg Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.132 2021/04/17 01:53:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.133 2021/04/17 21:37:21 mrg Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -88,6 +88,9 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.
 #include 
 
 #ifdef UVMHIST
+#ifndef UVMHIST_PDHIST_SIZE
+#define UVMHIST_PDHIST_SIZE 100
+#endif
 static struct kern_history_ent pdhistbuf[UVMHIST_PDHIST_SIZE];
 UVMHIST_DEFINE(pdhist) = UVMHIST_INITIALIZER(pdhisthist, pdhistbuf);
 #endif



CVS commit: src

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 21:20:08 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: gcc_init_compound_literal.c
gcc_init_compound_literal.exp
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: fix assertion failure for temporary objects in initialization


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c \
src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp
cvs rdiff -u -r1.194 -r1.195 src/usr.bin/xlint/lint1/init.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.2 src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.3
--- src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.2	Sat Apr 17 20:57:18 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c	Sat Apr 17 21:20:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: gcc_init_compound_literal.c,v 1.2 2021/04/17 20:57:18 rillig Exp $	*/
+/*	$NetBSD: gcc_init_compound_literal.c,v 1.3 2021/04/17 21:20:08 rillig Exp $	*/
 # 3 "gcc_init_compound_literal.c"
 
 /*
@@ -12,6 +12,10 @@
  * Using these address constants, it is possible to reference an unnamed
  * object created by a compound literal (C99 6.5.2.5), using either an
  * explicit '&' or the implicit array-to-pointer conversion from C99 6.3.2.1.
+ *
+ * Before init.c 1.195 from 2021-04-17, lint failed with an assertion failure
+ * in check_global_variable, called by check_global_symbols since these
+ * temporary objects have neither storage class EXTERN nor STATIC.
  */
 
 // Seen in sys/crypto/aes/aes_ccm.c.
@@ -20,10 +24,9 @@ const struct {
 } T = {
 	(void *)0,
 	(void *)0,	/* expect: too many struct/union initializers */
-// FIXME: lint: assertion "sym->s_scl == EXTERN || sym->s_scl == STATIC" failed
-//	.ctxt = (const unsigned char[4]){
-//	1, 2, 3, 4
-//	},
+	.ctxt = (const unsigned char[4]){
+	1, 2, 3, 4
+	},
 };
 
 struct node {
@@ -36,7 +39,7 @@ struct node {
  * Initial tree for representing the decisions in the classic number guessing
  * game often used in teaching the basics of programming.
  */
-/* TODO: activate after fixing the assertion failure
+/* expect+1: static variable guess unused */
 static const struct node guess = {
 	50,
 	&(struct node){
@@ -54,4 +57,3 @@ static const struct node guess = {
 	},
 	(void *)0
 };
-*/
Index: src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp
diff -u src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp:1.2 src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp:1.3
--- src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp:1.2	Sat Apr 17 20:57:18 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp	Sat Apr 17 21:20:08 2021
@@ -1 +1,2 @@
-gcc_init_compound_literal.c(22): error: too many struct/union initializers [172]
+gcc_init_compound_literal.c(26): error: too many struct/union initializers [172]
+gcc_init_compound_literal.c(43): warning: static variable guess unused [226]

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.194 src/usr.bin/xlint/lint1/init.c:1.195
--- src/usr.bin/xlint/lint1/init.c:1.194	Fri Apr  9 23:03:26 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Apr 17 21:20:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.194 2021/04/09 23:03:26 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.195 2021/04/17 21:20:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.194 2021/04/09 23:03:26 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.195 2021/04/17 21:20:08 rillig Exp $");
 #endif
 
 #include 
@@ -994,6 +994,17 @@ done:
 static struct initialization *init;
 
 
+static void
+discard_temporary_objects(void)
+{
+	sym_t   *sym;
+
+	for (sym = dcs->d_dlsyms; sym != NULL; sym = sym->s_dlnxt)
+		if (ch_isdigit(sym->s_name[0]))	/* see mktempsym */
+			rmsym(sym);
+}
+
+
 static struct initialization *
 current_init(void)
 {
@@ -1037,6 +1048,9 @@ end_initialization(void)
 	debug_indentation--;
 #endif
 	debug_step0("end initialization");
+
+	if (init == NULL)
+		discard_temporary_objects();
 }
 
 void



CVS commit: src/tests/usr.bin/xlint/lint1

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 20:57:18 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: gcc_init_compound_literal.c
gcc_init_compound_literal.exp

Log Message:
tests/lint: fix analysis from previous commit, add another example

This is not a GCC feature, it's required by C99 already.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c \
src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.1 src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.2
--- src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.1	Sat Apr 17 20:36:17 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c	Sat Apr 17 20:57:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: gcc_init_compound_literal.c,v 1.1 2021/04/17 20:36:17 rillig Exp $	*/
+/*	$NetBSD: gcc_init_compound_literal.c,v 1.2 2021/04/17 20:57:18 rillig Exp $	*/
 # 3 "gcc_init_compound_literal.c"
 
 /*
@@ -7,14 +7,11 @@
  *	All the expressions in an initializer for an object that has static
  *	storage duration shall be constant expressions or string literals.
  *
- * The term "constant expression" is defined in C99 6.6 and is quite
- * restricted, except for a single paragraph, 6.6p10:
- *
- *	An implementation may accept other forms of constant expressions.
- *
- * GCC additionally allows compound expressions, and these can even use the
- * array-to-pointer conversion from C99 6.3.2.1, which allows to initialize a
- * pointer object with a pointer to a direct-value statically allocated array.
+ * The term "constant expression" is defined in C99 6.6, where 6.6p9 allows
+ * "constant expressions" in initializers to also be an "address constant".
+ * Using these address constants, it is possible to reference an unnamed
+ * object created by a compound literal (C99 6.5.2.5), using either an
+ * explicit '&' or the implicit array-to-pointer conversion from C99 6.3.2.1.
  */
 
 // Seen in sys/crypto/aes/aes_ccm.c.
@@ -28,3 +25,33 @@ const struct {
 //	1, 2, 3, 4
 //	},
 };
+
+struct node {
+	int num;
+	struct node *left;
+	struct node *right;
+};
+
+/*
+ * Initial tree for representing the decisions in the classic number guessing
+ * game often used in teaching the basics of programming.
+ */
+/* TODO: activate after fixing the assertion failure
+static const struct node guess = {
+	50,
+	&(struct node){
+		25,
+		&(struct node){
+			12,
+			(void *)0,
+			(void *)0,
+		},
+		&(struct node){
+			37,
+			(void *)0,
+			(void *)0,
+		},
+	},
+	(void *)0
+};
+*/
Index: src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp
diff -u src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp:1.1 src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp:1.2
--- src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp:1.1	Sat Apr 17 20:36:17 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp	Sat Apr 17 20:57:18 2021
@@ -1 +1 @@
-gcc_init_compound_literal.c(25): error: too many struct/union initializers [172]
+gcc_init_compound_literal.c(22): error: too many struct/union initializers [172]



CVS commit: src/doc

2021-04-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 17 20:42:57 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new tmux


To generate a diff of this commit:
cvs rdiff -u -r1.1796 -r1.1797 src/doc/3RDPARTY
cvs rdiff -u -r1.2796 -r1.2797 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1796 src/doc/3RDPARTY:1.1797
--- src/doc/3RDPARTY:1.1796	Sat Apr 17 06:13:09 2021
+++ src/doc/3RDPARTY	Sat Apr 17 16:42:57 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1796 2021/04/17 10:13:09 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1797 2021/04/17 20:42:57 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1369,7 +1369,7 @@ perhaps this implementation should be ke
 purposes.
 
 Package:	tmux
-Version:	3.1c
+Version:	3.2
 Current Vers:	3.2
 Maintainer:	Nicholas Marriott 
 Archive site:	https://github.com/tmux/tmux

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2796 src/doc/CHANGES:1.2797
--- src/doc/CHANGES:1.2796	Sat Apr 17 00:11:52 2021
+++ src/doc/CHANGES	Sat Apr 17 16:42:57 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2796 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2797 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -360,3 +360,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	sparc: Switch to GCC 10.  [mrg 20200416]
 	sparc64: Switch to GCC 10.  [mrg 20200416]
 	vax: Switch to GCC 10.  [mrg 20200416]
+	tmux(1): Imported 3.2. [christos 20210417]



CVS commit: src

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 20:36:17 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh
Added Files:
src/tests/usr.bin/xlint/lint1: gcc_init_compound_literal.c
gcc_init_compound_literal.exp

Log Message:
tests/lint: demonstrate assertion failure in initialization


To generate a diff of this commit:
cvs rdiff -u -r1.1041 -r1.1042 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.42 -r1.43 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 \
src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c \
src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp
cvs rdiff -u -r1.41 -r1.42 src/tests/usr.bin/xlint/lint1/t_integration.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1041 src/distrib/sets/lists/tests/mi:1.1042
--- src/distrib/sets/lists/tests/mi:1.1041	Thu Apr 15 19:02:29 2021
+++ src/distrib/sets/lists/tests/mi	Sat Apr 17 20:36:17 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1041 2021/04/15 19:02:29 rillig Exp $
+# $NetBSD: mi,v 1.1042 2021/04/17 20:36:17 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6186,6 +6186,8 @@
 ./usr/tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.exp		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_000.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_000.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_001.c			tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.42 src/tests/usr.bin/xlint/lint1/Makefile:1.43
--- src/tests/usr.bin/xlint/lint1/Makefile:1.42	Wed Apr 14 18:27:11 2021
+++ src/tests/usr.bin/xlint/lint1/Makefile	Sat Apr 17 20:36:17 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2021/04/14 18:27:11 rillig Exp $
+# $NetBSD: Makefile,v 1.43 2021/04/17 20:36:17 rillig Exp $
 
 NOMAN=		# defined
 MAX_MESSAGE=	343		# see lint1/err.c
@@ -102,6 +102,8 @@ FILES+=		d_typename_as_var.c
 FILES+=		d_zero_sized_arrays.c
 FILES+=		feat_stacktrace.c
 FILES+=		feat_stacktrace.exp
+FILES+=		gcc_init_compound_literal.c
+FILES+=		gcc_init_compound_literal.exp
 FILES+=		${:U0 ${:U:${:Urange=${MAX_MESSAGE}}}:C,^.$,0&,:C,^..$,0&,:@i@msg_${i}.c msg_${i}.exp@:Nmsg_176.exp}
 FILES+=		op_colon.c
 FILES+=		op_colon.exp

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.41 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.42
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.41	Wed Apr 14 18:27:11 2021
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Sat Apr 17 20:36:17 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.41 2021/04/14 18:27:11 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.42 2021/04/17 20:36:17 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -166,6 +166,8 @@ test_case d_type_conv3
 test_case d_incorrect_array_size
 test_case d_long_double_int
 
+test_case gcc_init_compound_literal
+
 test_case op_colon
 
 test_case feat_stacktrace

Added files:

Index: src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c
diff -u /dev/null src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.1
--- /dev/null	Sat Apr 17 20:36:18 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c	Sat Apr 17 20:36:17 2021
@@ -0,0 +1,30 @@
+/*	$NetBSD: gcc_init_compound_literal.c,v 1.1 2021/04/17 20:36:17 rillig Exp $	*/
+# 3 "gcc_init_compound_literal.c"
+
+/*
+ * C99 says in 6.7.8p4:
+ *
+ *	All the expressions in an initializer for an object that has static
+ *	storage duration shall be constant expressions or string literals.
+ *
+ * The term "constant expression" is defined in C99 6.6 and is quite
+ * restricted, except for a single paragraph, 6.6p10:
+ *
+ *	An implementation may accept other forms of constant expressions.
+ *
+ * GCC additionally allows compound expressions, and these can even use the
+ * array-to-pointer conversion from C99 6.3.2.1, which allows to initialize a
+ * pointer object with a pointer to a direct-value statically allocated array.
+ */
+
+// Seen in sys/crypto/aes/aes_ccm.c.
+const struct {
+const unsigned char *ctxt;
+} T = {
+	(void *)0,
+	(void *)0,	/* expect: too many struct/union initializers */
+// FIXME: lint: 

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

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 20:12:55 UTC 2021

Modified Files:
src/sys/arch/amd64/include: asm.h byte_swap.h cpu.h db_machdep.h
frame_regs.h frameasm.h i82093reg.h int_limits.h profile.h
segments.h

Log Message:
sys/arch/amd64: remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amd64/include/asm.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amd64/include/byte_swap.h \
src/sys/arch/amd64/include/frame_regs.h
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/amd64/include/cpu.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/amd64/include/db_machdep.h
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/amd64/include/frameasm.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/include/i82093reg.h \
src/sys/arch/amd64/include/int_limits.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amd64/include/profile.h
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amd64/include/segments.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/amd64/include/asm.h
diff -u src/sys/arch/amd64/include/asm.h:1.21 src/sys/arch/amd64/include/asm.h:1.22
--- src/sys/arch/amd64/include/asm.h:1.21	Sat Apr 25 15:26:16 2020
+++ src/sys/arch/amd64/include/asm.h	Sat Apr 17 20:12:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.21 2020/04/25 15:26:16 bouyer Exp $	*/
+/*	$NetBSD: asm.h,v 1.22 2021/04/17 20:12:55 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -81,12 +81,12 @@
 	ALIGN_TEXT; .globl X ## name; .type X ## name,@function; X ## name:
 #define	IDTVEC_END(name) \
 	.size X ## name, . - X ## name
-#else 
+#else
 #define	IDTVEC(name) \
 	ALIGN_TEXT; .globl X/**/name; .type X/**/name,@function; X/**/name:
 #define	IDTVEC_END(name) \
 	.size X/**/name, . - X/**/name
-#endif /* __STDC__ */ 
+#endif /* __STDC__ */
 #endif /* _KERNEL */
 
 #ifdef __STDC__

Index: src/sys/arch/amd64/include/byte_swap.h
diff -u src/sys/arch/amd64/include/byte_swap.h:1.7 src/sys/arch/amd64/include/byte_swap.h:1.8
--- src/sys/arch/amd64/include/byte_swap.h:1.7	Thu Jan 14 02:06:04 2010
+++ src/sys/arch/amd64/include/byte_swap.h	Sat Apr 17 20:12:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: byte_swap.h,v 1.7 2010/01/14 02:06:04 joerg Exp $	*/
+/*	$NetBSD: byte_swap.h,v 1.8 2021/04/17 20:12:55 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2010 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@ static __inline uint16_t __byte_swap_u16
 static __inline uint16_t
 __byte_swap_u16_variable(uint16_t x)
 {
-	__asm volatile ("rorw $8, %w1" : "=r" (x) : "0" (x)); 
+	__asm volatile ("rorw $8, %w1" : "=r" (x) : "0" (x));
 	return (x);
 }
 
Index: src/sys/arch/amd64/include/frame_regs.h
diff -u src/sys/arch/amd64/include/frame_regs.h:1.7 src/sys/arch/amd64/include/frame_regs.h:1.8
--- src/sys/arch/amd64/include/frame_regs.h:1.7	Sun Apr 26 18:49:39 2015
+++ src/sys/arch/amd64/include/frame_regs.h	Sat Apr 17 20:12:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame_regs.h,v 1.7 2015/04/26 18:49:39 mrg Exp $	*/
+/*	$NetBSD: frame_regs.h,v 1.8 2021/04/17 20:12:55 rillig Exp $	*/
 
 #ifndef _AMD64_FRAME_REGS_H_
 #define _AMD64_FRAME_REGS_H_
@@ -11,7 +11,7 @@
  * has been changed to improve syscall efficiency.
  *
  * Notes:
- * 1) gdb (amd64nbsd-tdep.c) has a lookup table that assumes the __greg_t 
+ * 1) gdb (amd64nbsd-tdep.c) has a lookup table that assumes the __greg_t
  *ordering.
  * 2) src/lib/libc/arch/x86_64/gen/makecontext.c assumes that the first
  *6 entries in the __greg_t array match the registers used to pass

Index: src/sys/arch/amd64/include/cpu.h
diff -u src/sys/arch/amd64/include/cpu.h:1.68 src/sys/arch/amd64/include/cpu.h:1.69
--- src/sys/arch/amd64/include/cpu.h:1.68	Tue Mar 17 17:18:49 2020
+++ src/sys/arch/amd64/include/cpu.h	Sat Apr 17 20:12:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.68 2020/03/17 17:18:49 maxv Exp $	*/
+/*	$NetBSD: cpu.h,v 1.69 2021/04/17 20:12:55 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -84,7 +84,7 @@ x86_curlwp(void)
 #define CLKF_INTR(frame)	(curcpu()->ci_idepth > 0)
 #define LWP_PC(l)		((l)->l_md.md_regs->tf_rip)
 
-void *cpu_uarea_alloc(bool);		
+void *cpu_uarea_alloc(bool);
 bool cpu_uarea_free(void *);
 
 #endif	/* _KERNEL */

Index: src/sys/arch/amd64/include/db_machdep.h
diff -u src/sys/arch/amd64/include/db_machdep.h:1.16 src/sys/arch/amd64/include/db_machdep.h:1.17
--- src/sys/arch/amd64/include/db_machdep.h:1.16	Mon Nov  6 03:47:45 2017
+++ src/sys/arch/amd64/include/db_machdep.h	Sat Apr 17 20:12:55 2021
@@ -1,27 +1,27 @@
-/*	$NetBSD: db_machdep.h,v 1.16 2017/11/06 03:47:45 christos Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.17 2021/04/17 20:12:55 rillig Exp $	*/
 
-/* 
+/*
  * Mach Operating System
  * Copyright (c) 1991,1990 Carnegie Mellon University
  * All Rights Reserved.
- * 
+ *
  * Permission to use, copy, modify and distribute this software and its
  * 

CVS import: src/external/bsd/tmux/dist

2021-04-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 17 19:42:05 UTC 2021

Update of /cvsroot/src/external/bsd/tmux/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv5745

Log Message:
CHANGES FROM 3.1c TO 3.2
* Add a flag to disable keys to close a message.
* Permit shortcut keys in buffer, client, tree modes to be configured with a
  format (-K flag to choose-buffer, choose-client, choose-tree).
* Add a current_file format for the config file being parsed.
* When display-message used in config file, show the message after the config
  file finishes.
* Add client-detached notification in control mode.
* Improve performance of format evaluation.
* Make jump command support UTF-8 in copy mode.
* Support X11 colour names and other colour formats for OSC 10 and 11.
* Add "pipe" variants of "copy-pipe" commands which do not copy.
* Include "focused" in client flags.
* Send Unicode directional isolate characters around horizontal pane borders if
  the terminal supports UTF-8 and an extension terminfo(5) capability "Bidi" is
  present.
* Add a -S flag to new-window to make it select the existing window if one
  with the given name already exists rather than failing with an error.
* Addd a format modifier to check if a window or session name exists (N/w or
  N/s).
* Add compat clock_gettime for older macOS.
* Add a no-detached choice to detach-on-destroy which detaches only if there
  are no other detached sessions to switch to.
* Add rectangle-on and rectangle-off copy mode commands.
* Change so that window_flags escapes # automatically. A new format
  window_raw_flags contains the old unescaped version.
* Add -N flag to never start server even if command would normally do so.
* With incremental search, start empty and only repeat the previous search if
  the user tries to search again with an empty prompt.
* Add a value for remain-on-exit that only keeps the pane if the program
  failed.
* Add a -C flag to run-shell to use a tmux command rather than a shell command.
* Do not list user options with show-hooks.
* Remove current match indicator in copy mode which can't work anymore since we
  only search the visible region.
* Make synchronize-panes a pane option and add -U flag to set-option to unset
  an option on all panes.
* Make replacement of ##s consistent when drawing formats, whether followed by
  [ or not. Add a flag (e) to the q: format modifier to double up #s
* Add -N flag to display-panes to ignore keys.
* Change how escaping is processed for formats so that ## and # can be used in
  styles.
* Add a 'w' format modifier for string width.
* Add support for Haiku.
* Expand menu and popup -x and -y as formats.
* Add numeric comparisons for formats.
* Fire focus events even when the pane is in a mode.
* Add -O flag to display-menu to not automatically close when all mouse buttons
  are released.
* Allow fnmatch(3) wildcards in update-environment.
* Disable nested job expansion so that the result of #() is not expanded again.
* Use the setal capability as well as (tmux's) Setulc.
* Add -q flag to unbind-key to hide errors.
* Allow -N without a command to change or add a note to an existing key.
* Add a -w flag to set- and load-buffer to send to clipboard using OSC 52.
* Add -F to set-environment and source-file.
* Allow colour to be spelt as color in various places.
* Add n: modifier to get length of a format.
* Respond to OSC colour requests if a colour is available.
* Add a -d option to display-message to set delay.
* Add a way for control mode clients to subscribe to a format and be notified
  of changes rather than having to poll.
* Add some formats for search in copy mode (search_present, search_match).
* Do not wait on shutdown for commands started with run -b.
* Add -b flags to insert a window before (like the existing -a for after) to
  break-pane, move-window, new-window.
* Make paste -p the default for ].
* Add support for pausing a pane when the output buffered for a control mode
  client gets too far behind. The pause-after flag with a time is set on the
  pane with refresh-client -f and a paused pane may be resumed with
  refresh-client -A.
* Allow strings in configuration files to span multiple lines - newlines and
  any leading whitespace are removed, as well as any following comments that
  couldn't be part of a format. This allows long formats or other strings to be
  annotated and indented.
* Instead of using a custom parse function to process {} in configuration
  files, treat as a set of statements the same as outside {} and convert back
  to a string as the last step. This means the rules are consistent inside and
  outside {}, %if and friends work at the right time, and the final result
  isn't littered with unnecessary newlines.
* Add support for extended keys - both xterm(1)'s CSI 27 ~ sequence and the
  libtickit CSI u sequence are accepted; only the latter is output. tmux will
  only attempt to use these if the extended-keys option is on and it can detect
  that 

CVS commit: [thorpej-cfargs] src/sys/arch/arm/acpi

2021-04-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr 17 18:03:32 UTC 2021

Modified Files:
src/sys/arch/arm/acpi [thorpej-cfargs]: acpi_machdep.c

Log Message:
acpi_md_gtdt_probe(): Fix paste-o in interface attribute name.


To generate a diff of this commit:
cvs rdiff -u -r1.21.2.1 -r1.21.2.2 src/sys/arch/arm/acpi/acpi_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/arm/acpi/acpi_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_machdep.c:1.21.2.1 src/sys/arch/arm/acpi/acpi_machdep.c:1.21.2.2
--- src/sys/arch/arm/acpi/acpi_machdep.c:1.21.2.1	Fri Apr  2 22:17:37 2021
+++ src/sys/arch/arm/acpi/acpi_machdep.c	Sat Apr 17 18:03:32 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.21.2.1 2021/04/02 22:17:37 thorpej Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.21.2.2 2021/04/17 18:03:32 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.21.2.1 2021/04/02 22:17:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.21.2.2 2021/04/17 18:03:32 thorpej Exp $");
 
 #include 
 #include 
@@ -331,7 +331,7 @@ acpi_md_gtdt_probe(ACPI_GTDT_HEADER *hdr
 	struct acpi_softc * const sc = aux;
 
 	config_found(sc->sc_dev, hdrp, NULL,
-	CFARG_IATTR, "acpimadtbus",
+	CFARG_IATTR, "acpigtdtbus",
 	CFARG_EOL);
 
 	return AE_OK;



CVS commit: src/sys/arch/x86/x86

2021-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 17 18:03:21 UTC 2021

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

Log Message:
Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15


To generate a diff of this commit:
cvs rdiff -u -r1.409 -r1.410 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.409 src/sys/arch/x86/x86/pmap.c:1.410
--- src/sys/arch/x86/x86/pmap.c:1.409	Sat Feb  6 21:24:19 2021
+++ src/sys/arch/x86/x86/pmap.c	Sat Apr 17 18:03:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.409 2021/02/06 21:24:19 jdolecek Exp $	*/
+/*	$NetBSD: pmap.c,v 1.410 2021/04/17 18:03:21 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.409 2021/02/06 21:24:19 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.410 2021/04/17 18:03:21 bouyer Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -915,6 +915,7 @@ pmap_exec_fixup(struct vm_map *map, stru
 void
 pat_init(struct cpu_info *ci)
 {
+#ifndef XENPV
 	uint64_t pat;
 
 	if (!(ci->ci_feat_val[0] & CPUID_PAT))
@@ -928,6 +929,7 @@ pat_init(struct cpu_info *ci)
 
 	wrmsr(MSR_CR_PAT, pat);
 	cpu_pat_enabled = true;
+#endif
 }
 
 static pt_entry_t



CVS commit: src

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 16:58:05 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_135.c msg_135.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: do not warn about alignment when casting from incomplete struct

This removes a bunch of technically correct but practically useless
warnings from the regular NetBSD build.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_135.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_135.exp
cvs rdiff -u -r1.276 -r1.277 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/tests/usr.bin/xlint/lint1/msg_135.c
diff -u src/tests/usr.bin/xlint/lint1/msg_135.c:1.6 src/tests/usr.bin/xlint/lint1/msg_135.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_135.c:1.6	Sat Apr 17 16:52:09 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.c	Sat Apr 17 16:58:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_135.c,v 1.6 2021/04/17 16:52:09 rillig Exp $	*/
+/*	$NetBSD: msg_135.c,v 1.7 2021/04/17 16:58:04 rillig Exp $	*/
 # 3 "msg_135.c"
 
 // Test for message: converting '%s' to '%s' may cause alignment problem [135]
@@ -28,6 +28,10 @@ struct complete {
  * from the publicly visible, incomplete 'struct lhash_st' to a private
  * implementation type such as 'struct lhash_st_OPENSSL_STRING'.
  *
+ * Before tree.c 1.277 from 2021-04-17, lint warned about this, even though
+ * there was not enough evidence that there really was an alignment problem,
+ * resulting in many false positives.
+ *
  * See openssl/lhash.h.
  */
 void
@@ -35,6 +39,6 @@ pointer_to_structs(struct incomplete *in
 {
 	struct complete *complete;
 
-	complete = (struct complete *)incomplete; /* expect: 135 */
+	complete = (struct complete *)incomplete;
 	sink(complete);
 }

Index: src/tests/usr.bin/xlint/lint1/msg_135.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_135.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_135.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_135.exp:1.4	Sat Apr 17 16:52:09 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.exp	Sat Apr 17 16:58:04 2021
@@ -1,3 +1,2 @@
 msg_135.c(15): warning: converting 'pointer to const unsigned char' to 'pointer to const unsigned int' may cause alignment problem [135]
-msg_135.c(38): warning: converting 'pointer to incomplete struct incomplete' to 'pointer to struct complete' may cause alignment problem [135]
 msg_135.c(20): warning: struct incomplete never defined [233]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.276 src/usr.bin/xlint/lint1/tree.c:1.277
--- src/usr.bin/xlint/lint1/tree.c:1.276	Sat Apr 10 18:06:53 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Apr 17 16:58:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.276 2021/04/10 18:06:53 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.277 2021/04/17 16:58:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.276 2021/04/10 18:06:53 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.277 2021/04/17 16:58:04 rillig Exp $");
 #endif
 
 #include 
@@ -2081,7 +2081,8 @@ check_pointer_conversion(tnode_t *tn, ty
 		return;
 	}
 
-	if (hflag && alignment_in_bits(nstp) > alignment_in_bits(ostp)) {
+	if (hflag && alignment_in_bits(nstp) > alignment_in_bits(ostp) &&
+	!is_incomplete(ostp)) {
 		/* converting '%s' to '%s' may cause alignment problem */
 		warning(135, type_name(otp), type_name(ntp));
 	}



CVS commit: src/tests/usr.bin/xlint/lint1

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 16:52:09 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_135.c msg_135.exp

Log Message:
tests/lint: add test for pointer cast from incomplete struct


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_135.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_135.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_135.c
diff -u src/tests/usr.bin/xlint/lint1/msg_135.c:1.5 src/tests/usr.bin/xlint/lint1/msg_135.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_135.c:1.5	Sun Feb 28 01:20:54 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.c	Sat Apr 17 16:52:09 2021
@@ -1,10 +1,12 @@
-/*	$NetBSD: msg_135.c,v 1.5 2021/02/28 01:20:54 rillig Exp $	*/
+/*	$NetBSD: msg_135.c,v 1.6 2021/04/17 16:52:09 rillig Exp $	*/
 # 3 "msg_135.c"
 
 // Test for message: converting '%s' to '%s' may cause alignment problem [135]
 
 /* lint1-extra-flags: -h */
 
+void sink(const void *);
+
 unsigned
 read_uint(const unsigned char **pp)
 {
@@ -14,3 +16,25 @@ read_uint(const unsigned char **pp)
 	pp += sizeof(unsigned);
 	return val;
 }
+
+struct incomplete;	/* expect: never defined */
+
+struct complete {
+int member;
+};
+
+/*
+ * These types of conversions are typically seen in OpenSSL, when converting
+ * from the publicly visible, incomplete 'struct lhash_st' to a private
+ * implementation type such as 'struct lhash_st_OPENSSL_STRING'.
+ *
+ * See openssl/lhash.h.
+ */
+void
+pointer_to_structs(struct incomplete *incomplete)
+{
+	struct complete *complete;
+
+	complete = (struct complete *)incomplete; /* expect: 135 */
+	sink(complete);
+}

Index: src/tests/usr.bin/xlint/lint1/msg_135.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_135.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_135.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_135.exp:1.3	Sun Feb 28 00:40:22 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.exp	Sat Apr 17 16:52:09 2021
@@ -1 +1,3 @@
-msg_135.c(13): warning: converting 'pointer to const unsigned char' to 'pointer to const unsigned int' may cause alignment problem [135]
+msg_135.c(15): warning: converting 'pointer to const unsigned char' to 'pointer to const unsigned int' may cause alignment problem [135]
+msg_135.c(38): warning: converting 'pointer to incomplete struct incomplete' to 'pointer to struct complete' may cause alignment problem [135]
+msg_135.c(20): warning: struct incomplete never defined [233]



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

2021-04-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Apr 17 13:25:57 UTC 2021

Modified Files:
src/sys/arch/powerpc/include/booke: vmparam.h

Log Message:
Sync MAXfoo params with oea:

  MAXTSIZ: 512MB -> 128MB
  MAXDSIZ: 3.25GB -> 1GB

There should be no particular reasons for having different values.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/include/booke/vmparam.h

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

Modified files:

Index: src/sys/arch/powerpc/include/booke/vmparam.h
diff -u src/sys/arch/powerpc/include/booke/vmparam.h:1.8 src/sys/arch/powerpc/include/booke/vmparam.h:1.9
--- src/sys/arch/powerpc/include/booke/vmparam.h:1.8	Sat Apr 17 13:23:24 2021
+++ src/sys/arch/powerpc/include/booke/vmparam.h	Sat Apr 17 13:25:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.8 2021/04/17 13:23:24 rin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.9 2021/04/17 13:25:57 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -56,11 +56,11 @@
 #endif
 
 #ifndef	MAXTSIZ
-#define	MAXTSIZ		(2*256*1024*1024)	/* maximum text size */
+#define	MAXTSIZ		(128*1024*1024)		/* maximum text size */
 #endif
 
 #ifndef	MAXDSIZ
-#define	MAXDSIZ		(13*256*1024*1024U)	/* maximum data size */
+#define	MAXDSIZ		(1024*1024*1024)	/* maximum data size */
 #endif
 
 #ifndef	MAXSSIZ



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

2021-04-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Apr 17 13:23:24 UTC 2021

Modified Files:
src/sys/arch/powerpc/include/booke: vmparam.h

Log Message:
PR port-powerpc/56107

Decrease MAXSSIZ from ~256MB to 32MB (same as oea).

This fixes tests in /usr/tests/usr.bin/make, that run with "ulimit -v 20",
fail with "Cannot map anonymous memory".

Although I'm not fully convinced whether this limit is reasonable or not,
old MAXSSIZ of ~256MB is too much anyway.


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

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

Modified files:

Index: src/sys/arch/powerpc/include/booke/vmparam.h
diff -u src/sys/arch/powerpc/include/booke/vmparam.h:1.7 src/sys/arch/powerpc/include/booke/vmparam.h:1.8
--- src/sys/arch/powerpc/include/booke/vmparam.h:1.7	Tue Oct  2 23:51:39 2012
+++ src/sys/arch/powerpc/include/booke/vmparam.h	Sat Apr 17 13:23:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.7 2012/10/02 23:51:39 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.8 2021/04/17 13:23:24 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -64,7 +64,7 @@
 #endif
 
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		(1*256*1024*1024-PAGE_SIZE) /* maximum stack size */
+#define	MAXSSIZ		(32*1024*1024)		/* maximum stack size */
 #endif
 
 #ifndef	DFLDSIZ



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

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 11:36:34 UTC 2021

Modified Files:
src/tests/usr.bin/make: t_make.sh

Log Message:
tests/make: remove ATF descr

The description of the tests is not going to be added anytime soon, as
that would either create redundancy or additional run-time cost.
Parsing and evaluating unit-tests/Makefile is already O(n^2) with regard
to the number of tests, and there are quite a few tests.  Therefore don't
add any overhead for now.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/make/t_make.sh

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

Modified files:

Index: src/tests/usr.bin/make/t_make.sh
diff -u src/tests/usr.bin/make/t_make.sh:1.14 src/tests/usr.bin/make/t_make.sh:1.15
--- src/tests/usr.bin/make/t_make.sh:1.14	Sat Apr 17 11:31:25 2021
+++ src/tests/usr.bin/make/t_make.sh	Sat Apr 17 11:36:34 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_make.sh,v 1.14 2021/04/17 11:31:25 rillig Exp $
+# $NetBSD: t_make.sh,v 1.15 2021/04/17 11:36:34 rillig Exp $
 #
 # Copyright (c) 2008, 2010, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -53,13 +53,9 @@ test_case()
 {
 	local atfname="${1}"; shift	# e.g. foo_bar
 	local makename="${1}"; shift	# e.g. foo-bar
-	local descr="${1}"; shift
 
 	atf_test_case "${atfname}"
 	eval "${atfname}_head() { \
-		if [ -n '${descr}' ]; then \
-		atf_set descr '${descr}'; \
-		fi; \
 		atf_set require.user unprivileged; \
 	}"
 	eval "${atfname}_body() { \
@@ -87,8 +83,7 @@ atf_init_test_cases()
 			(*)	break;;
 			esac
 		done
-		descr='' # XXX
-		test_case "${atfname}" "${basename}" "${descr}"
+		test_case "${atfname}" "${basename}"
 		atf_add_test_case "${atfname}"
 	done
 }



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

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 11:31:26 UTC 2021

Modified Files:
src/tests/usr.bin/make: t_make.sh

Log Message:
tests/make: indent consistently


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/make/t_make.sh

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

Modified files:

Index: src/tests/usr.bin/make/t_make.sh
diff -u src/tests/usr.bin/make/t_make.sh:1.13 src/tests/usr.bin/make/t_make.sh:1.14
--- src/tests/usr.bin/make/t_make.sh:1.13	Sat Feb  6 19:00:25 2021
+++ src/tests/usr.bin/make/t_make.sh	Sat Apr 17 11:31:25 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_make.sh,v 1.13 2021/02/06 19:00:25 martin Exp $
+# $NetBSD: t_make.sh,v 1.14 2021/04/17 11:31:25 rillig Exp $
 #
 # Copyright (c) 2008, 2010, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -71,25 +71,24 @@ atf_init_test_cases()
 {
 	local filename basename atfname descr
 
-	for filename in "$(atf_get_srcdir)"/unit-tests/*.mk ; do
-	basename="${filename##*/}"
-	basename="${basename%.mk}"
-
-	# skip files that are not test cases on their own
-	case "${basename}" in
-	include-sub*) continue;;
-	esac
-
-	atfname=${basename}
-	while :
-	do
-		case "${atfname}" in
-		(*-*)	atfname=${atfname%-*}_${atfname##*-};;
-		(*)	break;;
+	for filename in "$(atf_get_srcdir)"/unit-tests/*.mk; do
+		basename="${filename##*/}"
+		basename="${basename%.mk}"
+
+		# skip files that are not test cases on their own
+		case "${basename}" in
+		include-sub*) continue;;
 		esac
-	done
-	descr='' # XXX
-	test_case "${atfname}" "${basename}" "${descr}"
-	atf_add_test_case "${atfname}"
+
+		atfname=${basename}
+		while :; do
+			case "${atfname}" in
+			(*-*)	atfname=${atfname%-*}_${atfname##*-};;
+			(*)	break;;
+			esac
+		done
+		descr='' # XXX
+		test_case "${atfname}" "${basename}" "${descr}"
+		atf_add_test_case "${atfname}"
 	done
 }



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

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 11:21:17 UTC 2021

Modified Files:
src/tests/usr.bin/make: Makefile

Log Message:
tests/make: simplify selection of the files to be copied

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/make/Makefile

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

Modified files:

Index: src/tests/usr.bin/make/Makefile
diff -u src/tests/usr.bin/make/Makefile:1.2 src/tests/usr.bin/make/Makefile:1.3
--- src/tests/usr.bin/make/Makefile:1.2	Fri Aug 22 16:45:32 2014
+++ src/tests/usr.bin/make/Makefile	Sat Apr 17 11:21:17 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2014/08/22 16:45:32 apb Exp $
+# $NetBSD: Makefile,v 1.3 2021/04/17 11:21:17 rillig Exp $
 
 # The tests for make(1) are maintained in src/usr.bin/make/unit-tests
 # (UNIT_TESTS_DISTDIR).  We copy them verbatim to ${FILESDIR}/unit-tests
@@ -28,11 +28,10 @@ UNIT_TESTS_DISTDIR=	${NETBSDSRCDIR}/usr.
 DISTFILES!=	(cd ${UNIT_TESTS_DISTDIR} && echo Makefile *.mk *.exp)
 
 # Instruct bsd.files.mk to make the copies
-.for f in ${DISTFILES}
-_file := ${UNIT_TESTS_DISTDIR}/${f}
-FILES+= ${UNIT_TESTS_DISTDIR}/${f}
-FILESNAME_${_file} := ${_file:T}
-FILESDIR_${_file} := ${UNIT_TESTS_DIR}
+.for f in ${DISTFILES:S,^,${UNIT_TESTS_DISTDIR}/,}
+FILES+=		${f}
+FILESNAME_${f}=	${f:T}
+FILESDIR_${f}=	${UNIT_TESTS_DIR}
 .endfor
 
 .include 



CVS commit: src/usr.bin/xlint/lint1

2021-04-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr 17 11:01:34 UTC 2021

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

Log Message:
lint1: remove redundant dependency

This is already handled by "make depend".


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/xlint/lint1/Makefile

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/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.67 src/usr.bin/xlint/lint1/Makefile:1.68
--- src/usr.bin/xlint/lint1/Makefile:1.67	Sat Apr 10 18:36:27 2021
+++ src/usr.bin/xlint/lint1/Makefile	Sat Apr 17 11:01:34 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.67 2021/04/10 18:36:27 rillig Exp $
+#	$NetBSD: Makefile,v 1.68 2021/04/17 11:01:34 rillig Exp $
 
 .include 
 
@@ -44,8 +44,6 @@ LDADD+=		-ll
 DPADD+=		${LIBL}
 .endif
 
-oper.o: ops.def
-
 .include "Makefile.err-msgs-h"
 ${SRCS:Nerr.c}: err-msgs.h
 



CVS commit: src/external/gpl3/gcc/lib/libgcc

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 10:54:47 UTC 2021

Modified Files:
src/external/gpl3/gcc/lib/libgcc: Makefile.inc
src/external/gpl3/gcc/lib/libgcc/libgcc: Makefile

Log Message:
add support for arm64 lse.S.

arm64 userland much happier now.  /usr/bin/gcc as gcc 10 on arm64
is fine, build is complete, though i did not test xsrc yet.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/external/gpl3/gcc/lib/libgcc/Makefile.inc
cvs rdiff -u -r1.29 -r1.30 src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/lib/libgcc/Makefile.inc
diff -u src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.47 src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.48
--- src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.47	Mon Apr 12 00:05:55 2021
+++ src/external/gpl3/gcc/lib/libgcc/Makefile.inc	Sat Apr 17 10:54:46 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.47 2021/04/12 00:05:55 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.48 2021/04/17 10:54:46 mrg Exp $
 
 LIBGCC_MACHINE_ARCH?=${MACHINE_ARCH:S/earmv5/earm/}
 GCC_MACHINE_SUBDIR=${MACHINE_CPU:C/powerpc.*/rs6000/:C/x86_64/i386/}
@@ -30,9 +30,11 @@ CPPFLAGS+=	${G_INTERNAL_CFLAGS:M-DHAVE_C
 .if ${LIBGCC_MACHINE_ARCH} == "powerpc" || \
 ${LIBGCC_MACHINE_ARCH} == "sh3el" || \
 ${LIBGCC_MACHINE_ARCH} == "sh3eb" || \
-${LIBGCC_MACHINE_ARCH} == "m68000"
+${LIBGCC_MACHINE_ARCH} == "m68000" || \
+${LIBGCC_MACHINE_ARCH} == "aarch64" || \
+${LIBGCC_MACHINE_ARCH} == "aarch64eb"
 _TRADITIONAL_CPP=
-COMPILE.S=	${CC} ${AFLAGS} ${CPPFLAGS} -c
+COMPILE.S=	${CC} ${AFLAGS} ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} -c 
 .endif
 
 .if ${LIBGCC_MACHINE_ARCH} == "powerpc"
@@ -166,6 +168,40 @@ ${LIB1ASMFUNCS}: ${.CURDIR}/Makefile
 	printf '#define L${.PREFIX}\n#include <${G_LIB1ASMSRC}>\n' >${.TARGET}
 .endif
 
+.if ${LIB} == "gcc" && \
+(${LIBGCC_MACHINE_ARCH} == "aarch64" || \
+ ${LIBGCC_MACHINE_ARCH} == "aarch64be") # {
+# XXX lse.S objects are placed directly into "libgcc-objects" for GCC, and
+# are not pulled out by mknative-gcc easily.
+. for s in 1 2 4 8 16
+.  for m in 1 2 3 4
+.   for n in cas
+LSE_NAMES+=			${n}_${s}_${m}
+CPPFLAGS.${n}_${s}_${m}+=	-DL_${n} -DSIZE=${s} -DMODEL=${m}
+.   endfor
+.  endfor
+. endfor
+
+. for s in 1 2 4 8
+.  for m in 1 2 3 4
+.   for n in swp ldadd ldclr ldeor ldset
+LSE_NAMES+=			${n}_${s}_${m}
+CPPFLAGS.${n}_${s}_${m}+=	-DL_${n} -DSIZE=${s} -DMODEL=${m}
+.   endfor
+.  endfor
+. endfor
+
+LSE_SRC=	${GNUHOSTDIST}/libgcc/config/aarch64/lse.S
+
+${LSE_NAMES:=.o}: ${LSE_SRC} Makefile
+	${_MKTARGET_COMPILE}
+	${COMPILE.S} ${CPPFLAGS.${.TARGET:T:.o=}} -o ${.TARGET} ${LSE_SRC}
+
+# lse-init.c currently compiles to nothing for us
+G_LIB2ADD+=	${GNUHOSTDIST}/libgcc/config/aarch64/lse-init.c
+
+.endif # } arm64
+
 # Use dynamic sources to arrange for the C file to be the first dependency
 # so ${.IMPSRC} will work.
 

Index: src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile
diff -u src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.29 src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.30
--- src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.29	Mon Apr 12 00:05:55 2021
+++ src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile	Sat Apr 17 10:54:46 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.29 2021/04/12 00:05:55 mrg Exp $
+#	$NetBSD: Makefile,v 1.30 2021/04/17 10:54:46 mrg Exp $
 
 REQUIRETOOLS=	yes
 NOLINT=		# defined
@@ -32,7 +32,8 @@ LIB2ADD_EDITED=	${G_LIB2ADD:T:S/.asm/.S/
 SRCS+=		${LIB2FUNCS} ${LIB2FUNCS_ST} ${LIB2DIVMOD} \
 		${LIB2ADD_EDITED} \
 		${LIB2ADD_HACK:T:S/.asm/.S/} \
-		${G_LIB2ADD_ST:T} ${LIB1ASMFUNCS}
+		${G_LIB2ADD_ST:T} ${LIB1ASMFUNCS} \
+		${LSE_NAMES:=.o}
 .if ${MKPIC} == "no"
 .if empty(LIBGCC_MACHINE_ARCH:Mearm*)
 SRCS+=		${LIB2_EH} ${LIB2_EHASM}



CVS commit: src/external/gpl3/gcc/dist/libgcc

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 10:53:18 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libgcc: config.host

Log Message:
remove double arm64 netbsd target.  add t-lse, though we don't
pull this out with mknative currently.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/gpl3/gcc/dist/libgcc/config.host

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

Modified files:

Index: src/external/gpl3/gcc/dist/libgcc/config.host
diff -u src/external/gpl3/gcc/dist/libgcc/config.host:1.29 src/external/gpl3/gcc/dist/libgcc/config.host:1.30
--- src/external/gpl3/gcc/dist/libgcc/config.host:1.29	Sun Apr 11 00:02:18 2021
+++ src/external/gpl3/gcc/dist/libgcc/config.host	Sat Apr 17 10:53:18 2021
@@ -377,6 +377,7 @@ aarch64*-*-freebsd*)
 aarch64*-*-netbsd*)
 	extra_parts="$extra_parts crtfastmath.o"
 	tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
+	tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc"
 	tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
 	md_unwind_header=aarch64/aarch64-unwind.h
 	;;
@@ -385,12 +386,6 @@ aarch64*-*-fuchsia*)
 	tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc"
 	tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp"
 	;;
-aarch64*-*-netbsd*)
-	extra_parts="$extra_parts crtfastmath.o"
-	tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
-	tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
-	md_unwind_header=aarch64/aarch64-unwind.h
-	;;
 aarch64*-*-linux*)
 	extra_parts="$extra_parts crtfastmath.o"
 	md_unwind_header=aarch64/linux-unwind.h



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 10:19:09 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c

Log Message:
port the -mnative support in GCC 10 to netbsd.  (much simpler than 8->9!)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.11 src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.12
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.11	Sun Apr 11 00:02:13 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c	Sat Apr 17 10:19:09 2021
@@ -514,9 +514,6 @@ host_detect_local_cpu (int argc, const c
 	}
 #endif
 
-	  strncpy(buf, exts.c_str(), sizeof(buf) - 1);
-	  buf[sizeof(buf) - 1] = '\0';
-
   for (i = 0; i < num_exts; i++)
 {
 	  const char *p = aarch64_extensions[i].feat_string;
@@ -530,13 +527,13 @@ host_detect_local_cpu (int argc, const c
 
 	  /* This may be a multi-token feature string.  We need
 		 to match all parts, which could be in any order.  */
-	  size_t len = strlen (buf);
+	  size_t len = strlen (exts.c_str());
 	  do
 		{
 		  const char *end = strchr (p, ' ');
 		  if (end == NULL)
 		end = strchr (p, '\0');
-		  if (memmem (buf, len, p, end - p) == NULL)
+		  if (memmem (exts.c_str(), len, p, end - p) == NULL)
 		{
 		  /* Failed to match this token.  Turn off the
 			 features we'd otherwise enable.  */



CVS commit: src/doc

2021-04-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr 17 10:13:09 UTC 2021

Modified Files:
src/doc: 3RDPARTY

Log Message:
tmux 3.2 out.


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1795 src/doc/3RDPARTY:1.1796
--- src/doc/3RDPARTY:1.1795	Sat Apr 17 04:11:52 2021
+++ src/doc/3RDPARTY	Sat Apr 17 10:13:09 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1795 2021/04/17 04:11:52 mrg Exp $
+#	$NetBSD: 3RDPARTY,v 1.1796 2021/04/17 10:13:09 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1370,7 +1370,7 @@ purposes.
 
 Package:	tmux
 Version:	3.1c
-Current Vers:	3.1c
+Current Vers:	3.2
 Maintainer:	Nicholas Marriott 
 Archive site:	https://github.com/tmux/tmux
 Home page:	http://tmux.github.io



CVS commit: src/share/mk

2021-04-17 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Apr 17 09:39:33 UTC 2021

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Use GCC10 for all amd64 including XEN kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1240 -r1.1241 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1240 src/share/mk/bsd.own.mk:1.1241
--- src/share/mk/bsd.own.mk:1.1240	Sat Apr 17 04:07:16 2021
+++ src/share/mk/bsd.own.mk	Sat Apr 17 09:39:33 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1240 2021/04/17 04:07:16 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1241 2021/04/17 09:39:33 mlelstv Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -64,7 +64,7 @@ TOOLCHAIN_MISSING?=	no
 # What GCC is used?
 #
 .if ${MACHINE} == "alpha" || \
-${MACHINE} == "amd64" || \
+${MACHINE_ARCH} == "x86_64" || \
 ${MACHINE} == "ia64" || \
 ${MACHINE} == "sparc" || \
 ${MACHINE} == "sparc64" || \



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

2021-04-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Apr 17 09:22:29 UTC 2021

Modified Files:
src/sys/arch/powerpc/include/oea: vmparam.h

Log Message:
Adjust TABs. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/include/oea/vmparam.h

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

Modified files:

Index: src/sys/arch/powerpc/include/oea/vmparam.h
diff -u src/sys/arch/powerpc/include/oea/vmparam.h:1.20 src/sys/arch/powerpc/include/oea/vmparam.h:1.21
--- src/sys/arch/powerpc/include/oea/vmparam.h:1.20	Thu Aug 17 22:55:47 2017
+++ src/sys/arch/powerpc/include/oea/vmparam.h	Sat Apr 17 09:22:28 2021
@@ -47,54 +47,54 @@
 #define	PAGE_MASK	(PAGE_SIZE - 1)
 
 #ifndef	USRSTACK
-#define	USRSTACK		VM_MAXUSER_ADDRESS
+#define	USRSTACK	VM_MAXUSER_ADDRESS
 #endif
 
 #ifndef	USRSTACK32
-#define	USRSTACK32		VM_MAXUSER_ADDRESS32
+#define	USRSTACK32	VM_MAXUSER_ADDRESS32
 #endif
 
 #ifndef	MAXTSIZ
-#define	MAXTSIZ			(128*1024*1024)		/* maximum text size */
+#define	MAXTSIZ		(128*1024*1024)		/* maximum text size */
 #endif
 
 #ifndef	MAXDSIZ
-#define	MAXDSIZ			(1024*1024*1024)	/* maximum data size */
+#define	MAXDSIZ		(1024*1024*1024)	/* maximum data size */
 #endif
 
 #ifndef	MAXDSIZ32
-#define	MAXDSIZ32		(1024*1024*1024)	/* maximum data size */
+#define	MAXDSIZ32	(1024*1024*1024)	/* maximum data size */
 #endif
 
 #ifndef	MAXSSIZ
-#define	MAXSSIZ			(32*1024*1024)		/* maximum stack size */
+#define	MAXSSIZ		(32*1024*1024)		/* maximum stack size */
 #endif
 
 #ifndef	MAXSSIZ32
-#define	MAXSSIZ32		(32*1024*1024)		/* maximum stack size */
+#define	MAXSSIZ32	(32*1024*1024)		/* maximum stack size */
 #endif
 
 #ifndef	DFLDSIZ
-#define	DFLDSIZ			(256*1024*1024)		/* default data size */
+#define	DFLDSIZ		(256*1024*1024)		/* default data size */
 #endif
 
 #ifndef	DFLDSIZ32
-#define	DFLSSIZ32		(256*1024*1024)
+#define	DFLSSIZ32	(256*1024*1024)
 #endif
 
 #ifndef	DFLSSIZ
-#define	DFLSSIZ			(2*1024*1024)		/* default stack size */
+#define	DFLSSIZ		(2*1024*1024)		/* default stack size */
 #endif
 
 #ifndef	DFLSSIZ32
-#define	DFLSSIZ32		(2*1024*1024)		/* default stack size */
+#define	DFLSSIZ32	(2*1024*1024)		/* default stack size */
 #endif
 
 /*
  * Default number of pages in the user raw I/O map.
  */
 #ifndef USRIOSIZE
-#define	USRIOSIZE		1024
+#define	USRIOSIZE	1024
 #endif
 
 /*
@@ -102,7 +102,7 @@
  * considered very swappable.
  */
 #ifndef MAXSLP
-#define	MAXSLP			20
+#define	MAXSLP		20
 #endif
 
 /*



CVS commit: src/bin/ps

2021-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr 17 08:35:33 UTC 2021

Modified Files:
src/bin/ps: print.c

Log Message:
Remove SCCS workaround. No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/bin/ps/print.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/ps/print.c
diff -u src/bin/ps/print.c:1.134 src/bin/ps/print.c:1.135
--- src/bin/ps/print.c:1.134	Tue Apr  6 13:35:52 2021
+++ src/bin/ps/print.c	Sat Apr 17 08:35:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.134 2021/04/06 13:35:52 christos Exp $	*/
+/*	$NetBSD: print.c,v 1.135 2021/04/17 08:35:33 maya Exp $	*/
 
 /*
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)print.c	8.6 (Berkeley) 4/16/94";
 #else
-__RCSID("$NetBSD: print.c,v 1.134 2021/04/06 13:35:52 christos Exp $");
+__RCSID("$NetBSD: print.c,v 1.135 2021/04/17 08:35:33 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -800,11 +800,9 @@ started(struct pinfo *pi, VARENT *ve, en
 	if (now == 0)
 		(void)time();
 	if (now - k->p_ustart_sec < SECSPERDAY)
-		/* I *hate* SCCS... */
-		safe_strftime(buf, sizeof(buf) - 1, "%l:%" "M%p", tp);
+		safe_strftime(buf, sizeof(buf) - 1, "%l:%M%p", tp);
 	else if (now - k->p_ustart_sec < DAYSPERWEEK * SECSPERDAY)
-		/* I *hate* SCCS... */
-		safe_strftime(buf, sizeof(buf) - 1, "%a%" "I%p", tp);
+		safe_strftime(buf, sizeof(buf) - 1, "%a%I%p", tp);
 	else
 		safe_strftime(buf, sizeof(buf) - 1, "%e%b%y", tp);
 	/* %e and %l can start with a space. */



CVS commit: src/usr.bin/systat

2021-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr 17 08:34:28 UTC 2021

Modified Files:
src/usr.bin/systat: ps.c

Log Message:
Remove SCCS workarounds. No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/systat/ps.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/systat/ps.c
diff -u src/usr.bin/systat/ps.c:1.39 src/usr.bin/systat/ps.c:1.40
--- src/usr.bin/systat/ps.c:1.39	Wed Aug 26 10:56:01 2020
+++ src/usr.bin/systat/ps.c	Sat Apr 17 08:34:27 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: ps.c,v 1.39 2020/08/26 10:56:01 simonb Exp $  */
+/*  $NetBSD: ps.c,v 1.40 2021/04/17 08:34:27 maya Exp $  */
 
 /*-
  * Copyright (c) 1999
@@ -45,7 +45,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ps.c,v 1.39 2020/08/26 10:56:01 simonb Exp $");
+__RCSID("$NetBSD: ps.c,v 1.40 2021/04/17 08:34:27 maya Exp $");
 #endif /* not lint */
 
 #include 
@@ -340,11 +340,9 @@ start2str(struct kinfo_proc2 *kp)
 	if (now == 0)
 	time();
 	if (now - u_start.tv_sec < 24 * SECSPERHOUR) {
-		/* I *hate* SCCS... */
-	strftime(startstr, sizeof(startstr) - 1, "%l:%" "M%p", tp);
+	strftime(startstr, sizeof(startstr) - 1, "%l:%M%p", tp);
 	} else if (now - u_start.tv_sec < 7 * SECSPERDAY) {
-	/* I *hate* SCCS... */
-	strftime(startstr, sizeof(startstr) - 1, "%a%" "I%p", tp);
+	strftime(startstr, sizeof(startstr) - 1, "%a%I%p", tp);
 	} else  
 	strftime(startstr, sizeof(startstr) - 1, "%e%b%y", tp);
 



CVS commit: src/common/lib/libc/string

2021-04-17 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr 17 08:06:58 UTC 2021

Modified Files:
src/common/lib/libc/string: memset2.c

Log Message:
Use __register_t instead of uregister_t - this is available to all ports
and both userland and kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/string/memset2.c

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

Modified files:

Index: src/common/lib/libc/string/memset2.c
diff -u src/common/lib/libc/string/memset2.c:1.7 src/common/lib/libc/string/memset2.c:1.8
--- src/common/lib/libc/string/memset2.c:1.7	Sat Apr 17 06:02:35 2021
+++ src/common/lib/libc/string/memset2.c	Sat Apr 17 08:06:58 2021
@@ -29,7 +29,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: memset2.c,v 1.7 2021/04/17 06:02:35 simonb Exp $");
+__RCSID("$NetBSD: memset2.c,v 1.8 2021/04/17 08:06:58 simonb Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -60,11 +60,9 @@ __RCSID("$NetBSD: memset2.c,v 1.7 2021/0
 #undef memset
 
 /*
- * Assume uregister_t is the widest non-synthetic unsigned type.
+ * Assume __register_t is the widest non-synthetic unsigned type.
  */
-typedef uregister_t memword_t;
-
-__CTASSERT((~(memword_t)0U >> 1) != ~(memword_t)0U);
+typedef __register_t memword_t;
 
 #ifdef BZERO
 static inline



CVS commit: src/usr.bin/w

2021-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr 17 06:14:15 UTC 2021

Modified Files:
src/usr.bin/w: pr_time.c w.c

Log Message:
Remove SCCS workarounds. No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/w/pr_time.c
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/w/w.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/w/pr_time.c
diff -u src/usr.bin/w/pr_time.c:1.18 src/usr.bin/w/pr_time.c:1.19
--- src/usr.bin/w/pr_time.c:1.18	Wed Aug 17 13:48:11 2011
+++ src/usr.bin/w/pr_time.c	Sat Apr 17 06:14:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr_time.c,v 1.18 2011/08/17 13:48:11 christos Exp $	*/
+/*	$NetBSD: pr_time.c,v 1.19 2021/04/17 06:14:15 maya Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)pr_time.c	8.2 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: pr_time.c,v 1.18 2011/08/17 13:48:11 christos Exp $");
+__RCSID("$NetBSD: pr_time.c,v 1.19 2021/04/17 06:14:15 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -51,9 +51,6 @@ __RCSID("$NetBSD: pr_time.c,v 1.18 2011/
 /*
  * pr_attime --
  *	Print the time since the user logged in.
- *
- *	Note: SCCS forces the bizarre string manipulation, things like
- *	%I% get replaced in the source code.
  */
 void
 pr_attime(time_t *started, time_t *now)
@@ -71,11 +68,11 @@ pr_attime(time_t *started, time_t *now)
 		/* If more than a week, use day-month-year. */
 		(void)strftime(buf, sizeof(buf), "%d%b%y", tp);
 	} else if (tp->tm_yday != tnow_yday) {
-		/* If not today, use day-hour-am/pm. Damn SCCS */
-		(void)strftime(buf, sizeof(buf), "%a%" "I%p", tp);
+		/* If not today, use day-hour-am/pm. */
+		(void)strftime(buf, sizeof(buf), "%a%I%p", tp);
 	} else {
-		/* Default is hh:mm{am,pm}. Damn SCCS */
-		(void)strftime(buf, sizeof(buf), "%l:%" "M%p", tp);
+		/* Default is hh:mm{am,pm}. */
+		(void)strftime(buf, sizeof(buf), "%l:%M%p", tp);
 	}
 
 	buf[sizeof(buf) - 1] = '\0';

Index: src/usr.bin/w/w.c
diff -u src/usr.bin/w/w.c:1.90 src/usr.bin/w/w.c:1.91
--- src/usr.bin/w/w.c:1.90	Sat Aug  1 17:53:38 2020
+++ src/usr.bin/w/w.c	Sat Apr 17 06:14:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: w.c,v 1.90 2020/08/01 17:53:38 kim Exp $	*/
+/*	$NetBSD: w.c,v 1.91 2021/04/17 06:14:15 maya Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)w.c	8.6 (Berkeley) 6/30/94";
 #else
-__RCSID("$NetBSD: w.c,v 1.90 2020/08/01 17:53:38 kim Exp $");
+__RCSID("$NetBSD: w.c,v 1.91 2021/04/17 06:14:15 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -465,11 +465,8 @@ pr_header(time_t *nowp, int nusers)
 
 	/*
 	 * Print time of day.
-	 *
-	 * SCCS forces the string manipulation below, as it replaces
-	 * %, M, and % in a character string with the file name.
 	 */
-	(void)strftime(buf, sizeof(buf), "%l:%" "M%p", localtime(nowp));
+	(void)strftime(buf, sizeof(buf), "%l:%M%p", localtime(nowp));
 	buf[sizeof(buf) - 1] = '\0';
 	(void)printf("%s ", buf);
 



CVS commit: src/common/lib/libc/string

2021-04-17 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr 17 06:02:35 UTC 2021

Modified Files:
src/common/lib/libc/string: memset2.c

Log Message:
Cast the fill value to unsigned char so that the "fill" value used for
full-word fills isn't garbage.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/string/memset2.c

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

Modified files:

Index: src/common/lib/libc/string/memset2.c
diff -u src/common/lib/libc/string/memset2.c:1.6 src/common/lib/libc/string/memset2.c:1.7
--- src/common/lib/libc/string/memset2.c:1.6	Sat Apr 17 05:57:11 2021
+++ src/common/lib/libc/string/memset2.c	Sat Apr 17 06:02:35 2021
@@ -29,7 +29,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: memset2.c,v 1.6 2021/04/17 05:57:11 simonb Exp $");
+__RCSID("$NetBSD: memset2.c,v 1.7 2021/04/17 06:02:35 simonb Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -97,7 +97,7 @@ memset(void *addr, int c, size_t len)
 	 * The conditional at the end prevents GCC from complaing about
 	 * shift count >= width of type 
 	 */
-	fill = c;
+	fill = (unsigned char)c;
 	fill |= fill << 8;
 	fill |= fill << 16;
 	fill |= fill << (sizeof(c) < sizeof(fill) ? 32 : 0);