CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 05:43:30 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: INSTALL

Log Message:
INSTALL: update for --with-blocklist, --with-sia


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 othersrc/libexec/tnftpd/INSTALL

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

Modified files:

Index: othersrc/libexec/tnftpd/INSTALL
diff -u othersrc/libexec/tnftpd/INSTALL:1.10 othersrc/libexec/tnftpd/INSTALL:1.11
--- othersrc/libexec/tnftpd/INSTALL:1.10	Sun Sep 21 16:35:24 2008
+++ othersrc/libexec/tnftpd/INSTALL	Sat Jul  4 05:43:29 2020
@@ -1,4 +1,4 @@
-$NetBSD: INSTALL,v 1.10 2008/09/21 16:35:24 lukem Exp $
+$NetBSD: INSTALL,v 1.11 2020/07/04 05:43:29 lukem Exp $
 
 INSTALLATION INTRODUCTION
 -
@@ -44,26 +44,37 @@ tnftpd is configured using an `autoconf'
 * Specific options:
 
   --enable-ipv6   Enable IPv6 support (if your OS supports it).
+  [default=enabled]
   --disable-ipv6  Disable IPv6 support (even if your OS supports it).
-  [default: enabled]
-  --enable-builtinls  Enable built-in /bin/ls.  [default: enabled]
+  --enable-builtinls  Enable built-in /bin/ls.  [default=enabled]
   --disable-builtinls Disable built-in /bin/ls.
-  --with-pam  Enable support for Pluggable Authentication Modules.
-  --with-skey Enable support for S/Key authentication.
   --disable-largefile Omit support for large files.
+  --with-blocklistenable support for NetBSD blocklist daemon
+  [default=auto]
+  --with-pam  enable support for Pluggable Authentication Modules
+  (PAM) authentication [default=auto]
+  --with-sia  enable support for Tru64 Security Integration
+  Architecture (SIA) authentication [default=auto]
+  --with-skey enable support for S/Key authentication (not
+  compatible with --with-pam) [default=no]
 
 The following environment variables can be set to override various
 compiler related settings.
-  CC=compiler		specify name of the C compiler (default: gcc or cc)
-  CFLAGS=flags		specify flags to C compiler (default: -O -g or just -O)
-  LDFLAGS=flags		specify flags to linker (default: none)
+  CC  C compiler command
+  CFLAGS  C compiler flags
+  LDFLAGS linker flags, e.g. -L if you have libraries in a
+  nonstandard directory 
+  LIBSlibraries to pass to the linker, e.g. -l
+  CPPFLAGS(Objective) C/C++ preprocessor flags, e.g. -I if
+  you have headers in a nonstandard directory 
+  CPP C preprocessor
+  YACCThe `Yet Another Compiler Compiler' implementation to use.
+  Defaults to the first program found out of: `bison -y', `byacc',
+  `yacc'.
+  YFLAGS  The list of arguments that will be passed by default to $YACC.
+  This script will default YFLAGS to the empty string to avoid a
+  default value of `-d' given by some make applications.
 
 This can be achieved with:
 	env CC="compiler" CFLAGS="cflags" LDFLAGS="ldflags" ./configure
 
-
-	
-	=	   =
-	=  NOTE: You will need an ANSI C compiler. =
-	=	   =
-	



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 05:38:28 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: todo

Log Message:
TODO: more stuff


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 othersrc/libexec/tnftpd/todo

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

Modified files:

Index: othersrc/libexec/tnftpd/todo
diff -u othersrc/libexec/tnftpd/todo:1.21 othersrc/libexec/tnftpd/todo:1.22
--- othersrc/libexec/tnftpd/todo:1.21	Sun Mar 21 10:49:16 2010
+++ othersrc/libexec/tnftpd/todo	Sat Jul  4 05:38:28 2020
@@ -1,4 +1,4 @@
-$NetBSD: todo,v 1.21 2010/03/21 10:49:16 lukem Exp $
+$NetBSD: todo,v 1.22 2020/07/04 05:38:28 lukem Exp $
 
 check for pidfile returning void (old netbsd such as 1.6) ?
 
@@ -28,3 +28,12 @@ enable kerberos support once its fixed?
 enable socks once functional autoconf tests are available.
 
 add setenv(3) to replace putenv(3) cruft?
+
+convert to tools/compat/fgetln.c for inline NUL handling?
+
+autoconf check for FNM_NORES for detection of recursion attack.
+less like to be a problem since it's only parsed from ftpd.conf
+
+tools/compat/configure.ac BROKEN_FPARSELN
+
+allow glob override to be optional?



CVS commit: src/libexec/ftpd

2020-07-03 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul  4 05:18:37 UTC 2020

Modified Files:
src/libexec/ftpd: pfilter.c pfilter.h

Log Message:
add missing RCSIDs

(copyrights could be added too - that's up to christos@)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/libexec/ftpd/pfilter.c
cvs rdiff -u -r1.1 -r1.2 src/libexec/ftpd/pfilter.h

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

Modified files:

Index: src/libexec/ftpd/pfilter.c
diff -u src/libexec/ftpd/pfilter.c:1.3 src/libexec/ftpd/pfilter.c:1.4
--- src/libexec/ftpd/pfilter.c:1.3	Mon Jun 15 01:57:31 2020
+++ src/libexec/ftpd/pfilter.c	Sat Jul  4 05:18:37 2020
@@ -1,3 +1,5 @@
+/*	$NetBSD: pfilter.c,v 1.4 2020/07/04 05:18:37 lukem Exp $	*/
+
 #include 
 #include 
 #include 

Index: src/libexec/ftpd/pfilter.h
diff -u src/libexec/ftpd/pfilter.h:1.1 src/libexec/ftpd/pfilter.h:1.2
--- src/libexec/ftpd/pfilter.h:1.1	Sun Jan 25 15:53:49 2015
+++ src/libexec/ftpd/pfilter.h	Sat Jul  4 05:18:37 2020
@@ -1,2 +1,4 @@
+/*	$NetBSD: pfilter.h,v 1.2 2020/07/04 05:18:37 lukem Exp $	*/
+
 void pfilter_open(void);
 void pfilter_notify(int, const char *);



CVS commit: src/sys/arch/aarch64/aarch64

2020-07-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul  4 04:59:36 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpufunc.c

Log Message:
Fix previous; add missing  include.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/aarch64/aarch64/cpufunc.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/aarch64/aarch64/cpufunc.c
diff -u src/sys/arch/aarch64/aarch64/cpufunc.c:1.22 src/sys/arch/aarch64/aarch64/cpufunc.c:1.23
--- src/sys/arch/aarch64/aarch64/cpufunc.c:1.22	Sat Jul  4 04:39:20 2020
+++ src/sys/arch/aarch64/aarch64/cpufunc.c	Sat Jul  4 04:59:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.22 2020/07/04 04:39:20 rin Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.23 2020/07/04 04:59:36 rin Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -30,13 +30,14 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.22 2020/07/04 04:39:20 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.23 2020/07/04 04:59:36 rin Exp $");
 
 #include 
 #include 
 #include 
 #include 
 
+#include 
 #include 
 
 #include 



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 04:55:03 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: configure tnftpd_config.h.in

Log Message:
regen for --with-blocklist


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/tnftpd_config.h.in

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

Modified files:

Index: othersrc/libexec/tnftpd/configure
diff -u othersrc/libexec/tnftpd/configure:1.50 othersrc/libexec/tnftpd/configure:1.51
--- othersrc/libexec/tnftpd/configure:1.50	Sun Jun  2 06:54:55 2019
+++ othersrc/libexec/tnftpd/configure	Sat Jul  4 04:55:03 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.43 .
+# From configure.ac Revision: 1.45 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for tnftpd 20190602.
 #
@@ -778,7 +778,7 @@ with_sysroot
 enable_libtool_lock
 enable_ipv6
 enable_builtinls
-with_blacklist
+with_blocklist
 with_pam
 with_sia
 with_skey
@@ -1437,7 +1437,7 @@ Optional Packages:
   --with-gnu-ld   assume the C compiler uses GNU ld [default=no]
   --with-sysroot=DIR Search for dependent libraries within DIR
 (or the compiler's sysroot if not specified).
-  --with-blacklistenable support for NetBSD blacklist daemon
+  --with-blocklistenable support for NetBSD blocklist daemon
   [default=auto]
   --with-pam  enable support for Pluggable Authentication Modules
   (PAM) authentication [default=auto]
@@ -11913,11 +11913,11 @@ fi
 
 
 
-# Check whether --with-blacklist was given.
-if test "${with_blacklist+set}" = set; then :
-  withval=$with_blacklist;
+# Check whether --with-blocklist was given.
+if test "${with_blocklist+set}" = set; then :
+  withval=$with_blocklist;
 else
-  with_blacklist=auto
+  with_blocklist=auto
 fi
 
 
@@ -11962,6 +11962,7 @@ fi
 
 
 
+
 #
 # Checks for programs.
 #
@@ -15341,12 +15342,56 @@ $as_echo "using local version" >&6; }
 fi
 fi
 
-# Check for blacklist.
+# Check for blocklist, falling back to legacy blacklist name
 #
-if test "$with_blacklist" != no; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: --with-blacklist=$with_blacklist; checking for required blacklist features" >&5
-$as_echo "$as_me: --with-blacklist=$with_blacklist; checking for required blacklist features" >&6;}
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blacklist_open in -lblacklist" >&5
+if test "$with_blocklist" != no; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: --with-blocklist=$with_blocklist; checking for required blocklist features" >&5
+$as_echo "$as_me: --with-blocklist=$with_blocklist; checking for required blocklist features" >&6;}
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blocklist_open in -lblocklist" >&5
+$as_echo_n "checking for blocklist_open in -lblocklist... " >&6; }
+if ${ac_cv_lib_blocklist_blocklist_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblocklist  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blocklist_open ();
+int
+main ()
+{
+return blocklist_open ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blocklist_blocklist_open=yes
+else
+  ac_cv_lib_blocklist_blocklist_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blocklist_blocklist_open" >&5
+$as_echo "$ac_cv_lib_blocklist_blocklist_open" >&6; }
+if test "x$ac_cv_lib_blocklist_blocklist_open" = xyes; then :
+  LIBS="-lblocklist $LIBS"
+ $as_echo "#define USE_BLOCKLIST 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: enabling blocklist support" >&5
+$as_echo "$as_me: enabling blocklist support" >&6;}
+ with_blocklist=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blacklist_open in -lblacklist" >&5
 $as_echo_n "checking for blacklist_open in -lblacklist... " >&6; }
 if ${ac_cv_lib_blacklist_blacklist_open+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -15384,21 +15429,23 @@ fi
 $as_echo "$ac_cv_lib_blacklist_blacklist_open" >&6; }
 if test "x$ac_cv_lib_blacklist_blacklist_open" = xyes; then :
   LIBS="-lblacklist $LIBS"
- $as_echo "#define USE_BLACKLIST 1" >>confdefs.h
+   $as_echo "#define USE_BLACKLIST 1" >>confdefs.h
 
- { $as_echo 

CVS commit: src/sys/arch/aarch64/aarch64

2020-07-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul  4 04:39:21 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpufunc.c

Log Message:
Fix uvmexp.ncolors for some big.LITTLE configuration; it is uncertain
which CPU is used as primary, and as a result, secondary CPUs can
require larger number of colors.

In order to solve this problem, update uvmexp.ncolors via
uvm_page_recolor(9) when secondary CPUs are attached, as done for
other ports like x86.

Pointed out by jmcneill@, and discussed on port-arm@:
http://mail-index.netbsd.org/port-arm/2020/07/03/msg006837.html

Tested and OK'd by ryo@.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/aarch64/aarch64/cpufunc.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/aarch64/aarch64/cpufunc.c
diff -u src/sys/arch/aarch64/aarch64/cpufunc.c:1.21 src/sys/arch/aarch64/aarch64/cpufunc.c:1.22
--- src/sys/arch/aarch64/aarch64/cpufunc.c:1.21	Wed Jul  1 07:59:16 2020
+++ src/sys/arch/aarch64/aarch64/cpufunc.c	Sat Jul  4 04:39:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.21 2020/07/01 07:59:16 ryo Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.22 2020/07/04 04:39:20 rin Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -30,13 +30,15 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.21 2020/07/01 07:59:16 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.22 2020/07/04 04:39:20 rin Exp $");
 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 #include 
 
 u_int cputype;			/* compat arm */
@@ -102,6 +104,7 @@ aarch64_getcacheinfo(int unit)
 {
 	struct cpu_info * const ci = curcpu();
 	uint32_t clidr, ctr;
+	u_int vindexsize;
 	int level, cachetype;
 	struct aarch64_cache_info *cinfo = NULL;
 
@@ -215,14 +218,20 @@ aarch64_getcacheinfo(int unit)
 	((cinfo[0].cacheable == CACHE_CACHEABLE_ICACHE) ||
 	 (cinfo[0].cacheable == CACHE_CACHEABLE_IDCACHE))) {
 
-		aarch64_cache_vindexsize =
+		vindexsize =
 		cinfo[0].icache.cache_size /
 		cinfo[0].icache.cache_ways;
 
-		KASSERT(aarch64_cache_vindexsize != 0);
-		aarch64_cache_prefer_mask = aarch64_cache_vindexsize - 1;
+		KASSERT(vindexsize != 0);
 	} else {
-		aarch64_cache_vindexsize = 0;
+		vindexsize = 0;
+	}
+
+	if (vindexsize > aarch64_cache_vindexsize) {
+		aarch64_cache_vindexsize = vindexsize;
+		aarch64_cache_prefer_mask = vindexsize - 1;
+		if (uvm.page_init_done)
+			uvm_page_recolor(vindexsize / PAGE_SIZE);
 	}
 }
 



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 04:40:00 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: rename to --with-blocklist

Change --with-blacklist to --with-blocklist and search for
libblocklist first, falling back to the legacy libblacklist.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 othersrc/libexec/tnftpd/configure.ac

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

Modified files:

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.44 othersrc/libexec/tnftpd/configure.ac:1.45
--- othersrc/libexec/tnftpd/configure.ac:1.44	Sun Jun  2 06:54:55 2019
+++ othersrc/libexec/tnftpd/configure.ac	Sat Jul  4 04:39:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.44 2019/06/02 06:54:55 lukem Exp $
+# $NetBSD: configure.ac,v 1.45 2020/07/04 04:39:59 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.44 $])
+AC_REVISION([$Revision: 1.45 $])
 
 AS_SHELL_SANITIZE()
 
@@ -44,12 +44,12 @@ AC_ARG_ENABLE([builtinls],
   [opt_builtinls=$enableval],
   [opt_builtinls=yes])
 
-AC_ARG_WITH([blacklist],
-[AS_HELP_STRING([--with-blacklist],
-[enable support for NetBSD blacklist daemon
+AC_ARG_WITH([blocklist],
+[AS_HELP_STRING([--with-blocklist],
+[enable support for NetBSD blocklist daemon
  [default=auto]])],
 [],
-[with_blacklist=auto])
+[with_blocklist=auto])
 
 AC_ARG_WITH([pam],
 [AS_HELP_STRING([--with-pam],
@@ -90,6 +90,8 @@ AH_TEMPLATE([HAVE_PRINTF_LONG_LONG],
  *printf() supports %lld or %qd to print them.])
 AH_TEMPLATE([NO_INTERNAL_LS],
 [Define if not using in-built /bin/ls code.])
+AH_TEMPLATE([USE_BLOCKLIST],
+[Define if using blocklist.])
 AH_TEMPLATE([USE_BLACKLIST],
 [Define if using blacklist.])
 AH_TEMPLATE([USE_INET6],
@@ -385,21 +387,27 @@ AS_IF([test "$ac_cv_have_decl_AI_NUMERIC
   AC_MSG_RESULT([no - using local version])],
  [AC_MSG_RESULT([using local version])])])
 
-# Check for blacklist.
+# Check for blocklist, falling back to legacy blacklist name
 #
-AS_IF([test "$with_blacklist" != no],
-  [AC_MSG_NOTICE([--with-blacklist=$with_blacklist; checking for required blacklist features])
-   AC_CHECK_LIB([blacklist],
-[blacklist_open],
-[LIBS="-lblacklist $LIBS"
- AC_DEFINE([USE_BLACKLIST], [1])
- AC_MSG_NOTICE([enabling blacklist support])
- with_blacklist=yes],
-[AS_IF([test "$with_blacklist" != auto],
-   [AC_MSG_FAILURE(
-[--with-blacklist was given, but blacklist_open() was not found])])
- AC_MSG_NOTICE([disabling --with-blacklist])
- with_blacklist=no])])
+AS_IF([test "$with_blocklist" != no],
+  [AC_MSG_NOTICE([--with-blocklist=$with_blocklist; checking for required blocklist features])
+   AC_CHECK_LIB([blocklist],
+[blocklist_open],
+[LIBS="-lblocklist $LIBS"
+ AC_DEFINE([USE_BLOCKLIST], [1])
+ AC_MSG_NOTICE([enabling blocklist support])
+ with_blocklist=yes],
+[AC_CHECK_LIB([blacklist],
+  [blacklist_open],
+  [LIBS="-lblacklist $LIBS"
+   AC_DEFINE([USE_BLACKLIST], [1])
+   AC_MSG_NOTICE([enabling blocklist legacy support])
+   with_blocklist=yes],
+  [AS_IF([test "$with_blocklist" != auto],
+ [AC_MSG_FAILURE(
+  [--with-blocklist was given, but blocklist_open() was not found])])
+   AC_MSG_NOTICE([disabling --with-blocklist])
+   with_blocklist=no])])])
 
 # Check for PAM.
 #
@@ -490,7 +498,7 @@ AC_MSG_NOTICE([Package:   $P
 AC_MSG_NOTICE([Prefix:$prefix])
 AC_MSG_NOTICE([IPv6 support:  $opt_ipv6])
 AC_MSG_NOTICE([Built-in /bin/ls:  $opt_builtinls])
-AC_MSG_NOTICE([blacklist support: $with_blacklist])
+AC_MSG_NOTICE([blocklist support: $with_blocklist])
 AC_MSG_NOTICE([PAM authentication:$with_pam])
 AC_MSG_NOTICE([SIA authentication:$with_sia])
 AC_MSG_NOTICE([S/Key authentication:  $with_skey])



CVS commit: othersrc/libexec/tnftpd/src

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 04:00:53 UTC 2020

Modified Files:
othersrc/libexec/tnftpd/src: extern.h ftpd.c pfilter.c version.h

Log Message:
Merge NetBSD-20190129

Prepare pfilter.c for future USE_BLOCKLIST check.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 othersrc/libexec/tnftpd/src/extern.h
cvs rdiff -u -r1.36 -r1.37 othersrc/libexec/tnftpd/src/ftpd.c
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/pfilter.c
cvs rdiff -u -r1.9 -r1.10 othersrc/libexec/tnftpd/src/version.h

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

Modified files:

Index: othersrc/libexec/tnftpd/src/extern.h
diff -u othersrc/libexec/tnftpd/src/extern.h:1.18 othersrc/libexec/tnftpd/src/extern.h:1.19
--- othersrc/libexec/tnftpd/src/extern.h:1.18	Tue Jan 29 12:26:47 2019
+++ othersrc/libexec/tnftpd/src/extern.h	Sat Jul  4 04:00:53 2020
@@ -1,5 +1,5 @@
-/*	$NetBSD: extern.h,v 1.18 2019/01/29 12:26:47 lukem Exp $	*/
-/*	from	NetBSD: extern.h,v 1.64 2018/06/23 07:21:00 gson Exp	*/
+/*	$NetBSD: extern.h,v 1.19 2020/07/04 04:00:53 lukem Exp $	*/
+/*	from	NetBSD: extern.h,v 1.65 2019/10/15 18:29:32 christos Exp	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -339,7 +339,7 @@ GLOBAL	char		proctitle[BUFSIZ];	/* initi
 GLOBAL	struct passwd  *pw;
 GLOBAL	int		quietmessages;
 GLOBAL	char		remotehost[MAXHOSTNAMELEN+1];
-GLOBAL	char		remoteloghost[2 * MAXHOSTNAMELEN+1];
+GLOBAL	char		remoteloghost[2 * MAXHOSTNAMELEN + 4];
 GLOBAL	off_t		restart_point;
 GLOBAL	char		tmpline[FTP_BUFLEN];
 GLOBAL	int		type;

Index: othersrc/libexec/tnftpd/src/ftpd.c
diff -u othersrc/libexec/tnftpd/src/ftpd.c:1.36 othersrc/libexec/tnftpd/src/ftpd.c:1.37
--- othersrc/libexec/tnftpd/src/ftpd.c:1.36	Tue Jan 29 13:30:32 2019
+++ othersrc/libexec/tnftpd/src/ftpd.c	Sat Jul  4 04:00:53 2020
@@ -1,5 +1,5 @@
-/*	$NetBSD: ftpd.c,v 1.36 2019/01/29 13:30:32 lukem Exp $	*/
-/*	from	NetBSD: ftpd.c,v 1.204 2018/04/28 13:38:00 riastradh Exp	*/
+/*	$NetBSD: ftpd.c,v 1.37 2020/07/04 04:00:53 lukem Exp $	*/
+/*	from	NetBSD: ftpd.c,v 1.205 2019/10/15 18:29:32 christos Exp	*/
 
 /*
  * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 19
 #if 0
 static char sccsid[] = "@(#)ftpd.c	8.5 (Berkeley) 4/28/95";
 #else
-__RCSID(" NetBSD: ftpd.c,v 1.204 2018/04/28 13:38:00 riastradh Exp  ");
+__RCSID(" NetBSD: ftpd.c,v 1.205 2019/10/15 18:29:32 christos Exp  ");
 #endif
 #endif /* not lint */
 
@@ -3003,7 +3003,7 @@ logremotehost(struct sockinet *who)
 {
 
 #if defined(HAVE_SOCKADDR_SNPRINTF)
-	char abuf[BUFSIZ];
+	char abuf[MAXHOSTNAMELEN];
 #endif
 
 	struct sockaddr *sa = (struct sockaddr *)>si_su;

Index: othersrc/libexec/tnftpd/src/pfilter.c
diff -u othersrc/libexec/tnftpd/src/pfilter.c:1.2 othersrc/libexec/tnftpd/src/pfilter.c:1.3
--- othersrc/libexec/tnftpd/src/pfilter.c:1.2	Tue Jan 29 12:51:38 2019
+++ othersrc/libexec/tnftpd/src/pfilter.c	Sat Jul  4 04:00:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfilter.c,v 1.2 2019/01/29 12:51:38 lukem Exp $	*/
+/*	$NetBSD: pfilter.c,v 1.3 2020/07/04 04:00:53 lukem Exp $	*/
 
 #if defined(HAVE_TNFTPD_H)
 #include "tnftpd.h"
@@ -6,20 +6,27 @@
 
 #include 
 
-#if USE_BLACKLIST
+#if USE_BLOCKLIST
+#include 
+#elif USE_BLACKLIST
 #include 
 #endif
 
 #include "pfilter.h"
 
-#if USE_BLACKLIST
+#if USE_BLOCKLIST
+static struct blocklist *blstate;
+#elif USE_BLACKLIST
 static struct blacklist *blstate;
 #endif
 
 void
 pfilter_open(void)
 {
-#if USE_BLACKLIST
+#if USE_BLOCKLIST
+	if (blstate == NULL)
+		blstate = blocklist_open();
+#elif USE_BLACKLIST
 	if (blstate == NULL)
 		blstate = blacklist_open();
 #endif
@@ -28,12 +35,17 @@ pfilter_open(void)
 void
 pfilter_notify(int what, const char *msg)
 {
-#if USE_BLACKLIST
+#if USE_BLOCKLIST || USE_BLACKLIST
 	pfilter_open();
 
 	if (blstate == NULL)
 		return;
 
-	blacklist_r(blstate, what, 0, msg);
+
+#if USE_BLOCKLIST
+	blocklist_r(blstate, what, STDIN_FILENO, msg);
+#elif USE_BLOCKLIST
+	blacklist_r(blstate, what, STDIN_FILENO, msg);
 #endif
+#endif /* USE_BLOCKLIST || USE_BLACKLIST */
 }

Index: othersrc/libexec/tnftpd/src/version.h
diff -u othersrc/libexec/tnftpd/src/version.h:1.9 othersrc/libexec/tnftpd/src/version.h:1.10
--- othersrc/libexec/tnftpd/src/version.h:1.9	Tue Jan 29 12:14:46 2019
+++ othersrc/libexec/tnftpd/src/version.h	Sat Jul  4 04:00:53 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: version.h,v 1.9 2019/01/29 12:14:46 lukem Exp $	*/
-/*	from	NetBSD: version.h,v 1.76 2019/01/29 11:51:05 lukem Exp	*/
+/*	$NetBSD: version.h,v 1.10 2020/07/04 04:00:53 lukem Exp $	*/
+/*	from	NetBSD: version.h,v 1.77 2020/07/04 01:20:42 lukem Exp	*/
 /*-
- * Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,5 +30,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define	FTPD_VERSION	

CVS import: othersrc/libexec/tnftpd/src

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 03:42:15 UTC 2020

Update of /cvsroot/othersrc/libexec/tnftpd/src
In directory ivanova.netbsd.org:/tmp/cvs-serv17961

Log Message:
Import NetBSD ftpd as at 20200615

Notable changes since NetBSD-20190129:
- Increase some buffer sizes.
- Rename blacklist to blocklist.

Status:

Vendor Tag: NetBSD
Release Tags:   NetBSD-20200615

U othersrc/libexec/tnftpd/src/ftpd.conf.5
U othersrc/libexec/tnftpd/src/popen.c
U othersrc/libexec/tnftpd/src/ftpcmd.y
C othersrc/libexec/tnftpd/src/ftpd.c
C othersrc/libexec/tnftpd/src/extern.h
U othersrc/libexec/tnftpd/src/ftpusers.5
C othersrc/libexec/tnftpd/src/pfilter.c
C othersrc/libexec/tnftpd/src/version.h
U othersrc/libexec/tnftpd/src/pathnames.h
U othersrc/libexec/tnftpd/src/logutmp.c
U othersrc/libexec/tnftpd/src/pfilter.h
U othersrc/libexec/tnftpd/src/ftpd.8
C othersrc/libexec/tnftpd/src/Makefile
U othersrc/libexec/tnftpd/src/conf.c
U othersrc/libexec/tnftpd/src/logwtmp.c
U othersrc/libexec/tnftpd/src/cmds.c

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jNetBSD:yesterday -jNetBSD othersrc/libexec/tnftpd/src



CVS commit: src/usr.bin/make

2020-07-03 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul  4 03:08:20 UTC 2020

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

Log Message:
make: fix sign-compare warning

Fix -Wsign-compare warning on amd64, introduced in rev 1.239


To generate a diff of this commit:
cvs rdiff -u -r1.246 -r1.247 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/var.c
diff -u src/usr.bin/make/var.c:1.246 src/usr.bin/make/var.c:1.247
--- src/usr.bin/make/var.c:1.246	Fri Jul  3 22:40:55 2020
+++ src/usr.bin/make/var.c	Sat Jul  4 03:08:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.247 2020/07/04 03:08:20 lukem Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.247 2020/07/04 03:08:20 lukem Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.247 2020/07/04 03:08:20 lukem Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1242,7 +1242,7 @@ VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var
 	void *dummy MAKE_ATTR_UNUSED)
 {
 char *dot = strrchr(word, '.');
-size_t len = dot != NULL ? dot - word : strlen(word);
+size_t len = dot != NULL ? (size_t)(dot - word) : strlen(word);
 
 if (addSpace && vpstate->varSpace)
 	Buf_AddByte(buf, vpstate->varSpace);



CVS commit: src/libexec/ftpd

2020-07-03 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul  4 01:20:42 UTC 2020

Modified Files:
src/libexec/ftpd: version.h

Log Message:
NetBSD-ftpd 20200615

Update version to "NetBSD-ftpd 20200615" for changes:
- Increase some buffer sizes.
- Rename blacklist to blocklist.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/libexec/ftpd/version.h

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

Modified files:

Index: src/libexec/ftpd/version.h
diff -u src/libexec/ftpd/version.h:1.76 src/libexec/ftpd/version.h:1.77
--- src/libexec/ftpd/version.h:1.76	Tue Jan 29 11:51:05 2019
+++ src/libexec/ftpd/version.h	Sat Jul  4 01:20:42 2020
@@ -1,6 +1,6 @@
-/*	$NetBSD: version.h,v 1.76 2019/01/29 11:51:05 lukem Exp $	*/
+/*	$NetBSD: version.h,v 1.77 2020/07/04 01:20:42 lukem Exp $	*/
 /*-
- * Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -29,5 +29,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define	FTPD_VERSION	"NetBSD-ftpd 20180428"
+#define	FTPD_VERSION	"NetBSD-ftpd 20200615"
 #endif



CVS commit: src/lib/libcurses

2020-07-03 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Jul  3 23:28:51 UTC 2020

Modified Files:
src/lib/libcurses: touchwin.c

Log Message:
wtouchln - verify/clip input parameters
>From Naman Jain in PR lib/55454


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libcurses/touchwin.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/libcurses/touchwin.c
diff -u src/lib/libcurses/touchwin.c:1.31 src/lib/libcurses/touchwin.c:1.32
--- src/lib/libcurses/touchwin.c:1.31	Wed Apr 24 07:09:44 2019
+++ src/lib/libcurses/touchwin.c	Fri Jul  3 23:28:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: touchwin.c,v 1.31 2019/04/24 07:09:44 blymn Exp $	*/
+/*	$NetBSD: touchwin.c,v 1.32 2020/07/03 23:28:51 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)touchwin.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: touchwin.c,v 1.31 2019/04/24 07:09:44 blymn Exp $");
+__RCSID("$NetBSD: touchwin.c,v 1.32 2020/07/03 23:28:51 uwe Exp $");
 #endif
 #endif/* not lint */
 
@@ -177,8 +177,13 @@ wtouchln(WINDOW *win, int line, int n, i
 	__CTRACE(__CTRACE_LINE, "wtouchln: (%p) %d, %d, %d\n",
 	win, line, n, changed);
 #endif
-	if (line + n > win->maxy)
-		line = win->maxy - n;
+	if (line < 0 || win->maxy <= line)
+		return ERR;
+	if (n < 0)
+		return ERR;
+	if (n > win->maxy - line)
+		n = win->maxy - line;
+
 	for (y = line; y < line + n; y++) {
 		if (changed == 1)
 			_cursesi_touchline_force(win, y, 0,



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 22:40:55 UTC 2020

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

Log Message:
make(1): reduce line length in var.c


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 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/var.c
diff -u src/usr.bin/make/var.c:1.245 src/usr.bin/make/var.c:1.246
--- src/usr.bin/make/var.c:1.245	Fri Jul  3 22:34:22 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 22:40:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.245 2020/07/03 22:34:22 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.245 2020/07/03 22:34:22 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.245 2020/07/03 22:34:22 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2262,7 +2262,8 @@ typedef struct {
 #define STRMOD_MATCH(s, want, n) \
 (strncmp(s, want, n) == 0 && (s[n] == st->endc || s[n] == ':'))
 #define STRMOD_MATCHX(s, want, n) \
-(strncmp(s, want, n) == 0 && (s[n] == st->endc || s[n] == ':' || s[n] == '='))
+(strncmp(s, want, n) == 0 && \
+ (s[n] == st->endc || s[n] == ':' || s[n] == '='))
 #define CHARMOD_MATCH(c) (c == st->endc || c == ':')
 
 /* :@var@...${var}...@ */
@@ -2290,7 +2291,8 @@ ApplyModifier_At(ApplyModifiersState *st
 
 loop.flags = st->flags & (VARF_UNDEFERR | VARF_WANTRES);
 loop.ctxt = st->ctxt;
-st->newStr = VarModify(st->ctxt, >parsestate, st->nstr, VarLoopExpand, );
+st->newStr = VarModify(
+	st->ctxt, >parsestate, st->nstr, VarLoopExpand, );
 Var_Delete(loop.tvar, st->ctxt);
 free(loop.tvar);
 free(loop.str);
@@ -3384,7 +3386,8 @@ ApplyModifiers(char *nstr, const char *t
 	if (*st.tstr == ':')
 		st.tstr++;
 	else if (!*st.tstr && st.endc) {
-		Error("Unclosed variable specification after complex modifier (expecting '%c') for %s", st.endc, st.v->name);
+		Error("Unclosed variable specification after complex "
+		"modifier (expecting '%c') for %s", st.endc, st.v->name);
 		goto out;
 	}
 	continue;
@@ -3590,7 +3593,9 @@ ApplyModifiers(char *nstr, const char *t
 	}
 	}
 	if (st.termc == '\0' && st.endc != '\0') {
-	Error("Unclosed variable specification (expecting '%c') for \"%s\" (value \"%s\") modifier %c", st.endc, st.v->name, st.nstr, st.modifier);
+	Error("Unclosed variable specification (expecting '%c') "
+		"for \"%s\" (value \"%s\") modifier %c",
+		st.endc, st.v->name, st.nstr, st.modifier);
 	} else if (st.termc == ':') {
 	st.cp++;
 	}



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 22:34:22 UTC 2020

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

Log Message:
make(1): refactor ApplyModifier_SysV to have less indentation


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 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/var.c
diff -u src/usr.bin/make/var.c:1.244 src/usr.bin/make/var.c:1.245
--- src/usr.bin/make/var.c:1.244	Fri Jul  3 22:10:42 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 22:34:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.244 2020/07/03 22:10:42 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.245 2020/07/03 22:34:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.244 2020/07/03 22:10:42 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.245 2020/07/03 22:34:22 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.244 2020/07/03 22:10:42 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.245 2020/07/03 22:34:22 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1975,7 +1975,8 @@ VarRange(const char *str, int ac)
 /*-
  *---
  * VarGetPattern --
- *	Pass through the tstr looking for 1) escaped delimiters,
+ *	During the parsing of a part of a modifier such as :S or :@,
+ *	pass through the tstr looking for 1) escaped delimiters,
  *	'$'s and backslashes (place the escaped character in
  *	uninterpreted) and 2) unescaped $'s that aren't before
  *	the delimiter (expand the variable substitution unless flags
@@ -3181,10 +3182,10 @@ ApplyModifier_SysV(ApplyModifiersState *
  * substitution command.
  */
 VarPattern  pattern;
-Boolean eqFound;
+Boolean eqFound = FALSE;
 
 pattern.flags = 0;
-eqFound = FALSE;
+
 /*
  * First we make a pass through the string trying
  * to verify it is a SYSV-make-style translation:
@@ -3203,42 +3204,39 @@ ApplyModifier_SysV(ApplyModifiersState *
 	if (st->cnt)
 	st->cp++;
 }
-if (*st->cp == st->endc && eqFound) {
+if (*st->cp != st->endc || !eqFound)
+	return 0;
 
-	/*
-	 * Now we break this sucker into the lhs and
-	 * rhs. We must null terminate them of course.
-	 */
-	st->delim='=';
-	st->cp = st->tstr;
-	if ((pattern.lhs = VarGetPattern(st->ctxt, >parsestate,
-	 st->flags, >cp, st->delim, ,
-	 , NULL)) == NULL)
-	return 'c';
-	st->delim = st->endc;
-	if ((pattern.rhs = VarGetPattern(st->ctxt, >parsestate,
-	 st->flags, >cp, st->delim, NULL, ,
-	 )) == NULL)
-	return 'c';
+st->delim = '=';
+st->cp = st->tstr;
+pattern.lhs = VarGetPattern(
+	st->ctxt, >parsestate, st->flags, >cp, st->delim,
+	, , NULL);
+if (pattern.lhs == NULL)
+	return 'c';
 
-	/*
-	 * SYSV modifications happen through the whole
-	 * string. Note the pattern is anchored at the end.
-	 */
-	st->termc = *--st->cp;
-	st->delim = '\0';
-	if (pattern.leftLen == 0 && *st->nstr == '\0') {
-	st->newStr = st->nstr;	/* special case */
-	} else {
-	st->newStr = VarModify(st->ctxt, >parsestate, st->nstr,
-			   VarSYSVMatch,
-			   );
-	}
-	free(UNCONST(pattern.lhs));
-	free(UNCONST(pattern.rhs));
-	return '=';
-} else
-	return 0;
+st->delim = st->endc;
+pattern.rhs = VarGetPattern(
+	st->ctxt, >parsestate, st->flags, >cp, st->delim,
+	NULL, , );
+if (pattern.rhs == NULL)
+	return 'c';
+
+/*
+ * SYSV modifications happen through the whole
+ * string. Note the pattern is anchored at the end.
+ */
+st->termc = *--st->cp;
+st->delim = '\0';
+if (pattern.leftLen == 0 && *st->nstr == '\0') {
+	st->newStr = st->nstr;	/* special case */
+} else {
+	st->newStr = VarModify(
+	st->ctxt, >parsestate, st->nstr, VarSYSVMatch, );
+}
+free(UNCONST(pattern.lhs));
+free(UNCONST(pattern.rhs));
+return '=';
 }
 #endif
 



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 22:10:42 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk

Log Message:
make(1): clean up documentation, small refactorings for variables

- document the callback for VarModify
- clearly mark the callbacks
- shorten the documentation for some callback functions
- fix the documentation of VarSYSVMatch
- remove unnecessary null check from VarLoopExpand
- add test for applying modifiers to empty strings


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/usr.bin/make/var.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/modmisc.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/modmisc.mk

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.243 src/usr.bin/make/var.c:1.244
--- src/usr.bin/make/var.c:1.243	Fri Jul  3 18:41:50 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 22:10:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.243 2020/07/03 18:41:50 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.244 2020/07/03 22:10:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.243 2020/07/03 18:41:50 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.244 2020/07/03 22:10:42 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.243 2020/07/03 18:41:50 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.244 2020/07/03 22:10:42 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1168,7 +1168,22 @@ Var_Value(const char *name, GNode *ctxt,
 return p;
 }
 
-/* Add the dirname of the given word to the buffer. */
+
+/* This callback for VarModify gets a single word from an expression and
+ * typically adds a modification of this word to the buffer. It may also do
+ * nothing or add several words.
+ *
+ * If addSpaces is TRUE, it must add a space before adding anything else to
+ * the buffer.
+ *
+ * It returns the addSpace value for the next call of this callback. Typical
+ * return values are the current addSpaces or TRUE. */
+typedef Boolean (*VarModifyCallback)(GNode *ctxt, Var_Parse_State *vpstate,
+char *word, Boolean addSpace, Buffer *buf, void *data);
+
+
+/* Callback function for VarModify to implement the :H modifier.
+ * Add the dirname of the given word to the buffer. */
 static Boolean
 VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	char *word, Boolean addSpace, Buffer *buf,
@@ -1186,7 +1201,8 @@ VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var
 return TRUE;
 }
 
-/* Add the basename of the given word to the buffer. */
+/* Callback function for VarModify to implement the :T modifier.
+ * Add the basename of the given word to the buffer. */
 static Boolean
 VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	char *word, Boolean addSpace, Buffer *buf,
@@ -1198,11 +1214,11 @@ VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var
 if (addSpace && vpstate->varSpace)
 	Buf_AddByte(buf, vpstate->varSpace);
 Buf_AddBytes(buf, strlen(base), base);
-
 return TRUE;
 }
 
-/* Add the filename suffix of the given word to the buffer, if it exists. */
+/* Callback function for VarModify to implement the :E modifier.
+ * Add the filename suffix of the given word to the buffer, if it exists. */
 static Boolean
 VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	  char *word, Boolean addSpace, Buffer *buf,
@@ -1218,7 +1234,8 @@ VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, V
 return TRUE;
 }
 
-/* Add the filename basename of the given word to the buffer. */
+/* Callback function for VarModify to implement the :R modifier.
+ * Add the filename basename of the given word to the buffer. */
 static Boolean
 VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	char *word, Boolean addSpace, Buffer *buf,
@@ -1233,167 +1250,78 @@ VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var
 return TRUE;
 }
 
-/*-
- *---
- * VarMatch --
- *	Place the word in the buffer if it matches the given pattern.
- *	Callback function for VarModify to implement the :M modifier.
- *
- * Input:
- *	word		Word to examine
- *	addSpace	TRUE if need to add a space to the buffer
- *			before adding the word, if it matches
- *	buf		Buffer in which to store it
- *	pattern		Pattern the word must match
- *
- * Results:
- *	TRUE if a space should be placed in the buffer before the next
- *	word.
- *
- * Side Effects:
- *	The word may be copied to the buffer.
- *
- *---
- */
+/* Callback function for VarModify to implement the :M modifier.
+ * Place the word in the buffer if it matches the given 

CVS commit: src/sys/sys

2020-07-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Jul  3 19:37:28 UTC 2020

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

Log Message:
add a cast to (struct statvfs *) for STATVFSBUF_GET() to make sure it's
never assigned to anything else


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/statvfs.h

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

Modified files:

Index: src/sys/sys/statvfs.h
diff -u src/sys/sys/statvfs.h:1.20 src/sys/sys/statvfs.h:1.21
--- src/sys/sys/statvfs.h:1.20	Sat May 16 18:31:53 2020
+++ src/sys/sys/statvfs.h	Fri Jul  3 19:37:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: statvfs.h,v 1.20 2020/05/16 18:31:53 christos Exp $	 */
+/*	$NetBSD: statvfs.h,v 1.21 2020/07/03 19:37:27 jdolecek Exp $	 */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -150,7 +150,8 @@ void	copy_statvfs_info(struct statvfs *,
 int	dostatvfs(struct mount *, struct statvfs *, struct lwp *, int, int);
 
 #include 
-#define	STATVFSBUF_GET()	kmem_zalloc(sizeof(struct statvfs), KM_SLEEP)
+#define	STATVFSBUF_GET()	\
+	(struct statvfs *)kmem_zalloc(sizeof(struct statvfs), KM_SLEEP)
 #define	STATVFSBUF_PUT(sb)	kmem_free(sb, sizeof(struct statvfs))
 
 #else



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

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 19:29:25 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: sysv.exp sysv.mk

Log Message:
make(1): add another test for the SysV :%=% modifier


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/sysv.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/sysv.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/sysv.exp
diff -u src/usr.bin/make/unit-tests/sysv.exp:1.3 src/usr.bin/make/unit-tests/sysv.exp:1.4
--- src/usr.bin/make/unit-tests/sysv.exp:1.3	Wed May  6 02:30:10 2020
+++ src/usr.bin/make/unit-tests/sysv.exp	Fri Jul  3 19:29:25 2020
@@ -12,4 +12,5 @@ asam.c.c
 asam.c
 a.c.c
 
+ax:Q b c d eb
 exit status 0

Index: src/usr.bin/make/unit-tests/sysv.mk
diff -u src/usr.bin/make/unit-tests/sysv.mk:1.4 src/usr.bin/make/unit-tests/sysv.mk:1.5
--- src/usr.bin/make/unit-tests/sysv.mk:1.4	Wed May  6 02:30:10 2020
+++ src/usr.bin/make/unit-tests/sysv.mk	Fri Jul  3 19:29:25 2020
@@ -1,4 +1,4 @@
-# $Id: sysv.mk,v 1.4 2020/05/06 02:30:10 christos Exp $
+# $Id: sysv.mk,v 1.5 2020/07/03 19:29:25 rillig Exp $
 
 FOO ?=
 FOOBAR = ${FOO:=bar}
@@ -11,7 +11,7 @@ FUN = ${B}${S}fun
 SUN = the Sun
 
 # we expect nothing when FOO is empty
-all: foo fun sam bla
+all: foo fun sam bla words
 
 foo:
 	@echo FOOBAR = ${FOOBAR}
@@ -41,3 +41,8 @@ BLA=
 
 bla:
 	@echo $(BLA:%=foo/%x)
+
+# The :Q looks like a modifier but isn't.
+# It is part of the replacement string.
+words:
+	@echo a${a b c d e:L:%a=x:Q}b



CVS commit: src/external/bsd/atf/dist/atf-c

2020-07-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul  3 19:22:39 UTC 2020

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3

Log Message:
Consistent use of comma in lists.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/atf-c-api.3

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

Modified files:

Index: src/external/bsd/atf/dist/atf-c/atf-c-api.3
diff -u src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.4 src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.5
--- src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.4	Sat Feb  8 19:13:43 2014
+++ src/external/bsd/atf/dist/atf-c/atf-c-api.3	Fri Jul  3 19:22:38 2020
@@ -276,15 +276,15 @@ In order to do so, a later registration 
 macro detailed in
 .Sx Program initialization .
 .Pp
-Later on, one must define the three parts of the body by means of three
+Later on, one must define the three parts of the test by means of three
 functions.
 Their headers are given by the
 .Fn ATF_TC_HEAD ,
-.Fn ATF_TC_BODY
+.Fn ATF_TC_BODY ,
 and
 .Fn ATF_TC_CLEANUP
 macros, all of which take the test case name provided to the
-.Fn ATF_TC
+.Fn ATF_TC ,
 .Fn ATF_TC_WITH_CLEANUP ,
 or
 .Fn ATF_TC_WITHOUT_HEAD



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

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 19:21:11 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: modmisc.exp

Log Message:
make(1): add expected test result for modmisc


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/modmisc.exp

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

Modified files:

Index: src/usr.bin/make/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.6 src/usr.bin/make/unit-tests/modmisc.exp:1.7
--- src/usr.bin/make/unit-tests/modmisc.exp:1.6	Fri Jul  3 18:41:50 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp	Fri Jul  3 19:21:11 2020
@@ -7,8 +7,8 @@ path_/usr/xbin=/opt/xbin/
 paths=/bin /tmp / /no/such/dir /opt/xbin
 PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
 The answer is 42
-head of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b . . conf.d'
-tail of 'a/b/c def archive.tar.gz conf.d/file' is 'c def archive.tar.gz file'
-suffix of 'a/b/c def archive.tar.gz conf.d/file' is 'gz d/file'
-root of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b/c def archive.tar conf'
+dirname of 'a/b/c def a.b.c a.b/c a a.a .gitignore a a.a' is 'a/b . . a.b . . . . .'
+basename of 'a/b/c def a.b.c a.b/c a a.a .gitignore a a.a' is 'c def a.b.c c a a.a .gitignore a a.a'
+suffix of 'a/b/c def a.b.c a.b/c a a.a .gitignore a a.a' is 'c b/c a gitignore a'
+root of 'a/b/c def a.b.c a.b/c a a.a .gitignore a a.a' is 'a/b/c def a.b a a a  a a'
 exit status 0



CVS commit: src/sys/compat/sys

2020-07-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul  3 19:00:01 UTC 2020

Modified Files:
src/sys/compat/sys: statvfs.h

Log Message:
sync with mount.h, always use the structure size.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/statvfs.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/compat/sys/statvfs.h
diff -u src/sys/compat/sys/statvfs.h:1.2 src/sys/compat/sys/statvfs.h:1.3
--- src/sys/compat/sys/statvfs.h:1.2	Fri Jul  3 10:08:53 2020
+++ src/sys/compat/sys/statvfs.h	Fri Jul  3 15:00:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: statvfs.h,v 1.2 2020/07/03 14:08:53 christos Exp $	 */
+/*	$NetBSD: statvfs.h,v 1.3 2020/07/03 19:00:01 christos Exp $	 */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@ statvfs_to_statvfs90_copy(const void *vs
 	int error;
 
 	statvfs_to_statvfs90(vs, s90);
-	error = copyout(s90, vs90, l);
+	error = copyout(s90, vs90, sizeof(*s90));
 	kmem_free(s90, sizeof(*s90));
 
 	return error;



CVS commit: src/sys/compat/sys

2020-07-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Jul  3 18:49:38 UTC 2020

Modified Files:
src/sys/compat/sys: mount.h

Log Message:
don't overallocate (follows similar change to compat/sys/statvfs.h)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/sys/mount.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/compat/sys/mount.h
diff -u src/sys/compat/sys/mount.h:1.13 src/sys/compat/sys/mount.h:1.14
--- src/sys/compat/sys/mount.h:1.13	Sat Jun 27 15:49:30 2020
+++ src/sys/compat/sys/mount.h	Fri Jul  3 18:49:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.h,v 1.13 2020/06/27 15:49:30 christos Exp $	*/
+/*	$NetBSD: mount.h,v 1.14 2020/07/03 18:49:37 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -137,12 +137,12 @@ statvfs_to_statfs12(const struct statvfs
 static __inline int
 statvfs_to_statfs12_copy(const void *vs, void *vs12, size_t l)
 {
-	struct statfs12 *s12 = STATVFSBUF_GET();
+	struct statfs12 *s12 = kmem_zalloc(sizeof(*s12), KM_SLEEP);
 	int error;
 
 	statvfs_to_statfs12(vs, s12);
 	error = copyout(s12, vs12, sizeof(*s12));
-	STATVFSBUF_PUT(s12);
+	kmem_free(s12, sizeof(*s12));
 
 	return error;
 }



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 18:41:50 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk

Log Message:
make(1): fix bug in :E modifier, introduced in r1.239 today

That case was not covered by the tests before.


To generate a diff of this commit:
cvs rdiff -u -r1.242 -r1.243 src/usr.bin/make/var.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/modmisc.exp \
src/usr.bin/make/unit-tests/modmisc.mk

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.242 src/usr.bin/make/var.c:1.243
--- src/usr.bin/make/var.c:1.242	Fri Jul  3 17:48:47 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 18:41:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.242 2020/07/03 17:48:47 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.243 2020/07/03 18:41:50 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.242 2020/07/03 17:48:47 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.243 2020/07/03 18:41:50 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.242 2020/07/03 17:48:47 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.243 2020/07/03 18:41:50 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1202,7 +1202,7 @@ VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var
 return TRUE;
 }
 
-/* Add the filename suffix of the given word to the buffer. */
+/* Add the filename suffix of the given word to the buffer, if it exists. */
 static Boolean
 VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	  char *word, Boolean addSpace, Buffer *buf,
@@ -1210,7 +1210,7 @@ VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, V
 {
 const char *dot = strrchr(word, '.');
 if (dot == NULL)
-	return FALSE;
+	return addSpace;
 
 if (addSpace && vpstate->varSpace)
 	Buf_AddByte(buf, vpstate->varSpace);

Index: src/usr.bin/make/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.5 src/usr.bin/make/unit-tests/modmisc.exp:1.6
--- src/usr.bin/make/unit-tests/modmisc.exp:1.5	Fri Jul  3 15:41:37 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp	Fri Jul  3 18:41:50 2020
@@ -7,8 +7,8 @@ path_/usr/xbin=/opt/xbin/
 paths=/bin /tmp / /no/such/dir /opt/xbin
 PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
 The answer is 42
-head of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b . . conf.d
-tail of 'a/b/c def archive.tar.gz conf.d/file' is 'c def archive.tar.gz file
-suffix of 'a/b/c def archive.tar.gz conf.d/file' is 'gz d/file
-root of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b/c def archive.tar conf
+head of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b . . conf.d'
+tail of 'a/b/c def archive.tar.gz conf.d/file' is 'c def archive.tar.gz file'
+suffix of 'a/b/c def archive.tar.gz conf.d/file' is 'gz d/file'
+root of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b/c def archive.tar conf'
 exit status 0
Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.5 src/usr.bin/make/unit-tests/modmisc.mk:1.6
--- src/usr.bin/make/unit-tests/modmisc.mk:1.5	Fri Jul  3 15:41:37 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Fri Jul  3 18:41:50 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.5 2020/07/03 15:41:37 rillig Exp $
+# $Id: modmisc.mk,v 1.6 2020/07/03 18:41:50 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -37,9 +37,9 @@ modvarloop:
 	@echo "paths=${paths}"
 	@echo "PATHS=${paths:tu}"
 
-PATHNAMES=	a/b/c def archive.tar.gz conf.d/file
+PATHNAMES=	a/b/c def a.b.c a.b/c a a.a .gitignore a a.a
 mod-HTE:
-	@echo "head of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q}
-	@echo "tail of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q}
-	@echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q}
-	@echo "root of '"${PATHNAMES:Q}"' is '"${PATHNAMES:R:Q}
+	@echo "dirname of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q}"'"
+	@echo "basename of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q}"'"
+	@echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q}"'"
+	@echo "root of '"${PATHNAMES:Q}"' is '"${PATHNAMES:R:Q}"'"



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 17:48:47 UTC 2020

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

Log Message:
make(1): fix indentation in var.c

Fixing the indentation manually is a tedious task.  indent(1) was no help
since it has several bugs and is not flexible enough for the original
make code.


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 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/var.c
diff -u src/usr.bin/make/var.c:1.241 src/usr.bin/make/var.c:1.242
--- src/usr.bin/make/var.c:1.241	Fri Jul  3 17:03:09 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 17:48:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.241 2020/07/03 17:03:09 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.242 2020/07/03 17:48:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.241 2020/07/03 17:03:09 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.242 2020/07/03 17:48:47 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.241 2020/07/03 17:03:09 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.242 2020/07/03 17:48:47 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -372,45 +372,47 @@ VarFind(const char *name, GNode *ctxt, i
 Hash_Entry 	*var;
 Var			*v;
 
-	/*
-	 * If the variable name begins with a '.', it could very well be one of
-	 * the local ones.  We check the name against all the local variables
-	 * and substitute the short version in for 'name' if it matches one of
-	 * them.
-	 */
-	if (*name == '.' && isupper((unsigned char) name[1]))
-		switch (name[1]) {
-		case 'A':
-			if (!strcmp(name, ".ALLSRC"))
-name = ALLSRC;
-			if (!strcmp(name, ".ARCHIVE"))
-name = ARCHIVE;
-			break;
-		case 'I':
-			if (!strcmp(name, ".IMPSRC"))
-name = IMPSRC;
-			break;
-		case 'M':
-			if (!strcmp(name, ".MEMBER"))
-name = MEMBER;
-			break;
-		case 'O':
-			if (!strcmp(name, ".OODATE"))
-name = OODATE;
-			break;
-		case 'P':
-			if (!strcmp(name, ".PREFIX"))
-name = PREFIX;
-			break;
-		case 'T':
-			if (!strcmp(name, ".TARGET"))
-name = TARGET;
-			break;
-		}
+/*
+ * If the variable name begins with a '.', it could very well be one of
+ * the local ones.  We check the name against all the local variables
+ * and substitute the short version in for 'name' if it matches one of
+ * them.
+ */
+if (*name == '.' && isupper((unsigned char) name[1])) {
+	switch (name[1]) {
+	case 'A':
+	if (!strcmp(name, ".ALLSRC"))
+		name = ALLSRC;
+	if (!strcmp(name, ".ARCHIVE"))
+		name = ARCHIVE;
+	break;
+	case 'I':
+	if (!strcmp(name, ".IMPSRC"))
+		name = IMPSRC;
+	break;
+	case 'M':
+	if (!strcmp(name, ".MEMBER"))
+		name = MEMBER;
+	break;
+	case 'O':
+	if (!strcmp(name, ".OODATE"))
+		name = OODATE;
+	break;
+	case 'P':
+	if (!strcmp(name, ".PREFIX"))
+		name = PREFIX;
+	break;
+	case 'T':
+	if (!strcmp(name, ".TARGET"))
+		name = TARGET;
+	break;
+	}
+}
+
 #ifdef notyet
 /* for compatibility with gmake */
 if (name[0] == '^' && name[1] == '\0')
-	name = ALLSRC;
+	name = ALLSRC;
 #endif
 
 /*
@@ -526,7 +528,7 @@ VarAdd(const char *name, const char *val
 v = bmake_malloc(sizeof(Var));
 
 len = val ? strlen(val) : 0;
-Buf_Init(>val, len+1);
+Buf_Init(>val, len + 1);
 Buf_AddBytes(>val, len, val);
 
 v->flags = 0;
@@ -582,7 +584,7 @@ Var_Delete(const char *name, GNode *ctxt
 	var_exportedVars = VAR_EXPORTED_NONE;
 	}
 	if (v->name != ln->name)
-		free(v->name);
+	free(v->name);
 	Hash_DeleteEntry(>context, ln);
 	Buf_Destroy(>val, TRUE);
 	free(v);
@@ -675,8 +677,8 @@ Var_Export1(const char *name, int flags)
 static void
 Var_ExportVars_callback(void *entry, void *unused MAKE_ATTR_UNUSED)
 {
-	Var *var = entry;
-	Var_Export1(var->name, 0);
+Var *var = entry;
+Var_Export1(var->name, 0);
 }
 
 /*
@@ -809,7 +811,7 @@ Var_UnExport(char *str)
 int n;
 
 if (!str || !str[0]) {
-	return; 		/* assert? */
+	return;			/* assert? */
 }
 
 vlist = NULL;
@@ -896,7 +898,8 @@ Var_UnExport(char *str)
 }
 
 static void
-Var_Set_Flags(const char *name, const char *val, GNode *ctxt, VarSet_Flags flags)
+Var_Set_with_flags(const char *name, const char *val, GNode *ctxt,
+		   VarSet_Flags flags)
 {
 Var   *v;
 char *expanded_name = NULL;
@@ -981,7 +984,7 @@ Var_Set_Flags(const char *name, const ch
 	save_dollars = s2Boolean(val, save_dollars);
 }
 
- out:
+out:
 free(expanded_name);
 if (v != NULL)
 	VarFreeEnv(v, TRUE);
@@ -1018,7 +1021,7 @@ Var_Set_Flags(const char *name, const ch
 void
 Var_Set(const char *name, const char *val, GNode *ctxt)
 {
-	

CVS commit: src/sys/arch/arm/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 17:22:14 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: genassym.cf

Log Message:
KNF (sort includes)


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/arm/arm32/genassym.cf

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/arm32/genassym.cf
diff -u src/sys/arch/arm/arm32/genassym.cf:1.89 src/sys/arch/arm/arm32/genassym.cf:1.90
--- src/sys/arch/arm/arm32/genassym.cf:1.89	Fri Mar 20 19:48:03 2020
+++ src/sys/arch/arm/arm32/genassym.cf	Fri Jul  3 17:22:14 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.89 2020/03/20 19:48:03 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.90 2020/07/03 17:22:14 skrll Exp $
 
 # Copyright (c) 1982, 1990 The Regents of the University of California.
 # All rights reserved.
@@ -37,12 +37,14 @@ include "opt_execfmt.h"
 endif
 
 include 
-include 
+
+include 
 include 
 include 
 include 
-include 
 include 
+include 
+
 include 
 include 
 include 
@@ -52,11 +54,12 @@ include 
 include 
 
 include 
-include 
 include 
+include 
 include 
 
 include 
+
 include 
 include 
 include 



CVS commit: src/sys/arch/arm/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 17:14:23 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
1 page is enough for memhook now since the merge of the rmind-uvmplock
branch and the removal of sys/arch/arm/arm32/mem.c

The last users of memhook don't care about number of CPUs or page colours.


To generate a diff of this commit:
cvs rdiff -u -r1.415 -r1.416 src/sys/arch/arm/arm32/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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.415 src/sys/arch/arm/arm32/pmap.c:1.416
--- src/sys/arch/arm/arm32/pmap.c:1.415	Sun Jun 21 07:14:15 2020
+++ src/sys/arch/arm/arm32/pmap.c	Fri Jul  3 17:14:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.415 2020/06/21 07:14:15 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.416 2020/07/03 17:14:23 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -192,7 +192,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.415 2020/06/21 07:14:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.416 2020/07/03 17:14:23 skrll Exp $");
 
 #include 
 #include 
@@ -6301,6 +6301,9 @@ pmap_bootstrap(vaddr_t vstart, vaddr_t v
 	virtual_end = vend;
 
 	VPRINTF("specials ");
+
+	pmap_alloc_specials(_avail, 1, , NULL);
+
 #ifdef PMAP_CACHE_VIPT
 	/*
 	 * If we have a VIPT cache, we need one page/pte per possible alias
@@ -6325,7 +6328,6 @@ pmap_bootstrap(vaddr_t vstart, vaddr_t v
 	pmap_set_pt_cache_mode(l1pt, (vaddr_t)csrc_pte, nptes);
 	pmap_alloc_specials(_avail, nptes, , _pte);
 	pmap_set_pt_cache_mode(l1pt, (vaddr_t)cdst_pte, nptes);
-	pmap_alloc_specials(_avail, nptes, , NULL);
 	if (msgbufaddr == NULL) {
 		pmap_alloc_specials(_avail,
 		round_page(MSGBUFSIZE) / PAGE_SIZE,



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 17:03:09 UTC 2020

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

Log Message:
make(1): add Hash_ForEach to avoid duplicate code


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/make/hash.c
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/hash.h
cvs rdiff -u -r1.240 -r1.241 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/hash.c
diff -u src/usr.bin/make/hash.c:1.21 src/usr.bin/make/hash.c:1.22
--- src/usr.bin/make/hash.c:1.21	Fri Jul  3 08:02:55 2020
+++ src/usr.bin/make/hash.c	Fri Jul  3 17:03:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.c,v 1.21 2020/07/03 08:02:55 rillig Exp $	*/
+/*	$NetBSD: hash.c,v 1.22 2020/07/03 17:03:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: hash.c,v 1.21 2020/07/03 08:02:55 rillig Exp $";
+static char rcsid[] = "$NetBSD: hash.c,v 1.22 2020/07/03 17:03:09 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)hash.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: hash.c,v 1.21 2020/07/03 08:02:55 rillig Exp $");
+__RCSID("$NetBSD: hash.c,v 1.22 2020/07/03 17:03:09 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -464,3 +464,14 @@ RebuildTable(Hash_Table *t)
 	}
 	free(oldhp);
 }
+
+void Hash_ForEach(Hash_Table *t, void (*action)(void *, void *), void *data)
+{
+	Hash_Search search;
+	Hash_Entry *e;
+
+	for (e = Hash_EnumFirst(t, );
+	 e != NULL;
+	 e = Hash_EnumNext())
+		action(Hash_GetValue(e), data);
+}

Index: src/usr.bin/make/hash.h
diff -u src/usr.bin/make/hash.h:1.12 src/usr.bin/make/hash.h:1.13
--- src/usr.bin/make/hash.h:1.12	Wed May 31 21:07:03 2017
+++ src/usr.bin/make/hash.h	Fri Jul  3 17:03:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.h,v 1.12 2017/05/31 21:07:03 maya Exp $	*/
+/*	$NetBSD: hash.h,v 1.13 2020/07/03 17:03:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -145,5 +145,6 @@ Hash_Entry *Hash_CreateEntry(Hash_Table 
 void Hash_DeleteEntry(Hash_Table *, Hash_Entry *);
 Hash_Entry *Hash_EnumFirst(Hash_Table *, Hash_Search *);
 Hash_Entry *Hash_EnumNext(Hash_Search *);
+void Hash_ForEach(Hash_Table *, void (*)(void *, void *), void *);
 
 #endif /* _HASH_H */

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.240 src/usr.bin/make/var.c:1.241
--- src/usr.bin/make/var.c:1.240	Fri Jul  3 17:00:47 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 17:03:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.240 2020/07/03 17:00:47 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.241 2020/07/03 17:03:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.240 2020/07/03 17:00:47 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.241 2020/07/03 17:03:09 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.240 2020/07/03 17:00:47 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.241 2020/07/03 17:03:09 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -338,7 +338,6 @@ static char *VarModify(GNode *, Var_Pars
 static char *VarOrder(const char *, const char);
 static char *VarUniq(const char *);
 static int VarWordCompare(const void *, const void *);
-static void VarPrintVar(void *);
 
 #define BROPEN	'{'
 #define BRCLOSE	'}'
@@ -673,6 +672,13 @@ Var_Export1(const char *name, int flags)
 return 1;
 }
 
+static void
+Var_ExportVars_callback(void *entry, void *unused MAKE_ATTR_UNUSED)
+{
+	Var *var = entry;
+	Var_Export1(var->name, 0);
+}
+
 /*
  * This gets called from our children.
  */
@@ -680,9 +686,6 @@ void
 Var_ExportVars(void)
 {
 char tmp[BUFSIZ];
-Hash_Entry  *var;
-Hash_Search state;
-Var *v;
 char *val;
 int n;
 
@@ -699,15 +702,8 @@ Var_ExportVars(void)
 	return;
 
 if (VAR_EXPORTED_ALL == var_exportedVars) {
-	/*
-	 * Ouch! This is crazy...
-	 */
-	for (var = Hash_EnumFirst(_GLOBAL->context, );
-	 var != NULL;
-	 var = Hash_EnumNext()) {
-	v = (Var *)Hash_GetValue(var);
-	Var_Export1(v->name, 0);
-	}
+	/* Ouch! This is crazy... */
+	Hash_ForEach(_GLOBAL->context, Var_ExportVars_callback, NULL);
 	return;
 }
 /*
@@ -4291,7 +4287,7 @@ Var_End(void)
 
 /** PRINT DEBUGGING INFO */
 static void
-VarPrintVar(void *vp)
+VarPrintVar(void *vp, void *data MAKE_ATTR_UNUSED)
 {
 Var*v = (Var *)vp;
 fprintf(debug_file, "%-16s = %s\n", v->name, Buf_GetAll(>val, NULL));
@@ -4306,12 +4302,5 @@ VarPrintVar(void *vp)
 void
 Var_Dump(GNode *ctxt)
 {
-Hash_Search search;
-Hash_Entry *h;
-
-

CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 17:00:48 UTC 2020

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

Log Message:
make(1): fix indentation and alignment


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 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/var.c
diff -u src/usr.bin/make/var.c:1.239 src/usr.bin/make/var.c:1.240
--- src/usr.bin/make/var.c:1.239	Fri Jul  3 15:42:43 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 17:00:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.239 2020/07/03 15:42:43 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.240 2020/07/03 17:00:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.239 2020/07/03 15:42:43 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.240 2020/07/03 17:00:47 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.239 2020/07/03 15:42:43 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.240 2020/07/03 17:00:47 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -187,29 +187,29 @@ static Boolean save_dollars = TRUE;
  * The four contexts are searched in the reverse order from which they are
  * listed.
  */
-GNode  *VAR_INTERNAL; /* variables from make itself */
-GNode  *VAR_GLOBAL;   /* variables from the makefile */
-GNode  *VAR_CMD;  /* variables defined on the command-line */
-
-#define FIND_CMD	0x1   /* look in VAR_CMD when searching */
-#define FIND_GLOBAL	0x2   /* look in VAR_GLOBAL as well */
-#define FIND_ENV  	0x4   /* look in the environment also */
+GNode  *VAR_INTERNAL;	/* variables from make itself */
+GNode  *VAR_GLOBAL;	/* variables from the makefile */
+GNode  *VAR_CMD;	/* variables defined on the command-line */
+
+#define FIND_CMD	0x1	/* look in VAR_CMD when searching */
+#define FIND_GLOBAL	0x2	/* look in VAR_GLOBAL as well */
+#define FIND_ENV  	0x4	/* look in the environment also */
 
 typedef enum {
-	VAR_IN_USE	= 0x01,	/* Variable's value is currently being used.
+VAR_IN_USE		= 0x01,	/* Variable's value is currently being used.
  * Used to avoid endless recursion */
-	VAR_FROM_ENV	= 0x02,	/* Variable comes from the environment */
-	VAR_JUNK	= 0x04,	/* Variable is a junk variable that
+VAR_FROM_ENV	= 0x02,	/* Variable comes from the environment */
+VAR_JUNK		= 0x04,	/* Variable is a junk variable that
  * should be destroyed when done with
  * it. Used by Var_Parse for undefined,
  * modified variables */
-	VAR_KEEP	= 0x08,	/* Variable is VAR_JUNK, but we found
+VAR_KEEP		= 0x08,	/* Variable is VAR_JUNK, but we found
  * a use for it in some modifier and
  * the value is therefore valid */
-	VAR_EXPORTED	= 0x10,	/* Variable is exported */
-	VAR_REEXPORT	= 0x20,	/* Indicate if var needs re-export.
+VAR_EXPORTED	= 0x10,	/* Variable is exported */
+VAR_REEXPORT	= 0x20,	/* Indicate if var needs re-export.
  * This would be true if it contains $'s */
-	VAR_FROM_CMD	= 0x40	/* Variable came from command line */
+VAR_FROM_CMD	= 0x40	/* Variable came from command line */
 } Var_Flags;
 
 typedef struct Var {
@@ -608,7 +608,7 @@ Var_Export1(const char *name, int flags)
 int parent = (flags & VAR_EXPORT_PARENT);
 
 if (*name == '.')
-	return 0;			/* skip internals */
+	return 0;		/* skip internals */
 if (!name[1]) {
 	/*
 	 * A single char.
@@ -680,8 +680,8 @@ void
 Var_ExportVars(void)
 {
 char tmp[BUFSIZ];
-Hash_Entry 	*var;
-Hash_Search 	state;
+Hash_Entry  *var;
+Hash_Search state;
 Var *v;
 char *val;
 int n;
@@ -813,7 +813,7 @@ Var_UnExport(char *str)
 int n;
 
 if (!str || !str[0]) {
-	return; 			/* assert? */
+	return; 		/* assert? */
 }
 
 vlist = NULL;
@@ -1770,12 +1770,12 @@ static char *
 VarSelectWords(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	   const char *str, VarSelectWords_t *seldata)
 {
-Buffer  	  buf;		/* Buffer for the new string */
-Boolean 	  addSpace; 	/* TRUE if need to add a space to the
- * buffer before adding the trimmed
- * word */
-char **av;			/* word list */
-char *as;			/* word list memory */
+Buffer  	  buf;		/* Buffer for the new string */
+Boolean 	  addSpace; 	/* TRUE if need to add a space to the
+ * buffer before adding the trimmed
+ * word */
+char **av;			/* word list */
+char *as;			/* word list memory */
 int ac, i;
 int start, end, step;
 
@@ -1888,12 +1888,11 @@ VarModify(GNode *ctx, Var_Parse_State *v
 		   Boolean, Buffer *, void *),
 void *datum)
 {
-Buffer  	  buf;		/* Buffer for the new string */
-Boolean 	  addSpace; 

CVS commit: src/sys

2020-07-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jul  3 16:23:03 UTC 2020

Modified Files:
src/sys/arch/amiga/dev: clock.c
src/sys/arch/arm/at91: at91st.c at91tctmr.c
src/sys/arch/atari/dev: clock.c
src/sys/arch/vax/vax: clock.c
src/sys/external/bsd/common/include/linux: completion.h
src/sys/external/bsd/drm2/include/drm: drm_wait_netbsd.h
src/sys/external/bsd/drm2/include/linux: sched.h
src/sys/external/bsd/drm2/linux: linux_fence.c

Log Message:
hardclock_ticks -> getticks()


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/dev/clock.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/at91/at91st.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/at91/at91tctmr.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/atari/dev/clock.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/vax/vax/clock.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/common/include/linux/completion.h
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/drm2/include/linux/sched.h
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/linux/linux_fence.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/amiga/dev/clock.c
diff -u src/sys/arch/amiga/dev/clock.c:1.57 src/sys/arch/amiga/dev/clock.c:1.58
--- src/sys/arch/amiga/dev/clock.c:1.57	Fri May 29 05:35:47 2020
+++ src/sys/arch/amiga/dev/clock.c	Fri Jul  3 16:23:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.57 2020/05/29 05:35:47 rin Exp $ */
+/*	$NetBSD: clock.c,v 1.58 2020/07/03 16:23:03 maxv Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.57 2020/05/29 05:35:47 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.58 2020/07/03 16:23:03 maxv Exp $");
 
 #include 
 #include 
@@ -292,9 +292,9 @@ clk_getcounter(struct timecounter *tc)
 	u_int counter;
 
 	do {
-		cur_hardclock = hardclock_ticks;
+		cur_hardclock = getticks();
 		counter = clk_gettick();
-	} while (cur_hardclock != hardclock_ticks);
+	} while (cur_hardclock != getticks());
 
 	/*
 	 * Handle the situation of a wrapped interval counter, while

Index: src/sys/arch/arm/at91/at91st.c
diff -u src/sys/arch/arm/at91/at91st.c:1.6 src/sys/arch/arm/at91/at91st.c:1.7
--- src/sys/arch/arm/at91/at91st.c:1.6	Mon Nov 12 18:00:36 2012
+++ src/sys/arch/arm/at91/at91st.c	Fri Jul  3 16:23:02 2020
@@ -1,4 +1,4 @@
-/*$NetBSD: at91st.c,v 1.6 2012/11/12 18:00:36 skrll Exp $*/
+/*$NetBSD: at91st.c,v 1.7 2020/07/03 16:23:02 maxv Exp $*/
 
 /*
  * AT91RM9200 clock functions
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at91st.c,v 1.6 2012/11/12 18:00:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91st.c,v 1.7 2020/07/03 16:23:02 maxv Exp $");
 
 #include 
 #include 
@@ -213,8 +213,8 @@ at91st_intr(void *arg)
 /* call the kernel timer handler */
 hardclock((struct clockframe*) arg);
 #if 0
-if (hardclock_ticks % (HZ * 10) == 0)
-printf("time %i sec\n", hardclock_ticks/HZ);
+if (getticks() % (HZ * 10) == 0)
+printf("time %i sec\n", getticks()/HZ);
 #endif
 return 1;
 }
@@ -333,18 +333,17 @@ microtime(register struct timeval *tvp)
 
 
 #if 0
-extern int hardclock_ticks;
 static void tdelay(unsigned int ticks)
 {
 uint32_t   start, end, current;
 
-current = hardclock_ticks;
+current = getticks();
 start = current;
 end = start + ticks;
 
 /* just loop for the specified number of ticks */
 while (current < end)
-current = hardclock_ticks;
+current = getticks();
 }
 #endif
 

Index: src/sys/arch/arm/at91/at91tctmr.c
diff -u src/sys/arch/arm/at91/at91tctmr.c:1.8 src/sys/arch/arm/at91/at91tctmr.c:1.9
--- src/sys/arch/arm/at91/at91tctmr.c:1.8	Fri May 29 12:30:38 2020
+++ src/sys/arch/arm/at91/at91tctmr.c	Fri Jul  3 16:23:02 2020
@@ -1,4 +1,4 @@
-/*$NetBSD: at91tctmr.c,v 1.8 2020/05/29 12:30:38 rin Exp $*/
+/*$NetBSD: at91tctmr.c,v 1.9 2020/07/03 16:23:02 maxv Exp $*/
 
 /*
  * AT91 Timer Counter (TC) based clock functions
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at91tctmr.c,v 1.8 2020/05/29 12:30:38 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91tctmr.c,v 1.9 2020/07/03 16:23:02 maxv Exp $");
 
 #include 
 #include 
@@ -302,20 +302,20 @@ static void udelay(unsigned int usec)
 unsigned footick = (sc->sc_timerclock * 64ULL / 100UL);
 
 if (usec > 0) {
-  prev_ticks = hardclock_ticks;
+  prev_ticks = getticks();
   __insn_barrier();
   prev_cvr = READ_TC(sc, TC_CV);
-  ticks = hardclock_ticks;
+  ticks = getticks();
   __insn_barrier();
   if (ticks != prev_ticks) {
 	prev_cvr = READ_TC(sc, TC_CV);
 	prev_ticks = ticks;
   }
   for (;;) {
-	ticks = hardclock_ticks;
+	ticks = getticks();
 	

CVS commit: src/sys/kern

2020-07-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jul  3 16:11:11 UTC 2020

Modified Files:
src/sys/kern: subr_kcov.c

Log Message:
Sync trace-pc and trace-cmp.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/subr_kcov.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/kern/subr_kcov.c
diff -u src/sys/kern/subr_kcov.c:1.15 src/sys/kern/subr_kcov.c:1.16
--- src/sys/kern/subr_kcov.c:1.15	Sat May 16 17:42:06 2020
+++ src/sys/kern/subr_kcov.c	Fri Jul  3 16:11:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kcov.c,v 1.15 2020/05/16 17:42:06 hannken Exp $	*/
+/*	$NetBSD: subr_kcov.c,v 1.16 2020/07/03 16:11:11 maxv Exp $	*/
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -649,10 +649,16 @@ trace_cmp(uint64_t type, uint64_t arg1, 
 		return;
 	}
 
+	if (__predict_false(kd->silenced)) {
+		/* Silenced. */
+		return;
+	}
+
 	if (kd->mode != KCOV_MODE_TRACE_CMP) {
 		/* CMP tracing mode not enabled */
 		return;
 	}
+	KASSERT(kd->remote == NULL);
 
 	idx = kd->buf[0];
 	if ((idx * 4 + 4) <= kd->bufnent) {



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

2020-07-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jul  3 16:17:25 UTC 2020

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

Log Message:
In cpu_uarea_{alloc,free}:

 - My previous change in this file was not correct, kremove does not free
   the underlying PA, which caused a very slow leak under memory pressure.
   Rework to correctly free the PA.
 - Add a second redzone, this time after the stack, to catch several stack
   overflows. The main concern is read overflows which leak the heap that
   follows the stack.
 - UVM_KMF_WAITVA doesn't fail, so remove error check.
 - Add KASSERTs.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x86/x86/vm_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/x86/x86/vm_machdep.c
diff -u src/sys/arch/x86/x86/vm_machdep.c:1.42 src/sys/arch/x86/x86/vm_machdep.c:1.43
--- src/sys/arch/x86/x86/vm_machdep.c:1.42	Tue Mar 17 17:18:49 2020
+++ src/sys/arch/x86/x86/vm_machdep.c	Fri Jul  3 16:17:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.42 2020/03/17 17:18:49 maxv Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.43 2020/07/03 16:17:24 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.42 2020/03/17 17:18:49 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.43 2020/07/03 16:17:24 maxv Exp $");
 
 #include "opt_mtrr.h"
 
@@ -349,29 +349,56 @@ vunmapbuf(struct buf *bp, vsize_t len)
 }
 
 #ifdef __HAVE_CPU_UAREA_ROUTINES
+/*
+ * Layout of the uarea:
+ *Page[0]= PCB
+ *Page[1]= RedZone
+ *Page[2]= Stack
+ *Page[...]  = Stack
+ *Page[UPAGES-1] = Stack
+ *Page[UPAGES]   = RedZone
+ * There is a redzone at the beginning of the stack, and another one at the
+ * end. The former is to protect against deep recursions that could corrupt
+ * the PCB, the latter to protect against severe stack overflows.
+ */
 void *
 cpu_uarea_alloc(bool system)
 {
-	vaddr_t va;
+	vaddr_t base, va;
+	paddr_t pa;
 
-	va = uvm_km_alloc(kernel_map, USPACE, 0, UVM_KMF_WIRED|UVM_KMF_WAITVA);
-	if (va == 0)
-		return NULL;
+	base = uvm_km_alloc(kernel_map, USPACE + PAGE_SIZE, 0,
+	UVM_KMF_WIRED|UVM_KMF_WAITVA);
+
+	/* Page[1] = RedZone */
+	va = base + PAGE_SIZE;
+	if (!pmap_extract(pmap_kernel(), va, )) {
+		panic("%s: impossible, Page[1] unmapped", __func__);
+	}
+	pmap_kremove(va, PAGE_SIZE);
+	uvm_pagefree(PHYS_TO_VM_PAGE(pa));
+
+	/* Page[UPAGES] = RedZone */
+	va = base + USPACE;
+	if (!pmap_extract(pmap_kernel(), va, )) {
+		panic("%s: impossible, Page[UPAGES] unmapped", __func__);
+	}
+	pmap_kremove(va, PAGE_SIZE);
+	uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 
-	/*
-	 * The second page is unmapped, and acts as a guard page between the
-	 * PCB (first page) and the stack (rest of the pages).
-	 */
-	pmap_kremove(va + PAGE_SIZE, PAGE_SIZE);
 	pmap_update(pmap_kernel());
 
-	return (void *)va;
+	return (void *)base;
 }
 
 bool
 cpu_uarea_free(void *addr)
 {
-	uvm_km_free(kernel_map, (vaddr_t)addr, USPACE, UVM_KMF_WIRED);
+	vaddr_t base = (vaddr_t)addr;
+
+	KASSERT(!pmap_extract(pmap_kernel(), base + PAGE_SIZE, NULL));
+	KASSERT(!pmap_extract(pmap_kernel(), base + USPACE, NULL));
+	uvm_km_free(kernel_map, base, USPACE + PAGE_SIZE, UVM_KMF_WIRED);
 	return true;
 }
 #endif /* __HAVE_CPU_UAREA_ROUTINES */



CVS commit: src/share/mk

2020-07-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jul  3 16:12:16 UTC 2020

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

Log Message:
Enable trace-cmp.


To generate a diff of this commit:
cvs rdiff -u -r1.301 -r1.302 src/share/mk/bsd.sys.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.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.301 src/share/mk/bsd.sys.mk:1.302
--- src/share/mk/bsd.sys.mk:1.301	Fri May 15 19:07:01 2020
+++ src/share/mk/bsd.sys.mk	Fri Jul  3 16:12:16 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.301 2020/05/15 19:07:01 maxv Exp $
+#	$NetBSD: bsd.sys.mk,v 1.302 2020/07/03 16:12:16 maxv Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -237,7 +237,7 @@ CFLAGS+=	${CPUFLAGS}
 AFLAGS+=	${CPUFLAGS}
 
 .if ${KCOV:U0} > 0
-KCOVFLAGS=	-fsanitize-coverage=trace-pc
+KCOVFLAGS=	-fsanitize-coverage=trace-pc,trace-cmp
 .for f in subr_kcov.c subr_asan.c subr_csan.c subr_msan.c ubsan.c
 KCOVFLAGS.${f}=		# empty
 .endfor



CVS commit: src/sys/dev/nvmm

2020-07-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jul  3 16:09:55 UTC 2020

Modified Files:
src/sys/dev/nvmm: nvmm.c nvmm_internal.h
src/sys/dev/nvmm/x86: nvmm_x86_svm.c nvmm_x86_vmx.c

Log Message:
Print the backend name when attaching.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/nvmm/nvmm.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/nvmm/nvmm_internal.h
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/nvmm.c
diff -u src/sys/dev/nvmm/nvmm.c:1.31 src/sys/dev/nvmm/nvmm.c:1.32
--- src/sys/dev/nvmm/nvmm.c:1.31	Thu Jun 25 17:01:19 2020
+++ src/sys/dev/nvmm/nvmm.c	Fri Jul  3 16:09:54 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: nvmm.c,v 1.31 2020/06/25 17:01:19 maxv Exp $	*/
+/*	$NetBSD: nvmm.c,v 1.32 2020/07/03 16:09:54 maxv Exp $	*/
 
 /*
- * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.31 2020/06/25 17:01:19 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.32 2020/07/03 16:09:54 maxv Exp $");
 
 #include 
 #include 
@@ -1209,7 +1209,8 @@ nvmm_attach(device_t parent, device_t se
 	error = nvmm_init();
 	if (error)
 		panic("%s: impossible", __func__);
-	aprint_normal_dev(self, "attached\n");
+	aprint_normal_dev(self, "attached, using backend %s\n",
+	nvmm_impl->name);
 }
 
 static int

Index: src/sys/dev/nvmm/nvmm_internal.h
diff -u src/sys/dev/nvmm/nvmm_internal.h:1.15 src/sys/dev/nvmm/nvmm_internal.h:1.16
--- src/sys/dev/nvmm/nvmm_internal.h:1.15	Sun May 24 08:08:49 2020
+++ src/sys/dev/nvmm/nvmm_internal.h	Fri Jul  3 16:09:54 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: nvmm_internal.h,v 1.15 2020/05/24 08:08:49 maxv Exp $	*/
+/*	$NetBSD: nvmm_internal.h,v 1.16 2020/07/03 16:09:54 maxv Exp $	*/
 
 /*
- * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -91,6 +91,7 @@ struct nvmm_machine {
 };
 
 struct nvmm_impl {
+	const char *name;
 	bool (*ident)(void);
 	void (*init)(void);
 	void (*fini)(void);

Index: src/sys/dev/nvmm/x86/nvmm_x86_svm.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.62 src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.63
--- src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.62	Sun May 24 08:08:49 2020
+++ src/sys/dev/nvmm/x86/nvmm_x86_svm.c	Fri Jul  3 16:09:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_svm.c,v 1.62 2020/05/24 08:08:49 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_svm.c,v 1.63 2020/07/03 16:09:54 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.62 2020/05/24 08:08:49 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.63 2020/07/03 16:09:54 maxv Exp $");
 
 #include 
 #include 
@@ -2430,6 +2430,7 @@ svm_capability(struct nvmm_capability *c
 }
 
 const struct nvmm_impl nvmm_x86_svm = {
+	.name = "x86-svm",
 	.ident = svm_ident,
 	.init = svm_init,
 	.fini = svm_fini,

Index: src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.60 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.61
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.60	Thu Jun 18 16:31:15 2020
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Fri Jul  3 16:09:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.60 2020/06/18 16:31:15 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.61 2020/07/03 16:09:54 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.60 2020/06/18 16:31:15 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.61 2020/07/03 16:09:54 maxv Exp $");
 
 #include 
 #include 
@@ -3392,6 +3392,7 @@ vmx_capability(struct nvmm_capability *c
 }
 
 const struct nvmm_impl nvmm_x86_vmx = {
+	.name = "x86-vmx",
 	.ident = vmx_ident,
 	.init = vmx_init,
 	.fini = vmx_fini,



CVS commit: src/tests/lib/libi386

2020-07-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jul  3 16:07:52 UTC 2020

Modified Files:
src/tests/lib/libi386: t_user_ldt.c

Log Message:
more


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libi386/t_user_ldt.c

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

Modified files:

Index: src/tests/lib/libi386/t_user_ldt.c
diff -u src/tests/lib/libi386/t_user_ldt.c:1.3 src/tests/lib/libi386/t_user_ldt.c:1.4
--- src/tests/lib/libi386/t_user_ldt.c:1.3	Sat May  9 09:08:41 2020
+++ src/tests/lib/libi386/t_user_ldt.c	Fri Jul  3 16:07:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_user_ldt.c,v 1.3 2020/05/09 09:08:41 maxv Exp $	*/
+/*	$NetBSD: t_user_ldt.c,v 1.4 2020/07/03 16:07:52 maxv Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -92,6 +92,12 @@ build_desc(union descriptor *desc, void 
 }
 
 static void
+set_ds(unsigned int val)
+{
+	__asm volatile("mov %0,%%ds"::"r" ((unsigned short)val));
+}
+
+static void
 set_fs(unsigned int val)
 {
 	__asm volatile("mov %0,%%fs"::"r" ((unsigned short)val));
@@ -181,10 +187,98 @@ ATF_TC_BODY(filter_ops, tc)
 
 /* -- */
 
+static void
+iretq_gp__gp_handler(int signo, siginfo_t *sig, void *ctx)
+{
+	ATF_REQUIRE(sig->si_signo == SIGSEGV);
+	ATF_REQUIRE(sig->si_code == SEGV_ACCERR);
+	atf_tc_pass();
+	/* NOTREACHED */
+}
+
+ATF_TC(iretq_gp);
+ATF_TC_HEAD(iretq_gp, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Ensure that the kernel correctly handles iretq #GP faults");
+}
+ATF_TC_BODY(iretq_gp, tc)
+{
+	union descriptor desc;
+	struct sigaction act;
+
+	if (!user_ldt_supported) {
+		atf_tc_skip("USER_LDT disabled");
+	}
+
+	/* Build a desc, set %ds to it. */
+	build_desc(, 0, 0xFUL, SDT_MEMRWA, SEL_UPL, 1, 1);
+	ATF_REQUIRE_EQ(i386_set_ldt(256, , 1), 256);
+	set_ds(LSEL(256, SEL_UPL));
+
+	/* Register the fault handler. */
+	memset(, 0, sizeof(act));
+	act.sa_sigaction = iretq_gp__gp_handler;
+	act.sa_flags = SA_SIGINFO;
+	ATF_REQUIRE_EQ(sigaction(SIGSEGV, , NULL), 0);
+
+	/* Set NULL on %ds, iretq should fault. */
+	memset(, 0, sizeof(desc));
+	ATF_REQUIRE_EQ(i386_set_ldt(256, , 1), 256);
+
+	atf_tc_fail("test did not fault as expected");
+}
+
+/* -- */
+
+static void
+iretq_np__np_handler(int signo, siginfo_t *sig, void *ctx)
+{
+	ATF_REQUIRE(sig->si_signo == SIGBUS);
+	ATF_REQUIRE(sig->si_code == BUS_ADRERR);
+	atf_tc_pass();
+	/* NOTREACHED */
+}
+
+ATF_TC(iretq_np);
+ATF_TC_HEAD(iretq_np, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Ensure that the kernel correctly handles iretq #NP faults");
+}
+ATF_TC_BODY(iretq_np, tc)
+{
+	union descriptor desc;
+	struct sigaction act;
+
+	if (!user_ldt_supported) {
+		atf_tc_skip("USER_LDT disabled");
+	}
+
+	/* Build a desc, set %ds to it. */
+	build_desc(, 0, 0xUL, SDT_MEMRWA, SEL_UPL, 1, 1);
+	ATF_REQUIRE_EQ(i386_set_ldt(256, , 1), 256);
+	set_ds(LSEL(256, SEL_UPL));
+
+	/* Register the fault handler. */
+	memset(, 0, sizeof(act));
+	act.sa_sigaction = iretq_np__np_handler;
+	act.sa_flags = SA_SIGINFO;
+	ATF_REQUIRE_EQ(sigaction(SIGBUS, , NULL), 0);
+
+	/* Set non-present on %ds, iretq should fault. */
+	desc.sd.sd_p = 0;
+	ATF_REQUIRE_EQ(i386_set_ldt(256, , 1), 256);
+
+	atf_tc_fail("test did not fault as expected");
+}
+
+/* -- */
+
 static volatile bool expect_crash;
 
 static void
-gp_handler(int signo, siginfo_t *sig, void *ctx)
+user_ldt__gp_handler(int signo, siginfo_t *sig, void *ctx)
 {
 	ucontext_t *uctx = ctx;
 	extern uint8_t fs_read_begin;
@@ -222,7 +316,7 @@ ATF_TC_BODY(user_ldt, tc)
 	}
 
 	memset(, 0, sizeof(act));
-	act.sa_sigaction = gp_handler;
+	act.sa_sigaction = user_ldt__gp_handler;
 	act.sa_flags = SA_SIGINFO;
 	ATF_REQUIRE_EQ(sigaction(SIGSEGV, , NULL), 0);
 
@@ -252,6 +346,8 @@ ATF_TP_ADD_TCS(tp)
 	init_ldt_base();
 
 	ATF_TP_ADD_TC(tp, filter_ops);
+	ATF_TP_ADD_TC(tp, iretq_gp);
+	ATF_TP_ADD_TC(tp, iretq_np);
 	ATF_TP_ADD_TC(tp, user_ldt);
 
 	return atf_no_error();



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 15:42:43 UTC 2020

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

Log Message:
make(1): make code for the :E and :R modifiers simpler


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 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/var.c
diff -u src/usr.bin/make/var.c:1.238 src/usr.bin/make/var.c:1.239
--- src/usr.bin/make/var.c:1.238	Fri Jul  3 15:24:31 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 15:42:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.238 2020/07/03 15:24:31 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.239 2020/07/03 15:42:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.238 2020/07/03 15:24:31 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.239 2020/07/03 15:42:43 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.238 2020/07/03 15:24:31 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.239 2020/07/03 15:42:43 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1203,86 +1203,34 @@ VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var
 return TRUE;
 }
 
-/*-
- *---
- * VarSuffix --
- *	Place the suffix of the given word in the given buffer.
- *
- * Input:
- *	word		Word to trim
- *	addSpace	TRUE if need to add a space before placing the
- *			suffix in the buffer
- *	buf		Buffer in which to store it
- *
- * Results:
- *	TRUE if characters were added to the buffer (a space needs to be
- *	added to the buffer before the next word).
- *
- * Side Effects:
- *	The suffix from the word is placed in the buffer.
- *
- *---
- */
+/* Add the filename suffix of the given word to the buffer. */
 static Boolean
 VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	  char *word, Boolean addSpace, Buffer *buf,
 	  void *dummy MAKE_ATTR_UNUSED)
 {
-char *dot;
+const char *dot = strrchr(word, '.');
+if (dot == NULL)
+	return FALSE;
 
-dot = strrchr(word, '.');
-if (dot != NULL) {
-	if (addSpace && vpstate->varSpace) {
-	Buf_AddByte(buf, vpstate->varSpace);
-	}
-	*dot++ = '\0';
-	Buf_AddBytes(buf, strlen(dot), dot);
-	dot[-1] = '.';
-	addSpace = TRUE;
-}
-return addSpace;
+if (addSpace && vpstate->varSpace)
+	Buf_AddByte(buf, vpstate->varSpace);
+Buf_AddBytes(buf, strlen(dot + 1), dot + 1);
+return TRUE;
 }
 
-/*-
- *---
- * VarRoot --
- *	Remove the suffix of the given word and place the result in the
- *	buffer.
- *
- * Input:
- *	word		Word to trim
- *	addSpace	TRUE if need to add a space to the buffer
- *			before placing the root in it
- *	buf		Buffer in which to store it
- *
- * Results:
- *	TRUE if characters were added to the buffer (a space needs to be
- *	added to the buffer before the next word).
- *
- * Side Effects:
- *	The trimmed word is added to the buffer.
- *
- *---
- */
+/* Add the filename basename of the given word to the buffer. */
 static Boolean
 VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	char *word, Boolean addSpace, Buffer *buf,
 	void *dummy MAKE_ATTR_UNUSED)
 {
-char *dot;
+char *dot = strrchr(word, '.');
+size_t len = dot != NULL ? dot - word : strlen(word);
 
-if (addSpace && vpstate->varSpace) {
+if (addSpace && vpstate->varSpace)
 	Buf_AddByte(buf, vpstate->varSpace);
-}
-
-dot = strrchr(word, '.');
-if (dot != NULL) {
-	*dot = '\0';
-	Buf_AddBytes(buf, strlen(word), word);
-	*dot = '.';
-} else {
-	Buf_AddBytes(buf, strlen(word), word);
-}
+Buf_AddBytes(buf, len, word);
 return TRUE;
 }
 



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

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 15:41:37 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk

Log Message:
make(1): add test for :R modifier


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/modmisc.exp \
src/usr.bin/make/unit-tests/modmisc.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.4 src/usr.bin/make/unit-tests/modmisc.exp:1.5
--- src/usr.bin/make/unit-tests/modmisc.exp:1.4	Fri Jul  3 15:33:01 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp	Fri Jul  3 15:41:37 2020
@@ -10,4 +10,5 @@ The answer is 42
 head of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b . . conf.d
 tail of 'a/b/c def archive.tar.gz conf.d/file' is 'c def archive.tar.gz file
 suffix of 'a/b/c def archive.tar.gz conf.d/file' is 'gz d/file
+root of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b/c def archive.tar conf
 exit status 0
Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.4 src/usr.bin/make/unit-tests/modmisc.mk:1.5
--- src/usr.bin/make/unit-tests/modmisc.mk:1.4	Fri Jul  3 15:33:01 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Fri Jul  3 15:41:37 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.4 2020/07/03 15:33:01 rillig Exp $
+# $Id: modmisc.mk,v 1.5 2020/07/03 15:41:37 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -42,3 +42,4 @@ mod-HTE:
 	@echo "head of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q}
 	@echo "tail of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q}
 	@echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q}
+	@echo "root of '"${PATHNAMES:Q}"' is '"${PATHNAMES:R:Q}



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

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 15:33:01 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk

Log Message:
make(1): add more tests for :H, :T and :E modifiers


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/modmisc.exp \
src/usr.bin/make/unit-tests/modmisc.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.3 src/usr.bin/make/unit-tests/modmisc.exp:1.4
--- src/usr.bin/make/unit-tests/modmisc.exp:1.3	Fri Jul  3 15:22:35 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp	Fri Jul  3 15:33:01 2020
@@ -7,6 +7,7 @@ path_/usr/xbin=/opt/xbin/
 paths=/bin /tmp / /no/such/dir /opt/xbin
 PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
 The answer is 42
-head of 'a/b/c def' is 'a/b .'
-tail of 'a/b/c def' is 'c def'
+head of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b . . conf.d
+tail of 'a/b/c def archive.tar.gz conf.d/file' is 'c def archive.tar.gz file
+suffix of 'a/b/c def archive.tar.gz conf.d/file' is 'gz d/file
 exit status 0
Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.3 src/usr.bin/make/unit-tests/modmisc.mk:1.4
--- src/usr.bin/make/unit-tests/modmisc.mk:1.3	Fri Jul  3 15:22:35 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Fri Jul  3 15:33:01 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.3 2020/07/03 15:22:35 rillig Exp $
+# $Id: modmisc.mk,v 1.4 2020/07/03 15:33:01 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -15,7 +15,7 @@ MOD_HOMES=S,/home/,/homes/,
 MOD_OPT=@d@$${exists($$d):?$$d:$${d:S,/usr,/opt,}}@
 MOD_SEP=S,:, ,g
 
-all:	modvar modvarloop modsysv modhead
+all:	modvar modvarloop modsysv mod-HTE
 
 modsysv:
 	@echo "The answer is ${libfoo.a:L:libfoo.a=42}"
@@ -37,6 +37,8 @@ modvarloop:
 	@echo "paths=${paths}"
 	@echo "PATHS=${paths:tu}"
 
-modhead:
-	@echo "head of 'a/b/c def' is '${a/b/c def:L:H}'"
-	@echo "tail of 'a/b/c def' is '${a/b/c def:L:T}'"
+PATHNAMES=	a/b/c def archive.tar.gz conf.d/file
+mod-HTE:
+	@echo "head of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q}
+	@echo "tail of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q}
+	@echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q}



CVS commit: src/sys/arch/arm/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 15:31:25 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: stubs.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/arm32/stubs.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/arm32/stubs.c
diff -u src/sys/arch/arm/arm32/stubs.c:1.26 src/sys/arch/arm/arm32/stubs.c:1.27
--- src/sys/arch/arm/arm32/stubs.c:1.26	Sat Jun 20 15:45:22 2020
+++ src/sys/arch/arm/arm32/stubs.c	Fri Jul  3 15:31:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: stubs.c,v 1.26 2020/06/20 15:45:22 skrll Exp $	*/
+/*	$NetBSD: stubs.c,v 1.27 2020/07/03 15:31:25 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: stubs.c,v 1.26 2020/06/20 15:45:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stubs.c,v 1.27 2020/07/03 15:31:25 skrll Exp $");
 
 #include 
 
@@ -273,7 +273,8 @@ dodumpsys(void)
 			error = (*bdev->d_dump)(dumpdev,
 			blkno, (void *) dumpspace, PAGE_SIZE);
 
-			if (error) goto err;
+			if (error)
+goto err;
 			blkno += btodb(PAGE_SIZE);
 			len += PAGE_SIZE;
 		}



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 15:24:31 UTC 2020

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

Log Message:
make(1): clean up code for the :H and :T modifiers


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 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/var.c
diff -u src/usr.bin/make/var.c:1.237 src/usr.bin/make/var.c:1.238
--- src/usr.bin/make/var.c:1.237	Fri Jul  3 14:59:17 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 15:24:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.237 2020/07/03 14:59:17 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.238 2020/07/03 15:24:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.237 2020/07/03 14:59:17 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.238 2020/07/03 15:24:31 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.237 2020/07/03 14:59:17 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.238 2020/07/03 15:24:31 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1169,92 +1169,37 @@ Var_Value(const char *name, GNode *ctxt,
 return p;
 }
 
-/*-
- *---
- * VarHead --
- *	Remove the tail of the given word and place the result in the given
- *	buffer.
- *
- * Input:
- *	word		Word to trim
- *	addSpace	True if need to add a space to the buffer
- *			before sticking in the head
- *	buf		Buffer in which to store it
- *
- * Results:
- *	TRUE if characters were added to the buffer (a space needs to be
- *	added to the buffer before the next word).
- *
- * Side Effects:
- *	The trimmed word is added to the buffer.
- *
- *---
- */
+/* Add the dirname of the given word to the buffer. */
 static Boolean
 VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	char *word, Boolean addSpace, Buffer *buf,
 	void *dummy MAKE_ATTR_UNUSED)
 {
-char *slash;
+const char *slash = strrchr(word, '/');
 
-slash = strrchr(word, '/');
-if (slash != NULL) {
-	if (addSpace && vpstate->varSpace) {
-	Buf_AddByte(buf, vpstate->varSpace);
-	}
+if (addSpace && vpstate->varSpace)
+	Buf_AddByte(buf, vpstate->varSpace);
+if (slash != NULL)
 	Buf_AddBytes(buf, slash - word, word);
-	return TRUE;
-} else {
-	/*
-	 * If no directory part, give . (q.v. the POSIX standard)
-	 */
-	if (addSpace && vpstate->varSpace)
-	Buf_AddByte(buf, vpstate->varSpace);
+else
 	Buf_AddByte(buf, '.');
-}
+
 return TRUE;
 }
 
-/*-
- *---
- * VarTail --
- *	Remove the head of the given word and place the result in the given
- *	buffer.
- *
- * Input:
- *	word		Word to trim
- *	addSpace	True if need to add a space to the buffer
- *			before adding the tail
- *	buf		Buffer in which to store it
- *
- * Results:
- *	TRUE if characters were added to the buffer (a space needs to be
- *	added to the buffer before the next word).
- *
- * Side Effects:
- *	The trimmed word is added to the buffer.
- *
- *---
- */
+/* Add the basename of the given word to the buffer. */
 static Boolean
 VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	char *word, Boolean addSpace, Buffer *buf,
 	void *dummy MAKE_ATTR_UNUSED)
 {
-char *slash;
+const char *slash = strrchr(word, '/');
+const char *base = slash != NULL ? slash + 1 : word;
 
-if (addSpace && vpstate->varSpace) {
+if (addSpace && vpstate->varSpace)
 	Buf_AddByte(buf, vpstate->varSpace);
-}
+Buf_AddBytes(buf, strlen(base), base);
 
-slash = strrchr(word, '/');
-if (slash != NULL) {
-	*slash++ = '\0';
-	Buf_AddBytes(buf, strlen(slash), slash);
-	slash[-1] = '/';
-} else {
-	Buf_AddBytes(buf, strlen(word), word);
-}
 return TRUE;
 }
 



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

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 15:22:35 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk

Log Message:
make(1): add test for :H and :T modifiers with several words


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/modmisc.exp \
src/usr.bin/make/unit-tests/modmisc.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.2 src/usr.bin/make/unit-tests/modmisc.exp:1.3
--- src/usr.bin/make/unit-tests/modmisc.exp:1.2	Fri Jul  3 14:59:17 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp	Fri Jul  3 15:22:35 2020
@@ -7,8 +7,6 @@ path_/usr/xbin=/opt/xbin/
 paths=/bin /tmp / /no/such/dir /opt/xbin
 PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
 The answer is 42
-head of a/b/c is a/b
-tail of a/b/c is c
-head of abc is .
-tail of abc is abc
+head of 'a/b/c def' is 'a/b .'
+tail of 'a/b/c def' is 'c def'
 exit status 0
Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.2 src/usr.bin/make/unit-tests/modmisc.mk:1.3
--- src/usr.bin/make/unit-tests/modmisc.mk:1.2	Fri Jul  3 14:59:17 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Fri Jul  3 15:22:35 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.2 2020/07/03 14:59:17 rillig Exp $
+# $Id: modmisc.mk,v 1.3 2020/07/03 15:22:35 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -38,7 +38,5 @@ modvarloop:
 	@echo "PATHS=${paths:tu}"
 
 modhead:
-	@echo "head of a/b/c is ${a/b/c:L:H}"
-	@echo "tail of a/b/c is ${a/b/c:L:T}"
-	@echo "head of abc is ${abc:L:H}"
-	@echo "tail of abc is ${abc:L:T}"
+	@echo "head of 'a/b/c def' is '${a/b/c def:L:H}'"
+	@echo "tail of 'a/b/c def' is '${a/b/c def:L:T}'"



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 14:59:17 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk

Log Message:
make(1): add missing test for the :H and :T modifiers


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/usr.bin/make/var.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/modmisc.exp \
src/usr.bin/make/unit-tests/modmisc.mk

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.236 src/usr.bin/make/var.c:1.237
--- src/usr.bin/make/var.c:1.236	Fri Jul  3 14:14:04 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 14:59:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.236 2020/07/03 14:14:04 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.237 2020/07/03 14:59:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.236 2020/07/03 14:14:04 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.237 2020/07/03 14:59:17 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.236 2020/07/03 14:14:04 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.237 2020/07/03 14:59:17 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1202,9 +1202,7 @@ VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var
 	if (addSpace && vpstate->varSpace) {
 	Buf_AddByte(buf, vpstate->varSpace);
 	}
-	*slash = '\0';
-	Buf_AddBytes(buf, strlen(word), word);
-	*slash = '/';
+	Buf_AddBytes(buf, slash - word, word);
 	return TRUE;
 } else {
 	/*

Index: src/usr.bin/make/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.1 src/usr.bin/make/unit-tests/modmisc.exp:1.2
--- src/usr.bin/make/unit-tests/modmisc.exp:1.1	Thu Aug 21 13:44:51 2014
+++ src/usr.bin/make/unit-tests/modmisc.exp	Fri Jul  3 14:59:17 2020
@@ -7,4 +7,8 @@ path_/usr/xbin=/opt/xbin/
 paths=/bin /tmp / /no/such/dir /opt/xbin
 PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
 The answer is 42
+head of a/b/c is a/b
+tail of a/b/c is c
+head of abc is .
+tail of abc is abc
 exit status 0
Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.1 src/usr.bin/make/unit-tests/modmisc.mk:1.2
--- src/usr.bin/make/unit-tests/modmisc.mk:1.1	Thu Aug 21 13:44:51 2014
+++ src/usr.bin/make/unit-tests/modmisc.mk	Fri Jul  3 14:59:17 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.1 2014/08/21 13:44:51 apb Exp $
+# $Id: modmisc.mk,v 1.2 2020/07/03 14:59:17 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -15,7 +15,7 @@ MOD_HOMES=S,/home/,/homes/,
 MOD_OPT=@d@$${exists($$d):?$$d:$${d:S,/usr,/opt,}}@
 MOD_SEP=S,:, ,g
 
-all:	modvar modvarloop modsysv
+all:	modvar modvarloop modsysv modhead
 
 modsysv:
 	@echo "The answer is ${libfoo.a:L:libfoo.a=42}"
@@ -36,3 +36,9 @@ modvarloop:
 	@echo "path_/usr/xbin=${path_/usr/xbin}"
 	@echo "paths=${paths}"
 	@echo "PATHS=${paths:tu}"
+
+modhead:
+	@echo "head of a/b/c is ${a/b/c:L:H}"
+	@echo "tail of a/b/c is ${a/b/c:L:T}"
+	@echo "head of abc is ${abc:L:H}"
+	@echo "tail of abc is ${abc:L:T}"



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 14:14:04 UTC 2020

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

Log Message:
make(1): refactor ApplyModifiers

Previously, ApplyModifiers was 1200 lines long and pretty complicated.
Now each of the complicated modifiers has its own function, which reduces
the indentation and makes it possible to use early returns.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 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/var.c
diff -u src/usr.bin/make/var.c:1.235 src/usr.bin/make/var.c:1.236
--- src/usr.bin/make/var.c:1.235	Fri Jul  3 08:13:23 2020
+++ src/usr.bin/make/var.c	Fri Jul  3 14:14:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.235 2020/07/03 08:13:23 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.236 2020/07/03 14:14:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.235 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.236 2020/07/03 14:14:04 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.235 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.236 2020/07/03 14:14:04 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2467,6 +2467,1023 @@ VarStrftime(const char *fmt, int zulu, t
 return bmake_strdup(buf);
 }
 
+typedef struct {
+/* const parameters */
+int startc;
+int endc;
+Var * v;
+GNode *ctxt;
+int flags;
+int* lengthPtr;
+void ** freePtr;
+
+/* read-write */
+char *nstr;
+const char *tstr;
+const char *start;
+const char *cp;		/* Secondary pointer into str (place marker
+ * for tstr) */
+char termc;			/* Character which terminated scan */
+int cnt;			/* Used to count brace pairs when variable in
+ * in parens or braces */
+char delim;
+int modifier;		/* that we are processing */
+Var_Parse_State parsestate; /* Flags passed to helper functions */
+
+/* result */
+char *newStr;		/* New value to return */
+
+} ApplyModifiersState;
+
+/* we now have some modifiers with long names */
+#define STRMOD_MATCH(s, want, n) \
+(strncmp(s, want, n) == 0 && (s[n] == st->endc || s[n] == ':'))
+#define STRMOD_MATCHX(s, want, n) \
+(strncmp(s, want, n) == 0 && (s[n] == st->endc || s[n] == ':' || s[n] == '='))
+#define CHARMOD_MATCH(c) (c == st->endc || c == ':')
+
+/* :@var@...${var}...@ */
+static Boolean
+ApplyModifier_At(ApplyModifiersState *st) {
+VarLoop_t loop;
+VarPattern_Flags vflags = VAR_NOSUBST;
+
+st->cp = ++(st->tstr);
+st->delim = '@';
+loop.tvar = VarGetPattern(
+	st->ctxt, >parsestate, st->flags, >cp, st->delim,
+	, , NULL);
+if (loop.tvar == NULL)
+	return FALSE;
+
+loop.str = VarGetPattern(
+	st->ctxt, >parsestate, st->flags, >cp, st->delim,
+	, , NULL);
+if (loop.str == NULL)
+	return FALSE;
+
+st->termc = *st->cp;
+st->delim = '\0';
+
+loop.flags = st->flags & (VARF_UNDEFERR | VARF_WANTRES);
+loop.ctxt = st->ctxt;
+st->newStr = VarModify(st->ctxt, >parsestate, st->nstr, VarLoopExpand, );
+Var_Delete(loop.tvar, st->ctxt);
+free(loop.tvar);
+free(loop.str);
+return TRUE;
+}
+
+/* :Ddefined or :Uundefined */
+static void
+ApplyModifier_Defined(ApplyModifiersState *st)
+{
+Buffer  buf;	/* Buffer for patterns */
+int nflags;
+
+if (st->flags & VARF_WANTRES) {
+	int wantres;
+	if (*st->tstr == 'U')
+	wantres = ((st->v->flags & VAR_JUNK) != 0);
+	else
+	wantres = ((st->v->flags & VAR_JUNK) == 0);
+	nflags = st->flags & ~VARF_WANTRES;
+	if (wantres)
+	nflags |= VARF_WANTRES;
+} else
+	nflags = st->flags;
+
+/*
+ * Pass through tstr looking for 1) escaped delimiters,
+ * '$'s and backslashes (place the escaped character in
+ * uninterpreted) and 2) unescaped $'s that aren't before
+ * the delimiter (expand the variable substitution).
+ * The result is left in the Buffer buf.
+ */
+Buf_Init(, 0);
+for (st->cp = st->tstr + 1;
+	 *st->cp != st->endc && *st->cp != ':' && *st->cp != '\0';
+	 st->cp++) {
+	if (*st->cp == '\\' &&
+	(st->cp[1] == ':' || st->cp[1] == '$' || st->cp[1] == st->endc ||
+	 st->cp[1] == '\\')) {
+	Buf_AddByte(, st->cp[1]);
+	st->cp++;
+	} else if (*st->cp == '$') {
+	/*
+	 * If unescaped dollar sign, assume it's a
+	 * variable substitution and recurse.
+	 */
+	char*cp2;
+	int	len;
+	void*freeIt;
+
+	cp2 = Var_Parse(st->cp, st->ctxt, nflags, , );
+	Buf_AddBytes(, strlen(cp2), cp2);
+	free(freeIt);
+	st->cp += len - 1;
+	} else {
+	Buf_AddByte(, *st->cp);
+	}
+}
+
+st->termc = *st->cp;
+
+if ((st->v->flags & 

CVS commit: src/sys/compat/sys

2020-07-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul  3 14:08:53 UTC 2020

Modified Files:
src/sys/compat/sys: statvfs.h

Log Message:
don't overallocate (requested by maxv@)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/statvfs.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/compat/sys/statvfs.h
diff -u src/sys/compat/sys/statvfs.h:1.1 src/sys/compat/sys/statvfs.h:1.2
--- src/sys/compat/sys/statvfs.h:1.1	Sun Sep 22 19:18:53 2019
+++ src/sys/compat/sys/statvfs.h	Fri Jul  3 10:08:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: statvfs.h,v 1.1 2019/09/22 23:18:53 christos Exp $	 */
+/*	$NetBSD: statvfs.h,v 1.2 2020/07/03 14:08:53 christos Exp $	 */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -112,12 +112,12 @@ statvfs_to_statvfs90(const struct statvf
 static __inline int
 statvfs_to_statvfs90_copy(const void *vs, void *vs90, size_t l)
 {
-	struct statvfs90 *s90 = STATVFSBUF_GET();
+	struct statvfs90 *s90 = kmem_zalloc(sizeof(*s90), KM_SLEEP);
 	int error;
 
 	statvfs_to_statvfs90(vs, s90);
 	error = copyout(s90, vs90, l);
-	STATVFSBUF_PUT(s90);
+	kmem_free(s90, sizeof(*s90));
 
 	return error;
 }
@@ -158,4 +158,4 @@ int	__getmntinfo90(struct statvfs **, in
 
 __END_DECLS
 
-#endif /* !_SYS_STATVFS_H_ */
+#endif /* !_COMPAT_SYS_STATVFS_H_ */



CVS commit: src/distrib/sets/lists/base

2020-07-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul  3 12:53:27 UTC 2020

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
unbreak build, put /var/db/dhcpcd into the set lists


To generate a diff of this commit:
cvs rdiff -u -r1.1253 -r1.1254 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1253 src/distrib/sets/lists/base/mi:1.1254
--- src/distrib/sets/lists/base/mi:1.1253	Sun Jun 28 14:26:18 2020
+++ src/distrib/sets/lists/base/mi	Fri Jul  3 12:53:27 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1253 2020/06/28 14:26:18 fcambus Exp $
+# $NetBSD: mi,v 1.1254 2020/07/03 12:53:27 roy Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -6117,6 +6117,7 @@
 ./var/cron/tabs	base-cron-root
 ./var/db	base-sys-root
 ./var/db/ns	base-sys-root
+./var/db/dhcpcd	base-dhcpcd-root
 ./var/db/obsoletebase-sys-root
 ./var/db/obsolete/basebase-sys-root
 ./var/db/postfixbase-postfix-root



CVS commit: src/sys/dev/pci

2020-07-03 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Jul  3 12:39:54 UTC 2020

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

Log Message:
Fix an argument passes to auixp_intr().
This is rest of rev 1.39 (split device_t/softc) in 2012.
Problem reported and tested by Riccardo Mottola.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/auixp.c

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

Modified files:

Index: src/sys/dev/pci/auixp.c
diff -u src/sys/dev/pci/auixp.c:1.49 src/sys/dev/pci/auixp.c:1.50
--- src/sys/dev/pci/auixp.c:1.49	Sat Feb 29 06:34:30 2020
+++ src/sys/dev/pci/auixp.c	Fri Jul  3 12:39:54 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: auixp.c,v 1.49 2020/02/29 06:34:30 isaki Exp $ */
+/* $NetBSD: auixp.c,v 1.50 2020/07/03 12:39:54 isaki Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Reinoud Zandijk 
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.49 2020/02/29 06:34:30 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.50 2020/07/03 12:39:54 isaki Exp $");
 
 #include 
 #include 
@@ -1116,7 +1116,7 @@ auixp_attach(device_t parent, device_t s
 
 	/* establish interrupt routine hookup at IPL_AUDIO level */
 	sc->sc_ih = pci_intr_establish_xname(pc, ih, IPL_AUDIO, auixp_intr,
-	self, device_xname(self));
+	sc, device_xname(self));
 	if (sc->sc_ih == NULL) {
 		aprint_error_dev(sc->sc_dev, "can't establish interrupt");
 		if (intrstr != NULL)



CVS commit: src/etc/mtree

2020-07-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul  3 11:03:42 UTC 2020

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
Add /var/db/dhcpcd back


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.220 src/etc/mtree/NetBSD.dist.base:1.221
--- src/etc/mtree/NetBSD.dist.base:1.220	Mon Jun 22 03:16:29 2020
+++ src/etc/mtree/NetBSD.dist.base	Fri Jul  3 11:03:42 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.220 2020/06/22 03:16:29 rin Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.221 2020/07/03 11:03:42 roy Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1321,6 +1321,7 @@
 ./var/cron
 ./var/cron/tabs			mode=0700
 ./var/db
+./var/db/dhcpcd			mode=0750
 ./var/db/ns
 ./var/db/obsolete
 ./var/db/postfix		uname=postfix gname=postfix mode=0755



CVS commit: src/doc

2020-07-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul  3 10:47:29 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-9.1.4


To generate a diff of this commit:
cvs rdiff -u -r1.1734 -r1.1735 src/doc/3RDPARTY
cvs rdiff -u -r1.2707 -r1.2708 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.1734 src/doc/3RDPARTY:1.1735
--- src/doc/3RDPARTY:1.1734	Thu Jul  2 14:02:04 2020
+++ src/doc/3RDPARTY	Fri Jul  3 10:47:29 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1734 2020/07/02 14:02:04 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1735 2020/07/03 10:47:29 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -353,12 +353,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	9.1.3
-Current Vers:	9.1.3
+Version:	9.1.4
+Current Vers:	9.1.4
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2020-07-02
+Date:		2020-07-03
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2707 src/doc/CHANGES:1.2708
--- src/doc/CHANGES:1.2707	Thu Jul  2 14:02:04 2020
+++ src/doc/CHANGES	Fri Jul  3 10:47:29 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2707 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2708 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -240,4 +240,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		kernel. [riastradh 20200629]
 	cgd(4): Add support for Adiantum cipher, providing much better software
 		performance than AES-CBC or AES-XTS. [riastradh 20200629]
-	dhcpcd: Import version 9.1.3 [roy 20200702]
+	dhcpcd: Import version 9.1.4 [roy 20200703]



CVS commit: src/external/bsd/dhcpcd/dist/src

2020-07-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul  3 10:46:45 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcpcd.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/external/bsd/dhcpcd/dist/src/dhcpcd.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/bsd/dhcpcd/dist/src/dhcpcd.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.40 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.41
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.40	Thu Jul  2 13:59:19 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c	Fri Jul  3 10:46:45 2020
@@ -2186,6 +2186,8 @@ printpidfile:
 
 	if (!(ctx.options & DHCPCD_TEST)) {
 		/* Ensure we have the needed directories */
+		if (mkdir(DBDIR, 0750) == -1 && errno != EEXIST)
+			logerr("%s: mkdir `%s'", __func__, DBDIR);
 		if (mkdir(RUNDIR, 0755) == -1 && errno != EEXIST)
 			logerr("%s: mkdir `%s'", __func__, RUNDIR);
 		if ((pid = pidfile_lock(ctx.pidfile)) != 0) {
@@ -2284,13 +2286,6 @@ printpidfile:
 		}
 	}
 
-	/* If we're not running in privsep, we need to create the DB
-	 * directory here. */
-	if (!(ctx.options & DHCPCD_PRIVSEP)) {
-		if (mkdir(DBDIR, 0755) == -1 && errno != EEXIST)
-			logerr("%s: mkdir `%s'", __func__, DBDIR);
-	}
-
 #ifdef PRIVSEP
 	if (IN_PRIVSEP() && ps_start() == -1) {
 		logerr("ps_start");



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

2020-07-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul  3 10:45:44 UTC 2020

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

Log Message:
Update to dhcpcd-9.1.4 with the following changes:

 * Fix SMALL builds
 * Ensure DBDIR exists at startup

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-9_1_4

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
C src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
U src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv6.c
U src/external/bsd/dhcpcd/dist/src/ipv6nd.c
U src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/privsep.c
U src/external/bsd/dhcpcd/dist/src/privsep-root.c
U src/external/bsd/dhcpcd/dist/src/privsep-control.c
U src/external/bsd/dhcpcd/dist/src/privsep-inet.c
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.c
U src/external/bsd/dhcpcd/dist/src/privsep-bsd.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/privsep.h
U src/external/bsd/dhcpcd/dist/src/privsep-root.h
U src/external/bsd/dhcpcd/dist/src/privsep-control.h
U src/external/bsd/dhcpcd/dist/src/privsep-inet.h
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname.in
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

2 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS commit: src/sys/arch/arm

2020-07-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jul  3 10:19:18 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: db_machdep.c
src/sys/arch/arm/include/arm32: db_machdep.h

Log Message:
Move db_reset_cmd prototype to db_machdep.h (forgot to commit this file)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/arm32/db_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/include/arm32/db_machdep.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/arm/arm32/db_machdep.c
diff -u src/sys/arch/arm/arm32/db_machdep.c:1.33 src/sys/arch/arm/arm32/db_machdep.c:1.34
--- src/sys/arch/arm/arm32/db_machdep.c:1.33	Fri Jul  3 06:13:00 2020
+++ src/sys/arch/arm/arm32/db_machdep.c	Fri Jul  3 10:19:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.c,v 1.33 2020/07/03 06:13:00 skrll Exp $	*/
+/*	$NetBSD: db_machdep.c,v 1.34 2020/07/03 10:19:18 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.33 2020/07/03 06:13:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.34 2020/07/03 10:19:18 jmcneill Exp $");
 
 #include 
 
@@ -61,7 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: db_machdep.c
 #ifdef _KERNEL
 static long nil;
 
-void db_reset_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_md_cpuinfo_cmd(db_expr_t, bool, db_expr_t, const char *);
 
 int db_access_und_sp(const struct db_variable *, db_expr_t *, int);

Index: src/sys/arch/arm/include/arm32/db_machdep.h
diff -u src/sys/arch/arm/include/arm32/db_machdep.h:1.9 src/sys/arch/arm/include/arm32/db_machdep.h:1.10
--- src/sys/arch/arm/include/arm32/db_machdep.h:1.9	Fri Mar 28 21:54:12 2014
+++ src/sys/arch/arm/include/arm32/db_machdep.h	Fri Jul  3 10:19:18 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.9 2014/03/28 21:54:12 matt Exp $ */
+/* $NetBSD: db_machdep.h,v 1.10 2020/07/03 10:19:18 jmcneill Exp $ */
 
 #ifndef _ARM32_DB_MACHDEP_H_
 #define _ARM32_DB_MACHDEP_H_
@@ -7,6 +7,7 @@
 
 void db_show_frame_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_show_fault_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_reset_cmd(db_expr_t, bool, db_expr_t, const char *);
 #ifdef _KERNEL
 void db_show_tlb_cmd(db_expr_t, bool, db_expr_t, const char *);
 #endif



CVS commit: src/usr.bin/make/lst.lib

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 08:37:57 UTC 2020

Modified Files:
src/usr.bin/make/lst.lib: lstAppend.c lstAtEnd.c lstAtFront.c
lstClose.c lstConcat.c lstDatum.c lstDeQueue.c lstDupl.c
lstEnQueue.c lstFind.c lstFindFrom.c lstFirst.c lstForEach.c
lstForEachFrom.c lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c
lstLast.c lstNext.c lstOpen.c lstPrev.c lstRemove.c lstReplace.c
lstSucc.c

Log Message:
make(1): remove redundant parentheses around return value


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/lst.lib/lstAppend.c \
src/usr.bin/make/lst.lib/lstDeQueue.c \
src/usr.bin/make/lst.lib/lstInsert.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/lst.lib/lstAtEnd.c \
src/usr.bin/make/lst.lib/lstAtFront.c src/usr.bin/make/lst.lib/lstDatum.c \
src/usr.bin/make/lst.lib/lstEnQueue.c \
src/usr.bin/make/lst.lib/lstForEach.c \
src/usr.bin/make/lst.lib/lstIsAtEnd.c \
src/usr.bin/make/lst.lib/lstReplace.c src/usr.bin/make/lst.lib/lstSucc.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/lst.lib/lstClose.c \
src/usr.bin/make/lst.lib/lstIsEmpty.c
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/lst.lib/lstConcat.c \
src/usr.bin/make/lst.lib/lstDupl.c src/usr.bin/make/lst.lib/lstRemove.c
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/lst.lib/lstFind.c \
src/usr.bin/make/lst.lib/lstFindFrom.c
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/lst.lib/lstFirst.c \
src/usr.bin/make/lst.lib/lstInit.c src/usr.bin/make/lst.lib/lstLast.c \
src/usr.bin/make/lst.lib/lstNext.c src/usr.bin/make/lst.lib/lstOpen.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/lst.lib/lstForEachFrom.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/lst.lib/lstPrev.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/lst.lib/lstAppend.c
diff -u src/usr.bin/make/lst.lib/lstAppend.c:1.14 src/usr.bin/make/lst.lib/lstAppend.c:1.15
--- src/usr.bin/make/lst.lib/lstAppend.c:1.14	Fri Jan 23 21:26:30 2009
+++ src/usr.bin/make/lst.lib/lstAppend.c	Fri Jul  3 08:37:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lstAppend.c,v 1.14 2009/01/23 21:26:30 dsl Exp $	*/
+/*	$NetBSD: lstAppend.c,v 1.15 2020/07/03 08:37:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAppend.c,v 1.14 2009/01/23 21:26:30 dsl Exp $";
+static char rcsid[] = "$NetBSD: lstAppend.c,v 1.15 2020/07/03 08:37:56 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstAppend.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstAppend.c,v 1.14 2009/01/23 21:26:30 dsl Exp $");
+__RCSID("$NetBSD: lstAppend.c,v 1.15 2020/07/03 08:37:56 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -85,7 +85,7 @@ Lst_InsertAfter(Lst l, LstNode ln, void 
 }
 
 if (!LstValid (l) || LstIsEmpty (l)  || ! LstNodeValid (ln, l)) {
-	return (FAILURE);
+	return FAILURE;
 }
 ok:
 
@@ -117,6 +117,5 @@ Lst_InsertAfter(Lst l, LstNode ln, void 
 	}
 }
 
-return (SUCCESS);
+return SUCCESS;
 }
-
Index: src/usr.bin/make/lst.lib/lstDeQueue.c
diff -u src/usr.bin/make/lst.lib/lstDeQueue.c:1.14 src/usr.bin/make/lst.lib/lstDeQueue.c:1.15
--- src/usr.bin/make/lst.lib/lstDeQueue.c:1.14	Fri Jan 23 21:26:30 2009
+++ src/usr.bin/make/lst.lib/lstDeQueue.c	Fri Jul  3 08:37:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lstDeQueue.c,v 1.14 2009/01/23 21:26:30 dsl Exp $	*/
+/*	$NetBSD: lstDeQueue.c,v 1.15 2020/07/03 08:37:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.14 2009/01/23 21:26:30 dsl Exp $";
+static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.15 2020/07/03 08:37:56 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstDeQueue.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstDeQueue.c,v 1.14 2009/01/23 21:26:30 dsl Exp $");
+__RCSID("$NetBSD: lstDeQueue.c,v 1.15 2020/07/03 08:37:56 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -81,7 +81,6 @@ Lst_DeQueue(Lst l)
 if (Lst_Remove(l, tln) == FAILURE) {
 	return NULL;
 } else {
-	return (rd);
+	return rd;
 }
 }
-
Index: src/usr.bin/make/lst.lib/lstInsert.c
diff -u src/usr.bin/make/lst.lib/lstInsert.c:1.14 src/usr.bin/make/lst.lib/lstInsert.c:1.15
--- src/usr.bin/make/lst.lib/lstInsert.c:1.14	Fri Jan 23 21:26:30 2009
+++ src/usr.bin/make/lst.lib/lstInsert.c	Fri Jul  3 08:37:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lstInsert.c,v 1.14 2009/01/23 21:26:30 dsl Exp $	*/
+/*	$NetBSD: lstInsert.c,v 1.15 2020/07/03 08:37:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstInsert.c,v 1.14 2009/01/23 21:26:30 dsl Exp $";
+static char 

CVS commit: src/sys/kern

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 08:19:20 UTC 2020

Modified Files:
src/sys/kern: subr_asan.c

Log Message:
Make this compile/work on 32-bit archs.  OK'ed my maxv

I thought about uintptr_t, but didn't change from Elf_Addr


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/subr_asan.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/kern/subr_asan.c
diff -u src/sys/kern/subr_asan.c:1.22 src/sys/kern/subr_asan.c:1.23
--- src/sys/kern/subr_asan.c:1.22	Tue Jun 30 16:20:02 2020
+++ src/sys/kern/subr_asan.c	Fri Jul  3 08:19:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_asan.c,v 1.22 2020/06/30 16:20:02 maxv Exp $	*/
+/*	$NetBSD: subr_asan.c,v 1.23 2020/07/03 08:19:20 skrll Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.22 2020/06/30 16:20:02 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.23 2020/07/03 08:19:20 skrll Exp $");
 
 #include 
 #include 
@@ -122,9 +122,9 @@ kasan_shadow_map(void *addr, size_t size
 static void
 kasan_ctors(void)
 {
-	extern uint64_t __CTOR_LIST__, __CTOR_END__;
+	extern Elf_Addr __CTOR_LIST__, __CTOR_END__;
 	size_t nentries, i;
-	uint64_t *ptr;
+	Elf_Addr *ptr;
 
 	nentries = ((size_t)&__CTOR_END__ - (size_t)&__CTOR_LIST__) /
 	sizeof(uintptr_t);



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 08:13:23 UTC 2020

Modified Files:
src/usr.bin/make: compat.c cond.c dir.c for.c job.c job.h main.c make.c
meta.c meta.h parse.c trace.c util.c var.c

Log Message:
make(1): remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/usr.bin/make/compat.c
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/cond.c
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/make/dir.c
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/make/for.c
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/make/job.c
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/make/job.h
cvs rdiff -u -r1.278 -r1.279 src/usr.bin/make/main.c
cvs rdiff -u -r1.98 -r1.99 src/usr.bin/make/make.c
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/make/meta.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/meta.h
cvs rdiff -u -r1.235 -r1.236 src/usr.bin/make/parse.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/trace.c
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/make/util.c
cvs rdiff -u -r1.234 -r1.235 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.112 src/usr.bin/make/compat.c:1.113
--- src/usr.bin/make/compat.c:1.112	Fri Jul  3 08:02:55 2020
+++ src/usr.bin/make/compat.c	Fri Jul  3 08:13:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.112 2020/07/03 08:02:55 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.112 2020/07/03 08:02:55 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.112 2020/07/03 08:02:55 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -233,7 +233,7 @@ CompatRunCommand(void *cmdp, void *gnp)
 silent = gn->type & OP_SILENT;
 errCheck = !(gn->type & OP_IGNORE);
 doIt = FALSE;
-
+
 cmdNode = Lst_Member(gn->commands, cmd);
 cmdStart = Var_Subst(NULL, cmd, gn, VARF_WANTRES);
 
@@ -304,7 +304,7 @@ CompatRunCommand(void *cmdp, void *gnp)
  * go to the shell. Therefore treat '=' and ':' like shell
  * meta characters as documented in make(1).
  */
-
+
 useShell = needshell(cmd, FALSE);
 #endif
 
@@ -374,7 +374,7 @@ again:
 	meta_compat_start();
 }
 #endif
-
+
 /*
  * Fork and execute the single command. If the fork fails, we abort.
  */
@@ -496,7 +496,7 @@ again:
 	bmake_signal(compatSigno, SIG_DFL);
 	kill(myPid, compatSigno);
 }
-
+
 return status;
 }
 

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.77 src/usr.bin/make/cond.c:1.78
--- src/usr.bin/make/cond.c:1.77	Fri Jul  3 08:02:55 2020
+++ src/usr.bin/make/cond.c	Fri Jul  3 08:13:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.77 2020/07/03 08:02:55 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.77 2020/07/03 08:02:55 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.77 2020/07/03 08:02:55 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.78 2020/07/03 08:13:23 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -186,7 +186,7 @@ static unsigned int	cond_min_depth = 0; 
  * Indicate when we should be strict about lhs of comparisons.
  * TRUE when Cond_EvalExpression is called from Cond_Eval (.if etc)
  * FALSE when Cond_EvalExpression is called from var.c:ApplyModifiers
- * since lhs is already expanded and we cannot tell if 
+ * since lhs is already expanded and we cannot tell if
  * it was a variable reference or not.
  */
 static Boolean lhsStrict;
@@ -412,7 +412,7 @@ CondDoExists(int argLen MAKE_ATTR_UNUSED
 if (DEBUG(COND)) {
 	fprintf(debug_file, "exists(%s) result is \"%s\"\n",
 	   arg, path ? path : "");
-}
+}
 if (path != NULL) {
 	result = TRUE;
 	free(path);
@@ -666,7 +666,7 @@ compare_expression(Boolean doEval)
 rhs = NULL;
 lhsFree = rhsFree = FALSE;
 lhsQuoted = rhsQuoted = FALSE;
-
+
 /*
  * Parse the variable spec and skip over it, saving its
  * value in lhs.
@@ -709,7 +709,7 @@ compare_expression(Boolean doEval)
 		goto done;
 	}
 	/* For .ifxxx  compare against zero */
-	if (CondCvtArg(lhs, )) { 
+	if (CondCvtArg(lhs, 

CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 08:02:56 UTC 2020

Modified Files:
src/usr.bin/make: arch.c buf.c compat.c cond.c dir.c hash.c job.c
main.c make.c make_malloc.c meta.c parse.c suff.c targ.c util.c
var.c

Log Message:
make(1): remove redundant parentheses around return values


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/make/arch.c
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/make/buf.c
cvs rdiff -u -r1.111 -r1.112 src/usr.bin/make/compat.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/cond.c
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/make/dir.c
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/make/hash.c
cvs rdiff -u -r1.199 -r1.200 src/usr.bin/make/job.c
cvs rdiff -u -r1.277 -r1.278 src/usr.bin/make/main.c
cvs rdiff -u -r1.97 -r1.98 src/usr.bin/make/make.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/make_malloc.c
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/make/meta.c
cvs rdiff -u -r1.234 -r1.235 src/usr.bin/make/parse.c
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/make/suff.c
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/make/targ.c
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/make/util.c
cvs rdiff -u -r1.233 -r1.234 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/arch.c
diff -u src/usr.bin/make/arch.c:1.72 src/usr.bin/make/arch.c:1.73
--- src/usr.bin/make/arch.c:1.72	Thu Jul  2 15:47:38 2020
+++ src/usr.bin/make/arch.c	Fri Jul  3 08:02:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.72 2020/07/02 15:47:38 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.72 2020/07/02 15:47:38 rillig Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.72 2020/07/02 15:47:38 rillig Exp $");
+__RCSID("$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -264,7 +264,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 	free(freeIt);
 
 	if (result == var_Error) {
-		return(FAILURE);
+		return FAILURE;
 	} else {
 		subLibName = TRUE;
 	}
@@ -306,7 +306,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 		free(freeIt);
 
 		if (result == var_Error) {
-		return(FAILURE);
+		return FAILURE;
 		} else {
 		doSubst = TRUE;
 		}
@@ -324,7 +324,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 	 */
 	if (*cp == '\0') {
 	printf("No closing parenthesis in archive specification\n");
-	return (FAILURE);
+	return FAILURE;
 	}
 
 	/*
@@ -378,7 +378,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 
 		if (gn == NULL) {
 		free(buf);
-		return(FAILURE);
+		return FAILURE;
 		} else {
 		gn->type |= OP_ARCHV;
 		(void)Lst_AtEnd(nodeLst, gn);
@@ -389,7 +389,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 		 * ourselves.
 		 */
 		free(buf);
-		return(FAILURE);
+		return FAILURE;
 	}
 	/*
 	 * Free buffer and continue with our work.
@@ -413,7 +413,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 		gn = Targ_FindNode(nameBuf, TARG_CREATE);
 		if (gn == NULL) {
 		free(nameBuf);
-		return (FAILURE);
+		return FAILURE;
 		} else {
 		/*
 		 * We've found the node, but have to make sure the rest of
@@ -435,7 +435,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 	gn = Targ_FindNode(nameBuf, TARG_CREATE);
 	free(nameBuf);
 	if (gn == NULL) {
-		return (FAILURE);
+		return FAILURE;
 	} else {
 		/*
 		 * We've found the node, but have to make sure the rest of the
@@ -472,7 +472,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 } while (*cp != '\0' && isspace ((unsigned char)*cp));
 
 *linePtr = cp;
-return (SUCCESS);
+return SUCCESS;
 }
 
 /*-
@@ -496,7 +496,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 static int
 ArchFindArchive(const void *ar, const void *archName)
 {
-return (strcmp(archName, ((const Arch *)ar)->name));
+return strcmp(archName, ((const Arch *)ar)->name);
 }
 
 /*-
@@ -555,7 +555,7 @@ ArchStatMember(char *archive, char *memb
 	he = Hash_FindEntry(>members, member);
 
 	if (he != NULL) {
-	return ((struct ar_hdr *)Hash_GetValue(he));
+	return (struct ar_hdr *)Hash_GetValue(he);
 	} else {
 	/* Try truncated name */
 	char copy[AR_MAX_NAME_LEN+1];
@@ -567,7 +567,7 @@ ArchStatMember(char *archive, char *memb
 		copy[AR_MAX_NAME_LEN] = '\0';
 	}
 	if ((he = Hash_FindEntry(>members, copy)) != NULL)
-		return ((struct ar_hdr *)Hash_GetValue(he));
+		return (struct ar_hdr *)Hash_GetValue(he);
 	return NULL;
 	}
 }
@@ -588,7 +588,7 @@ ArchStatMember(char *archive, char *memb
 	return NULL;
 	} else {
 	fclose(arch);
-	

CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 07:40:13 UTC 2020

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

Log Message:
make(1): refactor Str_Match

- use shorter variable names to avoid line breaks
- eliminate c2 variable
- change return type to Boolean


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/make/str.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/nonints.h
diff -u src/usr.bin/make/nonints.h:1.77 src/usr.bin/make/nonints.h:1.78
--- src/usr.bin/make/nonints.h:1.77	Thu Jul  2 15:47:38 2020
+++ src/usr.bin/make/nonints.h	Fri Jul  3 07:40:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.77 2020/07/02 15:47:38 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.78 2020/07/03 07:40:13 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -137,7 +137,7 @@ Lst Parse_MainName(void);
 char *str_concat(const char *, const char *, int);
 char **brk_string(const char *, int *, Boolean, char **);
 char *Str_FindSubstring(const char *, const char *);
-int Str_Match(const char *, const char *);
+Boolean Str_Match(const char *, const char *);
 char *Str_SYSVMatch(const char *, const char *, size_t *, Boolean *);
 void Str_SYSVSubst(Buffer *, char *, char *, size_t, Boolean);
 

Index: src/usr.bin/make/str.c
diff -u src/usr.bin/make/str.c:1.50 src/usr.bin/make/str.c:1.51
--- src/usr.bin/make/str.c:1.50	Fri Jul  3 06:30:02 2020
+++ src/usr.bin/make/str.c	Fri Jul  3 07:40:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.50 2020/07/03 06:30:02 rillig Exp $	*/
+/*	$NetBSD: str.c,v 1.51 2020/07/03 07:40:13 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.50 2020/07/03 06:30:02 rillig Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.51 2020/07/03 07:40:13 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.50 2020/07/03 06:30:02 rillig Exp $");
+__RCSID("$NetBSD: str.c,v 1.51 2020/07/03 07:40:13 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -320,122 +320,110 @@ Str_FindSubstring(const char *string, co
 }
 
 /*
- * Str_Match -- Test if a string matches a pattern.
+ * Str_Match -- Test if a string matches a pattern like "*.[ch]".
  *
  * XXX this function does not detect or report malformed patterns.
  *
  * Results:
  *	Non-zero is returned if string matches the pattern, 0 otherwise. The
  *	matching operation permits the following special characters in the
- *	pattern: *?\[] (as in glob(3)).
+ *	pattern: *?\[] (as in fnmatch(3)).
  *
  * Side effects: None.
  */
-int
-Str_Match(const char *string, const char *pattern)
+Boolean
+Str_Match(const char *str, const char *pat)
 {
-	char c2;
-
 	for (;;) {
 		/*
 		 * See if we're at the end of both the pattern and the
 		 * string. If, we succeeded.  If we're at the end of the
 		 * pattern but not at the end of the string, we failed.
 		 */
-		if (*pattern == 0)
-			return *string == 0;
-		if (*string == 0 && *pattern != '*')
-			return 0;
+		if (*pat == 0)
+			return *str == 0;
+		if (*str == 0 && *pat != '*')
+			return FALSE;
+
 		/*
-		 * Check for a "*" as the next pattern character.  It matches
-		 * any substring.  We handle this by calling ourselves
-		 * recursively for each postfix of string, until either we
-		 * match or we reach the end of the string.
+		 * A '*' in the pattern matches any substring.  We handle this
+		 * by calling ourselves for each suffix of the string.
 		 */
-		if (*pattern == '*') {
-			pattern++;
-			while (*pattern == '*')
-pattern++;
-			if (*pattern == 0)
-return 1;
-			while (*string != 0) {
-if (Str_Match(string, pattern))
-	return 1;
-++string;
+		if (*pat == '*') {
+			pat++;
+			while (*pat == '*')
+pat++;
+			if (*pat == 0)
+return TRUE;
+			while (*str != 0) {
+if (Str_Match(str, pat))
+	return TRUE;
+str++;
 			}
-			return 0;
+			return FALSE;
 		}
-		/*
-		 * Check for a "?" as the next pattern character.  It matches
-		 * any single character.
-		 */
-		if (*pattern == '?')
+
+		/* A '?' in the pattern matches any single character. */
+		if (*pat == '?')
 			goto thisCharOK;
+
 		/*
-		 * Check for a "[" as the next pattern character.  It is
-		 * followed by a list of characters that are acceptable, or
-		 * by a range (two characters separated by "-").
+		 * A '[' in the pattern matches a character from a list.
+		 * The '[' is followed by the list of acceptable characters,
+		 * or by ranges (two characters separated by '-'). In these
+		 * character lists, the backslash is an ordinary character.
 		 */
-		if (*pattern == '[') {
-			int nomatch;
+		if (*pat == '[') {
+			Boolean neg = pat[1] == '^';
+			pat += 1 + neg;
 
-			

CVS commit: src/tests/sbin

2020-07-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Jul  3 07:03:14 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_random_garbage.sh
src/tests/sbin/sysctl: t_random_garbage.sh

Log Message:
Skip these also for Qemu runs as they cause panics. Point to PR kern/55451.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/ifconfig/t_random_garbage.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/sysctl/t_random_garbage.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/sbin/ifconfig/t_random_garbage.sh
diff -u src/tests/sbin/ifconfig/t_random_garbage.sh:1.2 src/tests/sbin/ifconfig/t_random_garbage.sh:1.3
--- src/tests/sbin/ifconfig/t_random_garbage.sh:1.2	Sat Jun 27 14:04:17 2020
+++ src/tests/sbin/ifconfig/t_random_garbage.sh	Fri Jul  3 07:03:14 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_random_garbage.sh,v 1.2 2020/06/27 14:04:17 jruoho Exp $
+# $NetBSD: t_random_garbage.sh,v 1.3 2020/07/03 07:03:14 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,7 +47,8 @@ write_garbage() {
 atf_test_case random_garbage
 random_garbage_head() {
 	atf_set "require.user" "root"
-	atf_set "descr" "Test writing random garbage to ifconfig(8) options"
+	atf_set "descr" "Test writing random garbage to " \
+		"ifconfig(8) options (PR kern/55451)"
 }
 
 random_garbage_body() {
@@ -62,7 +63,7 @@ random_garbage_body() {
 	#
 	# Take care.
 	#
-	atf_skip "The test is not safe"
+	atf_skip "The test is not safe (PR kern/55451)"
 
 	opts="advbase advskew broadcast carpdev description \
 	  media mediaopt -mediaopt mode instance metric mtu \

Index: src/tests/sbin/sysctl/t_random_garbage.sh
diff -u src/tests/sbin/sysctl/t_random_garbage.sh:1.2 src/tests/sbin/sysctl/t_random_garbage.sh:1.3
--- src/tests/sbin/sysctl/t_random_garbage.sh:1.2	Tue Jun 30 11:49:26 2020
+++ src/tests/sbin/sysctl/t_random_garbage.sh	Fri Jul  3 07:03:14 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_random_garbage.sh,v 1.2 2020/06/30 11:49:26 jruoho Exp $
+# $NetBSD: t_random_garbage.sh,v 1.3 2020/07/03 07:03:14 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -41,16 +41,13 @@ atf_test_case random_garbage cleanup
 random_garbage_head() {
 	sysctl -a > $tmp
 	atf_set "require.user" "root"
-	atf_set "descr" "Test writing random garbage to sysctl nodes"
+	atf_set "descr" "Test writing random garbage " \
+		"to sysctl nodes (PR kern/55451)"
 }
 
 random_garbage_body() {
 
-	sysctl machdep.cpu_brand 2>/dev/null | grep "QEMU"
-
-	if [ $? -eq 1 ]; then
-		atf_skip "The test is not safe"
-	fi
+	atf_skip "The test is not safe (PR kern/55451)"
 
 	while read line; do
 
@@ -90,11 +87,7 @@ random_garbage_body() {
 
 random_garbage_cleanup() {
 
-	sysctl machdep.cpu_brand 2>/dev/null | grep "QEMU"
-
-	if [ $? -eq 1 ]; then
-		atf_skip "The test is not safe"
-	fi
+	atf_skip "The test is not safe (PR kern/55451)"
 
 	while read line; do
 		var=$(echo $line | awk '{print $1}')



CVS commit: src/sys/arch/arm/include/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 06:49:26 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Consistency...#define


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/arch/arm/include/arm32/pmap.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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.167 src/sys/arch/arm/include/arm32/pmap.h:1.168
--- src/sys/arch/arm/include/arm32/pmap.h:1.167	Sat Apr 18 11:00:38 2020
+++ src/sys/arch/arm/include/arm32/pmap.h	Fri Jul  3 06:49:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.167 2020/04/18 11:00:38 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.168 2020/07/03 06:49:26 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -84,20 +84,20 @@
 #endif
 
 #ifdef ARM_MMU_EXTENDED
-#define PMAP_HWPAGEWALKER		1
-#define PMAP_TLB_MAX			1
+#define	PMAP_HWPAGEWALKER		1
+#define	PMAP_TLB_MAX			1
 #if PMAP_TLB_MAX > 1
-#define PMAP_TLB_NEED_SHOOTDOWN		1
+#define	PMAP_TLB_NEED_SHOOTDOWN		1
 #endif
-#define PMAP_TLB_FLUSH_ASID_ON_RESET	(arm_has_tlbiasid_p)
-#define PMAP_TLB_NUM_PIDS		256
-#define cpu_set_tlb_info(ci, ti)((void)((ci)->ci_tlb_info = (ti)))
+#define	PMAP_TLB_FLUSH_ASID_ON_RESET	(arm_has_tlbiasid_p)
+#define	PMAP_TLB_NUM_PIDS		256
+#define	cpu_set_tlb_info(ci, ti)((void)((ci)->ci_tlb_info = (ti)))
 #if PMAP_TLB_MAX > 1
-#define cpu_tlb_info(ci)		((ci)->ci_tlb_info)
+#define	cpu_tlb_info(ci)		((ci)->ci_tlb_info)
 #else
-#define cpu_tlb_info(ci)		(_tlb0_info)
+#define	cpu_tlb_info(ci)		(_tlb0_info)
 #endif
-#define pmap_md_tlb_asid_max()		(PMAP_TLB_NUM_PIDS - 1)
+#define	pmap_md_tlb_asid_max()		(PMAP_TLB_NUM_PIDS - 1)
 #include 
 #include 
 
@@ -143,7 +143,7 @@
  * three of these to map their whole working set.
  */
 #define	L2_BUCKET_XLOG2	(L1_S_SHIFT)
-#define L2_BUCKET_XSIZE	(1 << L2_BUCKET_XLOG2)
+#define	L2_BUCKET_XSIZE	(1 << L2_BUCKET_XLOG2)
 #define	L2_BUCKET_LOG2	4
 #define	L2_BUCKET_SIZE	(1 << L2_BUCKET_LOG2)
 
@@ -160,9 +160,9 @@
  * ARMv6 is physically-tagged but all others are virtually-tagged.
  */
 #if (ARM_MMU_V6 + ARM_MMU_V7) > 0
-#define PMAP_CACHE_VIPT
+#define	PMAP_CACHE_VIPT
 #else
-#define PMAP_CACHE_VIVT
+#define	PMAP_CACHE_VIVT
 #endif
 
 #ifndef _LOCORE
@@ -356,13 +356,13 @@ extern int		arm_poolpage_vmfreelist;
 
 #define	pmap_copy(dp, sp, da, l, sa)	/* nothing */
 
-#define pmap_phys_address(ppn)		(arm_ptob((ppn)))
+#define	pmap_phys_address(ppn)		(arm_ptob((ppn)))
 u_int arm32_mmap_flags(paddr_t);
-#define ARM32_MMAP_WRITECOMBINE		0x4000
-#define ARM32_MMAP_CACHEABLE		0x2000
-#define ARM_MMAP_WRITECOMBINE		ARM32_MMAP_WRITECOMBINE
-#define ARM_MMAP_CACHEABLE		ARM32_MMAP_CACHEABLE
-#define pmap_mmap_flags(ppn)		arm32_mmap_flags(ppn)
+#define	ARM32_MMAP_WRITECOMBINE		0x4000
+#define	ARM32_MMAP_CACHEABLE		0x2000
+#define	ARM_MMAP_WRITECOMBINE		ARM32_MMAP_WRITECOMBINE
+#define	ARM_MMAP_CACHEABLE		ARM32_MMAP_CACHEABLE
+#define	pmap_mmap_flags(ppn)		arm32_mmap_flags(ppn)
 
 #define	PMAP_PTE			0x1000 /* kenter_pa */
 #define	PMAP_DEV			0x2000 /* kenter_pa */
@@ -377,7 +377,7 @@ bool	pmap_remove_all(pmap_t);
 bool	pmap_extract(pmap_t, vaddr_t, paddr_t *);
 
 #define	PMAP_NEED_PROCWR
-#define PMAP_GROWKERNEL		/* turn on pmap_growkernel interface */
+#define	PMAP_GROWKERNEL		/* turn on pmap_growkernel interface */
 #define	PMAP_ENABLE_PMAP_KMPAGE	/* enable the PMAP_KMPAGE flag */
 
 #if (ARM_MMU_V6 + ARM_MMU_V7) > 0
@@ -426,7 +426,7 @@ void	pmap_devmap_register(const struct p
  * Special page zero routine for use by the idle loop (no cache cleans).
  */
 bool	pmap_pageidlezero(paddr_t);
-#define PMAP_PAGEIDLEZERO(pa)	pmap_pageidlezero((pa))
+#define	PMAP_PAGEIDLEZERO(pa)	pmap_pageidlezero((pa))
 
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 /*
@@ -546,14 +546,14 @@ pmap_ptesync(pt_entry_t *ptep, size_t cn
 #define	PTE_SYNC(ptep)			pmap_ptesync((ptep), PAGE_SIZE / L2_S_SIZE)
 #define	PTE_SYNC_RANGE(ptep, cnt)	pmap_ptesync((ptep), (cnt))
 
-#define l1pte_valid_p(pde)	((pde) != 0)
-#define l1pte_section_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_S)
-#define l1pte_supersection_p(pde) (l1pte_section_p(pde)	\
+#define	l1pte_valid_p(pde)	((pde) != 0)
+#define	l1pte_section_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_S)
+#define	l1pte_supersection_p(pde) (l1pte_section_p(pde)	\
 && ((pde) & L1_S_V6_SUPER) != 0)
-#define l1pte_page_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_C)
-#define l1pte_fpage_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_F)
-#define l1pte_pa(pde)		((pde) & L1_C_ADDR_MASK)
-#define l1pte_index(v)		((vaddr_t)(v) >> L1_S_SHIFT)
+#define	l1pte_page_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_C)
+#define	l1pte_fpage_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_F)
+#define	l1pte_pa(pde)		((pde) & L1_C_ADDR_MASK)
+#define	l1pte_index(v)		((vaddr_t)(v) >> L1_S_SHIFT)
 
 static inline void
 

CVS commit: src/sys/arch/arm/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 06:35:05 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: cpuswitch.S

Log Message:
KNF (sort #includes)


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/arm/arm32/cpuswitch.S

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

Modified files:

Index: src/sys/arch/arm/arm32/cpuswitch.S
diff -u src/sys/arch/arm/arm32/cpuswitch.S:1.98 src/sys/arch/arm/arm32/cpuswitch.S:1.99
--- src/sys/arch/arm/arm32/cpuswitch.S:1.98	Tue Feb 11 15:11:27 2020
+++ src/sys/arch/arm/arm32/cpuswitch.S	Fri Jul  3 06:35:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuswitch.S,v 1.98 2020/02/11 15:11:27 skrll Exp $	*/
+/*	$NetBSD: cpuswitch.S,v 1.99 2020/07/03 06:35:05 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -78,15 +78,15 @@
  */
 
 #include "opt_armfpe.h"
-#include "opt_multiprocessor.h"
 #include "opt_cpuoptions.h"
 #include "opt_lockdebug.h"
+#include "opt_multiprocessor.h"
 
 #include "assym.h"
 #include 
 #include 
 
-	RCSID("$NetBSD: cpuswitch.S,v 1.98 2020/02/11 15:11:27 skrll Exp $")
+	RCSID("$NetBSD: cpuswitch.S,v 1.99 2020/07/03 06:35:05 skrll Exp $")
 
 /* LINTSTUB: include  */
 



CVS commit: src/sys/arch/arm/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 06:33:39 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c

Log Message:
Style and share a debug string


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.62 src/sys/arch/arm/arm32/arm32_kvminit.c:1.63
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.62	Fri Jul  3 06:26:41 2020
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Fri Jul  3 06:33:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.62 2020/07/03 06:26:41 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.63 2020/07/03 06:33:39 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.62 2020/07/03 06:26:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.63 2020/07/03 06:33:39 skrll Exp $");
 
 #include 
 
@@ -648,12 +648,13 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 
 	if (map_vectors_p) {
 		/* Map the L2 pages tables in the L1 page table */
-		pmap_link_l2pt(l1pt_va, systempage.pv_va & -L2_S_SEGSIZE,
-		>bmi_vector_l2pt);
-		VPRINTF("%s: adding L2 pt (VA %#lx, PA %#lx) "
-		"for VA %#lx\n (vectors)",
+		const vaddr_t va = systempage.pv_va & -L2_S_SEGSIZE;
+
+		pmap_link_l2pt(l1pt_va, va,  >bmi_vector_l2pt);
+
+		VPRINTF("%s: adding L2 pt (VA %#lx, PA %#lx) for VA %#lx %s\n",
 		__func__, bmi->bmi_vector_l2pt.pv_va,
-		bmi->bmi_vector_l2pt.pv_pa, systempage.pv_va);
+		bmi->bmi_vector_l2pt.pv_pa, systempage.pv_va, "(vectors)");
 	}
 
 	/*
@@ -667,28 +668,35 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	kernel_base, KERNEL_L2PT_KERNEL_NUM);
 
 	for (size_t idx = 0; idx < KERNEL_L2PT_KERNEL_NUM; idx++) {
-		pmap_link_l2pt(l1pt_va, kernel_base + idx * L2_S_SEGSIZE,
-		_l2pt[idx]);
-		VPRINTF("%s: adding L2 pt (VA %#lx, PA %#lx) for VA %#lx (kernel)\n",
-		__func__, kernel_l2pt[idx].pv_va,
-		kernel_l2pt[idx].pv_pa, kernel_base + idx * L2_S_SEGSIZE);
+		const vaddr_t va = kernel_base + idx * L2_S_SEGSIZE;
+
+		pmap_link_l2pt(l1pt_va, va, _l2pt[idx]);
+
+		VPRINTF("%s: adding L2 pt (VA %#lx, PA %#lx) for VA %#lx %s\n",
+		__func__, kernel_l2pt[idx].pv_va, kernel_l2pt[idx].pv_pa,
+		va, "(kernel)");
 	}
 
 	VPRINTF("%s: kernel_vm_base %lx KERNEL_L2PT_VMDATA_NUM %d\n", __func__,
 	kernel_vm_base, KERNEL_L2PT_VMDATA_NUM);
 
 	for (size_t idx = 0; idx < KERNEL_L2PT_VMDATA_NUM; idx++) {
-		pmap_link_l2pt(l1pt_va, kernel_vm_base + idx * L2_S_SEGSIZE,
-		_l2pt[idx]);
-		VPRINTF("%s: adding L2 pt (VA %#lx, PA %#lx) for VA %#lx (vm)\n",
+		const vaddr_t va = kernel_vm_base + idx * L2_S_SEGSIZE;
+
+		pmap_link_l2pt(l1pt_va, va, _l2pt[idx]);
+
+		VPRINTF("%s: adding L2 pt (VA %#lx, PA %#lx) for VA %#lx %s\n",
 		__func__, vmdata_l2pt[idx].pv_va, vmdata_l2pt[idx].pv_pa,
-		kernel_vm_base + idx * L2_S_SEGSIZE);
+		va, "(vm)");
 	}
 	if (iovbase) {
-		pmap_link_l2pt(l1pt_va, iovbase & -L2_S_SEGSIZE, >bmi_io_l2pt);
-		VPRINTF("%s: adding L2 pt (VA %#lx, PA %#lx) for VA %#lx (io)\n",
+		const vaddr_t va = iovbase & -L2_S_SEGSIZE;
+
+		pmap_link_l2pt(l1pt_va, va, >bmi_io_l2pt);
+
+		VPRINTF("%s: adding L2 pt (VA %#lx, PA %#lx) for VA %#lx %s\n",
 		__func__, bmi->bmi_io_l2pt.pv_va, bmi->bmi_io_l2pt.pv_pa,
-		iovbase & -L2_S_SEGSIZE);
+		va, "(io)");
 	}
 
 	/* update the top of the kernel VM */



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 06:30:02 UTC 2020

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

Log Message:
make(1): clean up Str_Match

- removed unnecessary parentheses
- uniform test for end of string


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/make/str.c

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

Modified files:

Index: src/usr.bin/make/str.c
diff -u src/usr.bin/make/str.c:1.49 src/usr.bin/make/str.c:1.50
--- src/usr.bin/make/str.c:1.49	Fri Jul  3 06:25:23 2020
+++ src/usr.bin/make/str.c	Fri Jul  3 06:30:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.49 2020/07/03 06:25:23 rillig Exp $	*/
+/*	$NetBSD: str.c,v 1.50 2020/07/03 06:30:02 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.49 2020/07/03 06:25:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.50 2020/07/03 06:30:02 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.49 2020/07/03 06:25:23 rillig Exp $");
+__RCSID("$NetBSD: str.c,v 1.50 2020/07/03 06:30:02 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -343,7 +343,7 @@ Str_Match(const char *string, const char
 		 * pattern but not at the end of the string, we failed.
 		 */
 		if (*pattern == 0)
-			return !*string;
+			return *string == 0;
 		if (*string == 0 && *pattern != '*')
 			return 0;
 		/*
@@ -386,7 +386,7 @@ Str_Match(const char *string, const char
 			} else
 nomatch = 0;
 			for (;;) {
-if ((*pattern == ']') || (*pattern == 0)) {
+if (*pattern == ']' || *pattern == 0) {
 	if (nomatch)
 		break;
 	return 0;
@@ -397,19 +397,19 @@ Str_Match(const char *string, const char
 	c2 = pattern[2];
 	if (c2 == 0)
 		return nomatch;
-	if ((*pattern <= *string) &&
-	(c2 >= *string))
+	if (*pattern <= *string &&
+	c2 >= *string)
 		break;
-	if ((*pattern >= *string) &&
-	(c2 <= *string))
+	if (*pattern >= *string &&
+	c2 <= *string)
 		break;
 	pattern += 2;
 }
 ++pattern;
 			}
-			if (nomatch && (*pattern != ']') && (*pattern != 0))
+			if (nomatch && *pattern != ']' && *pattern != 0)
 return 0;
-			while ((*pattern != ']') && (*pattern != 0))
+			while (*pattern != ']' && *pattern != 0)
 ++pattern;
 			if (*pattern == 0)
 --pattern;



CVS commit: src/sys/arch/arm/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 06:26:41 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c

Log Message:
Use howmany()


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.61 src/sys/arch/arm/arm32/arm32_kvminit.c:1.62
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.61	Fri Jul  3 06:22:48 2020
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Fri Jul  3 06:26:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.61 2020/07/03 06:22:48 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.62 2020/07/03 06:26:41 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.61 2020/07/03 06:22:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.62 2020/07/03 06:26:41 skrll Exp $");
 
 #include 
 
@@ -476,7 +476,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	kernel_size += 0x1;	/* slop */
 	if (!mapallmem_p) {
 		kernel_size += PAGE_SIZE
-		* ((kernel_size + L2_S_SEGSIZE - 1) / L2_S_SEGSIZE);
+		* howmany(kernel_size, L2_S_SEGSIZE);
 	}
 	kernel_size = round_page(kernel_size);
 
@@ -484,7 +484,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	 * Now we know how many L2 pages it will take.
 	 */
 	const size_t KERNEL_L2PT_KERNEL_NUM =
-	round_page(kernel_size + L2_S_SEGSIZE - 1) / L2_S_SEGSIZE;
+	howmany(kernel_size, L2_S_SEGSIZE);
 
 	VPRINTF("%s: %zu L2 pages are needed to map %#zx kernel bytes\n",
 	__func__, KERNEL_L2PT_KERNEL_NUM, kernel_size);



CVS commit: src/usr.bin/make

2020-07-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul  3 06:25:23 UTC 2020

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

Log Message:
make(1): clean up documentation of Str_Match


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/make/str.c

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

Modified files:

Index: src/usr.bin/make/str.c
diff -u src/usr.bin/make/str.c:1.48 src/usr.bin/make/str.c:1.49
--- src/usr.bin/make/str.c:1.48	Mon Jun 15 14:46:28 2020
+++ src/usr.bin/make/str.c	Fri Jul  3 06:25:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.48 2020/06/15 14:46:28 rillig Exp $	*/
+/*	$NetBSD: str.c,v 1.49 2020/07/03 06:25:23 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.48 2020/06/15 14:46:28 rillig Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.49 2020/07/03 06:25:23 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.48 2020/06/15 14:46:28 rillig Exp $");
+__RCSID("$NetBSD: str.c,v 1.49 2020/07/03 06:25:23 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -320,16 +320,15 @@ Str_FindSubstring(const char *string, co
 }
 
 /*
- * Str_Match --
- *
- * See if a particular string matches a particular pattern.
- *
- * Results: Non-zero is returned if string matches pattern, 0 otherwise. The
- * matching operation permits the following special characters in the
- * pattern: *?\[] (see the man page for details on what these mean).
+ * Str_Match -- Test if a string matches a pattern.
  *
  * XXX this function does not detect or report malformed patterns.
  *
+ * Results:
+ *	Non-zero is returned if string matches the pattern, 0 otherwise. The
+ *	matching operation permits the following special characters in the
+ *	pattern: *?\[] (as in glob(3)).
+ *
  * Side effects: None.
  */
 int



CVS commit: src/sys/arch/arm/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 06:22:48 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.60 src/sys/arch/arm/arm32/arm32_kvminit.c:1.61
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.60	Fri Jun 26 08:42:27 2020
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Fri Jul  3 06:22:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.60 2020/06/26 08:42:27 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.61 2020/07/03 06:22:48 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.60 2020/06/26 08:42:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.61 2020/07/03 06:22:48 skrll Exp $");
 
 #include 
 
@@ -348,7 +348,7 @@ add_pages(struct bootmem_info *bmi, pv_a
 
 static void
 valloc_pages(struct bootmem_info *bmi, pv_addr_t *pv, size_t npages,
-	int prot, int cache, bool zero_p)
+int prot, int cache, bool zero_p)
 {
 	size_t nbytes = npages * PAGE_SIZE;
 	pv_addr_t *free_pv = bmi->bmi_freeblocks;
@@ -368,7 +368,7 @@ valloc_pages(struct bootmem_info *bmi, p
 		VPRINTF(" l1pt");
 
 		valloc_pages(bmi, _l1pt, L1_TABLE_SIZE / PAGE_SIZE,
-		VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE, true);
+		VM_PROT_READ | VM_PROT_WRITE, PTE_PAGETABLE, true);
 		add_pages(bmi, _l1pt);
 	}
 
@@ -424,7 +424,7 @@ valloc_pages(struct bootmem_info *bmi, p
 
 void
 arm32_kernel_vm_init(vaddr_t kernel_vm_base, vaddr_t vectors, vaddr_t iovbase,
-	const struct pmap_devmap *devmap, bool mapallmem_p)
+const struct pmap_devmap *devmap, bool mapallmem_p)
 {
 	struct bootmem_info * const bmi = _info;
 #ifdef MULTIPROCESSOR
@@ -536,7 +536,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 		 */
 		VPRINTF(" vector");
 		valloc_pages(bmi, >bmi_vector_l2pt, 1,
-		VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE, true);
+		VM_PROT_READ | VM_PROT_WRITE, PTE_PAGETABLE, true);
 		add_pages(bmi, >bmi_vector_l2pt);
 	}
 
@@ -546,7 +546,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	VPRINTF(" kernel");
 	for (size_t idx = 0; idx < KERNEL_L2PT_KERNEL_NUM; ++idx) {
 		valloc_pages(bmi, _l2pt[idx], 1,
-		VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE, true);
+		VM_PROT_READ | VM_PROT_WRITE, PTE_PAGETABLE, true);
 		add_pages(bmi, _l2pt[idx]);
 	}
 
@@ -556,7 +556,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	VPRINTF(" vm");
 	for (size_t idx = 0; idx < KERNEL_L2PT_VMDATA_NUM; ++idx) {
 		valloc_pages(bmi, _l2pt[idx], 1,
-		VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE, true);
+		VM_PROT_READ | VM_PROT_WRITE, PTE_PAGETABLE, true);
 		add_pages(bmi, _l2pt[idx]);
 	}
 
@@ -566,7 +566,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	if (iovbase) {
 		VPRINTF(" io");
 		valloc_pages(bmi, >bmi_io_l2pt, 1,
-		VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE, true);
+		VM_PROT_READ | VM_PROT_WRITE, PTE_PAGETABLE, true);
 		add_pages(bmi, >bmi_io_l2pt);
 	}
 
@@ -574,28 +574,28 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 
 	/* Allocate stacks for all modes and CPUs */
 	valloc_pages(bmi, , ABT_STACK_SIZE * cpu_num,
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE, true);
+	VM_PROT_READ | VM_PROT_WRITE, PTE_CACHE, true);
 	add_pages(bmi, );
 	valloc_pages(bmi, , FIQ_STACK_SIZE * cpu_num,
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE, true);
+	VM_PROT_READ | VM_PROT_WRITE, PTE_CACHE, true);
 	add_pages(bmi, );
 	valloc_pages(bmi, , IRQ_STACK_SIZE * cpu_num,
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE, true);
+	VM_PROT_READ | VM_PROT_WRITE, PTE_CACHE, true);
 	add_pages(bmi, );
 	valloc_pages(bmi, , UND_STACK_SIZE * cpu_num,
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE, true);
+	VM_PROT_READ | VM_PROT_WRITE, PTE_CACHE, true);
 	add_pages(bmi, );
 	valloc_pages(bmi, , UPAGES * cpu_num,		/* SVC32 */
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE, true);
+	VM_PROT_READ | VM_PROT_WRITE, PTE_CACHE, true);
 	add_pages(bmi, );
 	valloc_pages(bmi, , UPAGES,			/* SVC32 */
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE, true);
+	VM_PROT_READ | VM_PROT_WRITE, PTE_CACHE, true);
 	add_pages(bmi, );
 
 	/* Allocate the message buffer from the end of memory. */
 	const size_t msgbuf_pgs = round_page(MSGBUFSIZE) / PAGE_SIZE;
 	valloc_pages(bmi, , msgbuf_pgs,
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE, false);
+	VM_PROT_READ | VM_PROT_WRITE, PTE_CACHE, false);
 	add_pages(bmi, );
 	msgbufphys = msgbuf.pv_pa;
 	msgbufaddr = (void *)msgbuf.pv_va;
@@ -608,7 +608,8 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 		 */
 		VPRINTF(" vector");
 
-		valloc_pages(bmi, , 1, 

CVS commit: src/sys/arch/arm/arm

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 06:15:27 UTC 2020

Modified Files:
src/sys/arch/arm/arm: armv6_start.S

Log Message:
Wrap a comment


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/arm/armv6_start.S

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

Modified files:

Index: src/sys/arch/arm/arm/armv6_start.S
diff -u src/sys/arch/arm/arm/armv6_start.S:1.16 src/sys/arch/arm/arm/armv6_start.S:1.17
--- src/sys/arch/arm/arm/armv6_start.S:1.16	Fri Mar 20 19:48:03 2020
+++ src/sys/arch/arm/arm/armv6_start.S	Fri Jul  3 06:15:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: armv6_start.S,v 1.16 2020/03/20 19:48:03 skrll Exp $	*/
+/*	$NetBSD: armv6_start.S,v 1.17 2020/07/03 06:15:27 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2017, 2018 The NetBSD Foundation, Inc.
@@ -224,7 +224,10 @@ generic_savevars:
 
 	.ltorg
 
-	/* Allocate some memory after the kernel image for stacks and bootstrap L1PT */
+	/*
+	 * Allocate some memory after the kernel image for stacks and
+	 * bootstrap L1PT
+	 */
 	.section "_init_memory", "aw", %nobits
 	.p2align INIT_ARM_STACK_SHIFT
 start_stacks_bottom:



CVS commit: src/sys/arch/arm/arm32

2020-07-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 06:13:00 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: db_machdep.c

Log Message:
Provide a db_reset_cmd prototype


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/arm32/db_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/arm32/db_machdep.c
diff -u src/sys/arch/arm/arm32/db_machdep.c:1.32 src/sys/arch/arm/arm32/db_machdep.c:1.33
--- src/sys/arch/arm/arm32/db_machdep.c:1.32	Thu Jul  2 11:10:48 2020
+++ src/sys/arch/arm/arm32/db_machdep.c	Fri Jul  3 06:13:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.c,v 1.32 2020/07/02 11:10:48 jmcneill Exp $	*/
+/*	$NetBSD: db_machdep.c,v 1.33 2020/07/03 06:13:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.32 2020/07/02 11:10:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.33 2020/07/03 06:13:00 skrll Exp $");
 
 #include 
 
@@ -61,6 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: db_machdep.c
 #ifdef _KERNEL
 static long nil;
 
+void db_reset_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_md_cpuinfo_cmd(db_expr_t, bool, db_expr_t, const char *);
 
 int db_access_und_sp(const struct db_variable *, db_expr_t *, int);