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

2020-06-08 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun  9 06:18:01 UTC 2020

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

Log Message:
If we are on a SiByte or Cavium CPU with an FPU, report as "built-in FPU"
instead of saying it's an unknown FPU type.

XXX - add any other CPUs to this list?


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

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

Modified files:

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.283 src/sys/arch/mips/mips/mips_machdep.c:1.284
--- src/sys/arch/mips/mips/mips_machdep.c:1.283	Tue Jun  9 06:01:49 2020
+++ src/sys/arch/mips/mips/mips_machdep.c	Tue Jun  9 06:18:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.283 2020/06/09 06:01:49 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.284 2020/06/09 06:18:01 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.283 2020/06/09 06:01:49 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.284 2020/06/09 06:18:01 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -1495,6 +1495,22 @@ cpu_identify(device_t dev)
 		fpuname = "built-in FPU";
 	if (MIPS_PRID_IMPL(cpu_id) == MIPS_RC64470)	/* FPU PRid is 0x21 */
 		fpuname = "built-in FPU";
+	if (CPUISMIPSNN) {
+		uint32_t cfg1;
+
+		switch (MIPS_PRID_CID(cpu_id)) {
+		/*
+		 * CPUs from the following companies have a built-in
+		 * FPU if Config1[FP] is set.
+		 */
+		case MIPS_PRID_CID_SIBYTE:
+		case MIPS_PRID_CID_CAVIUM:
+			cfg1 = mipsNN_cp0_config1_read();
+			if (cfg1 & MIPSNN_CFG1_FP)
+fpuname = "built-in FPU";
+			break;
+		}
+	}
 
 	if (opts->mips_cpu->cpu_cid != 0) {
 		if (opts->mips_cpu->cpu_cid <= ncidnames)



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

2020-06-08 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun  9 06:01:49 UTC 2020

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

Log Message:
Dynamically build the wayname strings instead of using a sparse array
populated with random N-ways entries.  Not only results in smaller code,
but also handles cases with 39-way caches without extra work.


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

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

Modified files:

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.282 src/sys/arch/mips/mips/mips_machdep.c:1.283
--- src/sys/arch/mips/mips/mips_machdep.c:1.282	Thu Jun  4 15:42:31 2020
+++ src/sys/arch/mips/mips/mips_machdep.c	Tue Jun  9 06:01:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.282 2020/06/04 15:42:31 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.283 2020/06/09 06:01:49 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.282 2020/06/04 15:42:31 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.283 2020/06/09 06:01:49 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -1441,6 +1441,27 @@ mips3_tlb_probe(void)
 }
 #endif
 
+static const char *
+wayname(int ways)
+{
+	static char buf[sizeof("xxx-way set-associative")];
+
+#ifdef DIAGNOSTIC
+	if (ways > 999)
+		panic("mips cache - too many ways (%d)", ways);
+#endif
+
+	switch (ways) {
+	case 0:
+		return "fully set-associative";
+	case 1:
+		return "direct-mapped";
+	default:
+		snprintf(buf, sizeof(buf), "%d-way set-associative", ways);
+		return buf;
+	}
+}
+
 /*
  * Identify product revision IDs of CPU and FPU.
  */
@@ -1451,21 +1472,6 @@ cpu_identify(device_t dev)
 	const struct mips_cache_info * const mci = &mips_cache_info;
 	const mips_prid_t cpu_id = opts->mips_cpu_id;
 	const mips_prid_t fpu_id = opts->mips_fpu_id;
-	static const char * const waynames[] = {
-		[0] = "fully set-associative",
-		[1] = "direct-mapped",
-		[2] = "2-way set-associative",
-		[3] = NULL,
-		[4] = "4-way set-associative",
-		[5] = "5-way set-associative",
-		[6] = "6-way set-associative",
-		[7] = "7-way set-associative",
-		[8] = "8-way set-associative",
-#ifdef MIPS64_OCTEON
-		[64] = "64-way set-associative",
-#endif
-	};
-#define	nwaynames (sizeof(waynames) / sizeof(waynames[0]))
 	static const char * const wtnames[] = {
 		"write-back",
 		"write-through",
@@ -1533,26 +1539,23 @@ cpu_identify(device_t dev)
 		"dmesg lines.\n", device_xname(dev));
 	}
 
-	KASSERT(mci->mci_picache_ways < nwaynames);
-	KASSERT(mci->mci_pdcache_ways < nwaynames);
-	KASSERT(mci->mci_sicache_ways < nwaynames);
-	KASSERT(mci->mci_sdcache_ways < nwaynames);
-
 	switch (opts->mips_cpu_arch) {
 #if defined(MIPS1)
 	case CPU_ARCH_MIPS1:
 		if (mci->mci_picache_size)
 			aprint_normal_dev(dev, "%dKB/%dB %s Instruction cache, "
 			"%d TLB entries\n", mci->mci_picache_size / 1024,
-			mci->mci_picache_line_size, waynames[mci->mci_picache_ways],
+			mci->mci_picache_line_size,
+			wayname(mci->mci_picache_ways),
 			opts->mips_num_tlb_entries);
 		else
 			aprint_normal_dev(dev, "%d TLB entries\n",
 			opts->mips_num_tlb_entries);
 		if (mci->mci_pdcache_size)
 			aprint_normal_dev(dev, "%dKB/%dB %s %s Data cache\n",
-			mci->mci_pdcache_size / 1024, mci->mci_pdcache_line_size,
-			waynames[mci->mci_pdcache_ways],
+			mci->mci_pdcache_size / 1024,
+			mci->mci_pdcache_line_size,
+			wayname(mci->mci_pdcache_ways),
 			wtnames[mci->mci_pdcache_write_through]);
 		break;
 #endif /* MIPS1 */
@@ -1565,7 +1568,8 @@ cpu_identify(device_t dev)
 	case CPU_ARCH_MIPS64R2: {
 		const char *sufx = "KMGTPE";
 		uint32_t pg_mask;
-		aprint_normal_dev(dev, "%d TLB entries", opts->mips_num_tlb_entries);
+		aprint_normal_dev(dev, "%d TLB entries",
+		opts->mips_num_tlb_entries);
 #if !defined(__mips_o32)
 		if (CPUIS64BITS) {
 			int64_t pfn_mask;
@@ -1595,20 +1599,23 @@ cpu_identify(device_t dev)
 			aprint_normal_dev(dev,
 			"%dKB/%dB %s L1 instruction cache\n",
 			mci->mci_picache_size / 1024,
-			mci->mci_picache_line_size, waynames[mci->mci_picache_ways]);
+			mci->mci_picache_line_size,
+			wayname(mci->mci_picache_ways));
 		if (mci->mci_pdcache_size)
 			aprint_normal_dev(dev,
 			"%dKB/%dB %s %s %sL1 data cache\n",
-			mci->mci_pdcache_size / 1024, mci->mci_pdcache_line_size,
-			waynames[mci->mci_pdcache_ways],
+			mci->mci_pdcache_size / 1024,
+			mci->mci_pdcache_line_size,
+			wayname(mci->mci_pdcache_ways),
 			wtnames[mci->mci_pdcache_write_through],
 			((opts->mips_cpu_flags & CPU_MIPS_D_CACHE_COHERENT)
 ? "coherent " : ""));
 		if (mci->mci_sdcache_line_size)
 			aprint_normal_

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

2020-06-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun  9 05:07:13 UTC 2020

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

Log Message:
Add braces.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/x86/identcpu_subr.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/identcpu_subr.c
diff -u src/sys/arch/x86/x86/identcpu_subr.c:1.5 src/sys/arch/x86/x86/identcpu_subr.c:1.6
--- src/sys/arch/x86/x86/identcpu_subr.c:1.5	Tue Jun  9 05:06:27 2020
+++ src/sys/arch/x86/x86/identcpu_subr.c	Tue Jun  9 05:07:13 2020
@@ -33,7 +33,7 @@
  * See src/usr.sbin/cpuctl/{Makefile, arch/i386.c}).
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu_subr.c,v 1.5 2020/06/09 05:06:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu_subr.c,v 1.6 2020/06/09 05:07:13 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "lapic.h"
@@ -71,7 +71,7 @@ cpu_tsc_freq_cpuid(struct cpu_info *ci)
 	x86_cpuid(0x15, descs);
 	denominator = descs[0];
 	numerator = descs[1];
-	if ((denominator != 0) && numerator != 0) {
+	if ((denominator != 0) && (numerator != 0)) {
 		khz = 0;
 		if (descs[2] != 0)
 			khz = descs[2] / 1000;



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

2020-06-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun  9 05:06:27 UTC 2020

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

Log Message:
Remove debug printf.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/x86/identcpu_subr.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/identcpu_subr.c
diff -u src/sys/arch/x86/x86/identcpu_subr.c:1.4 src/sys/arch/x86/x86/identcpu_subr.c:1.5
--- src/sys/arch/x86/x86/identcpu_subr.c:1.4	Tue May 12 06:32:05 2020
+++ src/sys/arch/x86/x86/identcpu_subr.c	Tue Jun  9 05:06:27 2020
@@ -33,7 +33,7 @@
  * See src/usr.sbin/cpuctl/{Makefile, arch/i386.c}).
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu_subr.c,v 1.4 2020/05/12 06:32:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu_subr.c,v 1.5 2020/06/09 05:06:27 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "lapic.h"
@@ -71,10 +71,7 @@ cpu_tsc_freq_cpuid(struct cpu_info *ci)
 	x86_cpuid(0x15, descs);
 	denominator = descs[0];
 	numerator = descs[1];
-	if ((denominator == 0) || numerator == 0) {
-		aprint_debug_dev(ci->ci_dev,
-		"TSC/core crystal clock ratio is not enumerated\n");
-	} else {
+	if ((denominator != 0) && numerator != 0) {
 		khz = 0;
 		if (descs[2] != 0)
 			khz = descs[2] / 1000;



CVS commit: src/sys/kern

2020-06-08 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Jun  9 04:48:45 UTC 2020

Modified Files:
src/sys/kern: makesyscalls.sh

Log Message:
Update wrong and obsolete comments.

... when you change the set of syscalls.conf keywords this thing
recognizes, updating the documentation too (which AFAIK is limited to
the comment in here) is always helpful ...


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/kern/makesyscalls.sh

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/makesyscalls.sh
diff -u src/sys/kern/makesyscalls.sh:1.178 src/sys/kern/makesyscalls.sh:1.179
--- src/sys/kern/makesyscalls.sh:1.178	Tue Jun  2 16:45:42 2020
+++ src/sys/kern/makesyscalls.sh	Tue Jun  9 04:48:45 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: makesyscalls.sh,v 1.178 2020/06/02 16:45:42 kamil Exp $
+#	$NetBSD: makesyscalls.sh,v 1.179 2020/06/09 04:48:45 dholland Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -47,6 +47,8 @@ esac
 #	syssw		the syscall switch file
 #	sysautoload	the syscall autoload definitions file
 #	sysarghdr	the syscall argument struct definitions
+#	sysarghdrextra	extra stuff dumped into sysarghdr
+#	systrace	the dtrace definitions
 #	compatopts	those syscall types that are for 'compat' syscalls
 #	switchname	the name for the 'struct sysent' we define
 #	namesname	the name for the 'const char *[]' we define
@@ -57,6 +59,9 @@ esac
 #	sys_nosys	[optional] name of function called for unsupported
 #			syscalls, if not sys_nosys()
 #   maxsysargs	[optiona] the maximum number or arguments
+#	rumpcalls	???
+#	rumpcallshdr	???
+#	rumpsysmap	???
 #
 # NOTE THAT THIS makesyscalls.sh DOES NOT SUPPORT 'SYSLIBCOMPAT'.
 
@@ -143,7 +148,7 @@ function toupper(str) {
 fi
 
 # before handing it off to awk, make a few adjustments:
-#	(1) insert spaces around {, }, (, ), *, and commas.
+#	(1) insert spaces around {, }, (, ), *, |, and commas.
 #	(2) get rid of any and all dollar signs (so that rcs id use safe)
 #
 # The awk script will deal with blank lines and lines that



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

2020-06-08 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue Jun  9 01:48:17 UTC 2020

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

Log Message:
Add test case for :Or


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/modorder.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/modorder.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/modorder.exp
diff -u src/usr.bin/make/unit-tests/modorder.exp:1.1 src/usr.bin/make/unit-tests/modorder.exp:1.2
--- src/usr.bin/make/unit-tests/modorder.exp:1.1	Thu Aug 21 13:44:51 2014
+++ src/usr.bin/make/unit-tests/modorder.exp	Tue Jun  9 01:48:17 2020
@@ -1,5 +1,6 @@
 LIST  = one two three four five six seven eight nine ten
 LIST:O= eight five four nine one seven six ten three two
+LIST:Or= two three ten six seven one nine four five eight
 LIST:Ox   = Ok
 LIST:O:Ox = Ok
 LISTX = Ok

Index: src/usr.bin/make/unit-tests/modorder.mk
diff -u src/usr.bin/make/unit-tests/modorder.mk:1.2 src/usr.bin/make/unit-tests/modorder.mk:1.3
--- src/usr.bin/make/unit-tests/modorder.mk:1.2	Tue Jan  7 22:42:14 2020
+++ src/usr.bin/make/unit-tests/modorder.mk	Tue Jun  9 01:48:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: modorder.mk,v 1.2 2020/01/07 22:42:14 rillig Exp $
+# $NetBSD: modorder.mk,v 1.3 2020/06/09 01:48:17 sjg Exp $
 
 LIST=		one two three four five six seven eight nine ten
 LISTX=		${LIST:Ox}
@@ -10,6 +10,7 @@ TEST_RESULT= && echo Ok || echo Failed
 all:
 	@echo "LIST  = ${LIST}"
 	@echo "LIST:O= ${LIST:O}"
+	@echo "LIST:Or= ${LIST:Or}"
 	# Note that 1 in every 10! trials two independently generated
 	# randomized orderings will be the same.  The test framework doesn't
 	# support checking probabilistic output, so we accept that each of the



CVS commit: src/tests/lib/libc/sys

2020-06-08 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Jun  9 00:28:57 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_fork_wait.h

Log Message:
Add fork/vfork/posix_spawn tests for processes within pgrp

New tests:
 - fork_setpgid
 - vfork_setpgid
 - posix_spawn_setpgid
 - unrelated_tracer_fork_setpgid
 - unrelated_tracer_vfork_setpgid
 - unrelated_tracer_posix_spawn_setpgid

These tests trigger a kernel assert for pg_jobc going negative.

The tests are temporarily skipped.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_ptrace_fork_wait.h

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/libc/sys/t_ptrace_fork_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_fork_wait.h:1.6 src/tests/lib/libc/sys/t_ptrace_fork_wait.h:1.7
--- src/tests/lib/libc/sys/t_ptrace_fork_wait.h:1.6	Sat May 16 23:10:26 2020
+++ src/tests/lib/libc/sys/t_ptrace_fork_wait.h	Tue Jun  9 00:28:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_fork_wait.h,v 1.6 2020/05/16 23:10:26 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_fork_wait.h,v 1.7 2020/06/09 00:28:57 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2020 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 static void
 fork_body(const char *fn, bool trackspawn, bool trackfork, bool trackvfork,
-bool trackvforkdone)
+bool trackvforkdone, bool newpgrp)
 {
 	const int exitval = 5;
 	const int exitval2 = 0; /* This matched exit status from /bin/echo */
@@ -46,9 +46,17 @@ fork_body(const char *fn, bool trackspaw
 
 	char * const arg[] = { __UNCONST("/bin/echo"), NULL };
 
+	if (newpgrp)
+		atf_tc_skip("kernel panic (pg_jobc going negative)");
+
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
+		if (newpgrp) {
+			DPRINTF("Before entering new process group");
+			setpgid(0, 0);
+		}
+
 		DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid());
 		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
 
@@ -232,24 +240,28 @@ fork_body(const char *fn, bool trackspaw
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
 }
 
-#define FORK_TEST(name,fun,tspawn,tfork,tvfork,tvforkdone)		\
+#define FORK_TEST2(name,fun,tspawn,tfork,tvfork,tvforkdone,newpgrp)	\
 ATF_TC(name);\
 ATF_TC_HEAD(name, tc)			\
 {	\
 	atf_tc_set_md_var(tc, "descr", "Verify " fun "() "		\
-	"called with 0%s%s%s%s in EVENT_MASK",			\
+	"called with 0%s%s%s%s in EVENT_MASK%s",			\
 	tspawn ? "|PTRACE_POSIX_SPAWN" : "",			\
 	tfork ? "|PTRACE_FORK" : "",\
 	tvfork ? "|PTRACE_VFORK" : "",\
-	tvforkdone ? "|PTRACE_VFORK_DONE" : "");			\
+	tvforkdone ? "|PTRACE_VFORK_DONE" : "",			\
+	newpgrp ? " and the traced processes call setpgrp(0,0)":"");\
 }	\
 	\
 ATF_TC_BODY(name, tc)			\
 {	\
 	\
-	fork_body(fun, tspawn, tfork, tvfork, tvforkdone);		\
+	fork_body(fun, tspawn, tfork, tvfork, tvforkdone, newpgrp);	\
 }
 
+#define FORK_TEST(name,fun,tspawn,tfork,tvfork,tvforkdone)		\
+	FORK_TEST2(name,fun,tspawn,tfork,tvfork,tvforkdone,false)
+
 FORK_TEST(fork1, "fork", false, false, false, false)
 #if defined(TWAIT_HAVE_PID)
 FORK_TEST(fork2, "fork", false, true, false, false)
@@ -275,6 +287,10 @@ FORK_TEST(fork15, "fork", true, false, t
 FORK_TEST(fork16, "fork", true, true, true, true)
 #endif
 
+#if defined(TWAIT_HAVE_PID)
+FORK_TEST2(fork_setpgid, "fork", true, true, true, true, true)
+#endif
+
 FORK_TEST(vfork1, "vfork", false, false, false, false)
 #if defined(TWAIT_HAVE_PID)
 FORK_TEST(vfork2, "vfork", false, true, false, false)
@@ -300,6 +316,10 @@ FORK_TEST(vfork15, "vfork", true, false,
 FORK_TEST(vfork16, "vfork", true, true, true, true)
 #endif
 
+#if defined(TWAIT_HAVE_PID)
+FORK_TEST2(vfork_setpgid, "vfork", true, true, true, true, true)
+#endif
+
 FORK_TEST(posix_spawn1, "spawn", false, false, false, false)
 FORK_TEST(posix_spawn2, "spawn", false, true, false, false)
 FORK_TEST(posix_spawn3, "spawn", false, false, true, false)
@@ -319,12 +339,16 @@ FORK_TEST(posix_spawn15, "spawn", true, 
 FORK_TEST(posix_spawn16, "spawn", true, true, true, true)
 #endif
 
+#if defined(TWAIT_HAVE_PID)
+FORK_TEST2(posix_spawn_setpgid, "spawn", true, true, true, true, true)
+#endif
+
 /// 
 
 #if defined(TWAIT_HAVE_PID)
 static void
 unrelated_tracer_fork_body(const char *fn, bool trackspawn, bool trackfork,
-bool trackvfork, bool trackvforkdone)
+bool trackvfork, bool trackvforkdone, bool newpgrp)
 {
 	const int sigval = SIGSTOP;
 	struct msg_fds parent_tracee, parent_tracer;
@@ -346,10 +370,18 @@ unrelated_tracer_fork_body(const char *f
 
 	char * const arg[] = { __UNCONST("/bin/echo"), NULL };
 
+	if (newpgrp)
+		atf_tc_skip("kernel panic (pg_jobc going negative)");
+
 	DPRINTF("Spawn tracee\n");
 

CVS commit: src/sbin/gpt

2020-06-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jun  8 22:52:09 UTC 2020

Modified Files:
src/sbin/gpt: backup.c

Log Message:
When we add "entries", "index", and "sector_size" values to the dictionary,
add them as signed valaues, rather than unsigned (which is how we keep them
in memory).  This causes them be serialized in base-10 (rather than base-16,
which is the default for unsigned).  This behavior is documented in
prop_number(3).  Fixes t_gpt::backup_2part unit test.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sbin/gpt/backup.c

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

Modified files:

Index: src/sbin/gpt/backup.c
diff -u src/sbin/gpt/backup.c:1.19 src/sbin/gpt/backup.c:1.20
--- src/sbin/gpt/backup.c:1.19	Sun Jun  7 05:42:25 2020
+++ src/sbin/gpt/backup.c	Mon Jun  8 22:52:09 2020
@@ -33,13 +33,15 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: backup.c,v 1.19 2020/06/07 05:42:25 thorpej Exp $");
+__RCSID("$NetBSD: backup.c,v 1.20 2020/06/08 22:52:09 thorpej Exp $");
 #endif
 
 #include 
 #include 
 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -80,7 +82,8 @@ store_mbr(gpt_t gpt, unsigned int i, con
 
 	mbr_dict = prop_dictionary_create();
 	PROP_ERR(mbr_dict);
-	PROP_ERR(prop_dictionary_set_uint(mbr_dict, "index", i));
+	assert(i <= INT_MAX);
+	PROP_ERR(prop_dictionary_set_int(mbr_dict, "index", (int)i));
 	PROP_ERR(prop_dictionary_set_uint(mbr_dict, "flag", par->part_flag));
 	PROP_ERR(prop_dictionary_set_uint(mbr_dict, "start_head",
 	  par->part_shd));
@@ -127,8 +130,9 @@ store_gpt(gpt_t gpt, const struct gpt_hd
 	  le32toh(hdr->hdr_revision)));
 	gpt_uuid_snprintf(buf, sizeof(buf), "%d", hdr->hdr_guid);
 	PROP_ERR(prop_dictionary_set_string(*type_dict, "guid", buf));
-	PROP_ERR(prop_dictionary_set_uint(*type_dict, "entries",
-	  le32toh(hdr->hdr_entries)));
+	assert(le32toh(hdr->hdr_entries) <= INT32_MAX);
+	PROP_ERR(prop_dictionary_set_int32(*type_dict, "entries",
+	   (int32_t)le32toh(hdr->hdr_entries)));
 	return 0;
 cleanup:
 	if (*type_dict)
@@ -161,7 +165,8 @@ store_tbl(gpt_t gpt, const map_t m, prop
 	m->map_size * gpt->secsz; i++, ent++) {
 		gpt_dict = prop_dictionary_create();
 		PROP_ERR(gpt_dict);
-		PROP_ERR(prop_dictionary_set_uint(gpt_dict, "index", i));
+		assert(i <= INT_MAX);
+		PROP_ERR(prop_dictionary_set_int(gpt_dict, "index", (int)i));
 		gpt_uuid_snprintf(buf, sizeof(buf), "%d", ent->ent_type);
 		PROP_ERR(prop_dictionary_set_string(gpt_dict, "type", buf));
 		gpt_uuid_snprintf(buf, sizeof(buf), "%d", ent->ent_guid);
@@ -206,7 +211,9 @@ backup(gpt_t gpt, const char *outfile)
 
 	props = prop_dictionary_create();
 	PROP_ERR(props);
-	PROP_ERR(prop_dictionary_set_uint(props, "sector_size", gpt->secsz));
+	assert(gpt->secsz <= INT_MAX);
+	PROP_ERR(prop_dictionary_set_int(props, "sector_size",
+	 (int)gpt->secsz));
 	m = map_first(gpt);
 	while (m != NULL) {
 		switch (m->map_type) {



CVS commit: src/common/lib/libprop

2020-06-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jun  8 21:31:56 UTC 2020

Modified Files:
src/common/lib/libprop: prop_data.c

Log Message:
Fix a paste-o that caused prop_data_create_copy() to be intolerant
of creating empty data objects.  Fixes t_ifconfig::ifconfig_description
unit test.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/common/lib/libprop/prop_data.c

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

Modified files:

Index: src/common/lib/libprop/prop_data.c
diff -u src/common/lib/libprop/prop_data.c:1.16 src/common/lib/libprop/prop_data.c:1.17
--- src/common/lib/libprop/prop_data.c:1.16	Sat Jun  6 21:25:59 2020
+++ src/common/lib/libprop/prop_data.c	Mon Jun  8 21:31:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_data.c,v 1.16 2020/06/06 21:25:59 thorpej Exp $	*/
+/*	$NetBSD: prop_data.c,v 1.17 2020/06/08 21:31:56 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc.
@@ -273,9 +273,6 @@ prop_data_create_copy(const void *v, siz
 	prop_data_t pd;
 	void *nv;
 
-	if (v == NULL || size == 0)
-		return (NULL);
-
 	/* Tolerate the creation of empty data objects. */
 	if (v != NULL && size != 0) {
 		nv = _PROP_MALLOC(size, M_PROP_DATA);



CVS commit: src/tests/lib/libprop

2020-06-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jun  8 21:31:17 UTC 2020

Modified Files:
src/tests/lib/libprop: t_proplib.c

Log Message:
Ensure copy_data_create_copy() is tolerant of creating empty data objects.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libprop/t_proplib.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/libprop/t_proplib.c
diff -u src/tests/lib/libprop/t_proplib.c:1.2 src/tests/lib/libprop/t_proplib.c:1.3
--- src/tests/lib/libprop/t_proplib.c:1.2	Sat Jun  6 21:45:07 2020
+++ src/tests/lib/libprop/t_proplib.c	Mon Jun  8 21:31:17 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: t_proplib.c,v 1.2 2020/06/06 21:45:07 thorpej Exp $ */
+/* $NetBSD: t_proplib.c,v 1.3 2020/06/08 21:31:17 thorpej Exp $ */
 
 /*
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008, 2020\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_proplib.c,v 1.2 2020/06/06 21:45:07 thorpej Exp $");
+__RCSID("$NetBSD: t_proplib.c,v 1.3 2020/06/08 21:31:17 thorpej Exp $");
 
 #include 
 #include 
@@ -224,6 +224,26 @@ ATF_TC_BODY(prop_data_basic, tc)
 	 * API contract.
 	 */
 
+	d1 = prop_data_create_copy(const_data1, 0);
+	ATF_REQUIRE(d1 != NULL);
+	ATF_REQUIRE(prop_data_value(d1) == NULL);
+	prop_object_release(d1);
+
+	d1 = prop_data_create_copy(NULL, sizeof(const_data1));
+	ATF_REQUIRE(d1 != NULL);
+	ATF_REQUIRE(prop_data_value(d1) == NULL);
+	prop_object_release(d1);
+
+	d1 = prop_data_create_nocopy(const_data1, 0);
+	ATF_REQUIRE(d1 != NULL);
+	ATF_REQUIRE(prop_data_value(d1) == NULL);
+	prop_object_release(d1);
+
+	d1 = prop_data_create_nocopy(NULL, sizeof(const_data1));
+	ATF_REQUIRE(d1 != NULL);
+	ATF_REQUIRE(prop_data_value(d1) == NULL);
+	prop_object_release(d1);
+
 	d1 = prop_data_create_nocopy(const_data1, sizeof(const_data1));
 	ATF_REQUIRE(d1 != NULL);
 	ATF_REQUIRE(prop_data_value(d1) == const_data1);



CVS commit: src/sys/dev/acpi

2020-06-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jun  8 20:21:56 UTC 2020

Modified Files:
src/sys/dev/acpi: acpi_i2c.c

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/acpi/acpi_i2c.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/acpi/acpi_i2c.c
diff -u src/sys/dev/acpi/acpi_i2c.c:1.5 src/sys/dev/acpi/acpi_i2c.c:1.6
--- src/sys/dev/acpi/acpi_i2c.c:1.5	Sat Sep 28 11:24:10 2019
+++ src/sys/dev/acpi/acpi_i2c.c	Mon Jun  8 20:21:56 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_i2c.c,v 1.5 2019/09/28 11:24:10 bouyer Exp $ */
+/* $NetBSD: acpi_i2c.c,v 1.6 2020/06/08 20:21:56 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_i2c.c,v 1.5 2019/09/28 11:24:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_i2c.c,v 1.6 2020/06/08 20:21:56 thorpej Exp $");
 
 #include 
 #include 
@@ -189,7 +189,7 @@ acpi_enter_i2c_device(struct acpi_devnod
 		name = ad->ad_name;
 	else
 		name = ad->ad_devinfo->HardwareId.String;
-	prop_dictionary_set_cstring(dev, "name", name);
+	prop_dictionary_set_string(dev, "name", name);
 	prop_dictionary_set_uint32(dev, "addr", i2cc.i2c_addr);
 	prop_dictionary_set_uint64(dev, "cookie", (uintptr_t)ad->ad_handle);
 	/* first search by name, then by CID */



CVS commit: src/sys/dev/bluetooth

2020-06-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jun  8 20:20:54 UTC 2020

Modified Files:
src/sys/dev/bluetooth: bthub.c

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/bluetooth/bthub.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/bluetooth/bthub.c
diff -u src/sys/dev/bluetooth/bthub.c:1.22 src/sys/dev/bluetooth/bthub.c:1.23
--- src/sys/dev/bluetooth/bthub.c:1.22	Sat May  9 22:23:40 2015
+++ src/sys/dev/bluetooth/bthub.c	Mon Jun  8 20:20:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bthub.c,v 1.22 2015/05/09 22:23:40 dholland Exp $	*/
+/*	$NetBSD: bthub.c,v 1.23 2020/06/08 20:20:54 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bthub.c,v 1.22 2015/05/09 22:23:40 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bthub.c,v 1.23 2020/06/08 20:20:54 thorpej Exp $");
 
 #include 
 #include 
@@ -110,7 +110,7 @@ bthub_attach(device_t parent, device_t s
 	prop_object_t obj;
 
 	dict = device_properties(self);
-	obj = prop_data_create_data(addr, sizeof(*addr));
+	obj = prop_data_create_copy(addr, sizeof(*addr));
 	prop_dictionary_set(dict, BTDEVladdr, obj);
 	prop_object_release(obj);
 



CVS commit: src/sys/kern

2020-06-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jun  8 20:19:50 UTC 2020

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

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/kern/kern_module.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/kern_module.c
diff -u src/sys/kern/kern_module.c:1.149 src/sys/kern/kern_module.c:1.150
--- src/sys/kern/kern_module.c:1.149	Sat Apr  4 19:50:54 2020
+++ src/sys/kern/kern_module.c	Mon Jun  8 20:19:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.149 2020/04/04 19:50:54 christos Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.150 2020/06/08 20:19:50 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.149 2020/04/04 19:50:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.150 2020/06/08 20:19:50 thorpej Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -1799,7 +1799,7 @@ module_merge_dicts(prop_dictionary_t exi
 
 	while ((props_obj = prop_object_iterator_next(props_iter)) != NULL) {
 		props_keysym = (prop_dictionary_keysym_t)props_obj;
-		props_key = prop_dictionary_keysym_cstring_nocopy(props_keysym);
+		props_key = prop_dictionary_keysym_value(props_keysym);
 		props_obj = prop_dictionary_get_keysym(new_dict, props_keysym);
 		if ((props_obj == NULL) || !prop_dictionary_set(existing_dict,
 		props_key, props_obj)) {



CVS commit: src/share/man/man4

2020-06-08 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jun  8 20:19:12 UTC 2020

Modified Files:
src/share/man/man4: aibs.4

Log Message:
Use Dx macro


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man4/aibs.4

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

Modified files:

Index: src/share/man/man4/aibs.4
diff -u src/share/man/man4/aibs.4:1.9 src/share/man/man4/aibs.4:1.10
--- src/share/man/man4/aibs.4:1.9	Tue Mar 18 18:20:39 2014
+++ src/share/man/man4/aibs.4	Mon Jun  8 20:19:12 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: aibs.4,v 1.9 2014/03/18 18:20:39 riastradh Exp $
+.\"	$NetBSD: aibs.4,v 1.10 2020/06/08 20:19:12 sevan Exp $
 .\"	$OpenBSD: aibs.4,v 1.4 2009/07/30 06:30:45 jmc Exp $
 .\"
 .\" Copyright (c) 2009 Constantine A. Murenin 
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd June 12, 2011
+.Dd June 8, 2020
 .Dt AIBS 4
 .Os
 .Sh NAME
@@ -194,7 +194,7 @@ The
 .Nm
 driver first appeared in
 .Ox 4.7 ,
-DragonFly 2.4.1
+.Dx 2.4.1
 and
 .Nx 6.0 .
 An earlier version of the driver, named
@@ -209,7 +209,8 @@ The
 .Nm
 driver was written for
 .Ox ,
-DragonFly BSD, and
+.Dx
+BSD, and
 .Nx
 by
 .An Constantine A. Murenin Aq Lk http://cnst.su/ ,



CVS commit: src/sys/dev/sysmon

2020-06-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jun  8 20:18:13 UTC 2020

Modified Files:
src/sys/dev/sysmon: swsensor.c sysmon_envsys.c sysmon_envsys_util.c
sysmon_power.c

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sysmon/swsensor.c
cvs rdiff -u -r1.145 -r1.146 src/sys/dev/sysmon/sysmon_envsys.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/sysmon/sysmon_envsys_util.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/sysmon/sysmon_power.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/sysmon/swsensor.c
diff -u src/sys/dev/sysmon/swsensor.c:1.16 src/sys/dev/sysmon/swsensor.c:1.17
--- src/sys/dev/sysmon/swsensor.c:1.16	Mon Mar 16 21:20:09 2020
+++ src/sys/dev/sysmon/swsensor.c	Mon Jun  8 20:18:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: swsensor.c,v 1.16 2020/03/16 21:20:09 pgoyette Exp $ */
+/*	$NetBSD: swsensor.c,v 1.17 2020/06/08 20:18:13 thorpej Exp $ */
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: swsensor.c,v 1.16 2020/03/16 21:20:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: swsensor.c,v 1.17 2020/06/08 20:18:13 thorpej Exp $");
 
 #include 
 #include 
@@ -212,7 +212,7 @@ swsensor_init(void *arg)
 			return ENOMEM;
 
 		while ((obj = prop_object_iterator_next(iter)) != NULL) {
-			key = prop_dictionary_keysym_cstring_nocopy(obj);
+			key = prop_dictionary_keysym_value(obj);
 			po  = prop_dictionary_get_keysym(pd, obj);
 			type = prop_object_type(po);
 			if (type == PROP_TYPE_NUMBER)

Index: src/sys/dev/sysmon/sysmon_envsys.c
diff -u src/sys/dev/sysmon/sysmon_envsys.c:1.145 src/sys/dev/sysmon/sysmon_envsys.c:1.146
--- src/sys/dev/sysmon/sysmon_envsys.c:1.145	Mon Jun  1 21:54:47 2020
+++ src/sys/dev/sysmon/sysmon_envsys.c	Mon Jun  8 20:18:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_envsys.c,v 1.145 2020/06/01 21:54:47 riastradh Exp $	*/
+/*	$NetBSD: sysmon_envsys.c,v 1.146 2020/06/08 20:18:13 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.145 2020/06/01 21:54:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.146 2020/06/08 20:18:13 thorpej Exp $");
 
 #include 
 #include 
@@ -267,7 +267,7 @@ sysmonioctl_envsys(dev_t dev, u_long cmd
 return EINVAL;
 			}
 			
-			devname = prop_dictionary_keysym_cstring_nocopy(obj);
+			devname = prop_dictionary_keysym_value(obj);
 			DPRINTF(("%s: processing the '%s' array requests\n",
 			__func__, devname));
 
@@ -950,9 +950,9 @@ sysmon_envsys_destroy_plist(prop_array_t
 		DPRINTFOBJ(("%s: iterating over dictionary\n", __func__));
 		while ((obj = prop_object_iterator_next(iter2)) != NULL) {
 			DPRINTFOBJ(("%s: obj=%s\n", __func__,
-			prop_dictionary_keysym_cstring_nocopy(obj)));
+			prop_dictionary_keysym_value(obj)));
 			prop_dictionary_remove(dict,
-			prop_dictionary_keysym_cstring_nocopy(obj));
+			prop_dictionary_keysym_value(obj));
 			prop_object_iterator_reset(iter2);
 		}
 		prop_object_iterator_release(iter2);
@@ -1848,7 +1848,7 @@ sme_userset_dictionary(struct sysmon_env
 		if (obj1 && prop_object_type(obj1) == PROP_TYPE_NUMBER) {
 			targetfound = true;
 			refresh_timo =
-			prop_number_unsigned_integer_value(obj1);
+			prop_number_unsigned_value(obj1);
 			if (refresh_timo < 1)
 error = EINVAL;
 			else {

Index: src/sys/dev/sysmon/sysmon_envsys_util.c
diff -u src/sys/dev/sysmon/sysmon_envsys_util.c:1.5 src/sys/dev/sysmon/sysmon_envsys_util.c:1.6
--- src/sys/dev/sysmon/sysmon_envsys_util.c:1.5	Fri Nov 16 08:00:16 2007
+++ src/sys/dev/sysmon/sysmon_envsys_util.c	Mon Jun  8 20:18:13 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_util.c,v 1.5 2007/11/16 08:00:16 xtraeme Exp $ */
+/* $NetBSD: sysmon_envsys_util.c,v 1.6 2020/06/08 20:18:13 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2007 Juan Romero Pardines.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_util.c,v 1.5 2007/11/16 08:00:16 xtraeme Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_util.c,v 1.6 2020/06/08 20:18:13 thorpej Exp $");
 
 #include 
 #include 
@@ -78,7 +78,7 @@ sme_sensor_upint32(prop_dictionary_t dic
 
 	obj = prop_dictionary_get(dict, key);
 	if (obj) {
-		if (!prop_number_equals_integer(obj, val)) {
+		if (!prop_number_equals_signed(obj, val)) {
 			if (!prop_dictionary_set_int32(dict, key, val)) {
 DPRINTF(("%s: (up) set_int32 %s:%d\n",
 __func__, key, val));
@@ -105,7 +105,7 @@ sme_sensor_upuint32(prop_dictionary_t di
 
 	obj = prop_dictionary_get(dict, key);
 	if (obj) {
-		if (!prop_number_equals_unsigned_integer(obj, val)) {
+		if (!prop_number_equals_unsigned(obj, val)) {
 			if (!prop_dictionary_set_uint32(dict, key, val)) {
 DPRINTF(("%s: (up) set_uint32 %s:%d\

CVS commit: src/sys/kern

2020-06-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jun  8 20:14:24 UTC 2020

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

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/kern/kern_veriexec.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/kern_veriexec.c
diff -u src/sys/kern/kern_veriexec.c:1.23 src/sys/kern/kern_veriexec.c:1.24
--- src/sys/kern/kern_veriexec.c:1.23	Fri Feb 21 00:26:22 2020
+++ src/sys/kern/kern_veriexec.c	Mon Jun  8 20:14:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_veriexec.c,v 1.23 2020/02/21 00:26:22 joerg Exp $	*/
+/*	$NetBSD: kern_veriexec.c,v 1.24 2020/06/08 20:14:24 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 Elad Efrat 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_veriexec.c,v 1.23 2020/02/21 00:26:22 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_veriexec.c,v 1.24 2020/06/08 20:14:24 thorpej Exp $");
 
 #include "opt_veriexec.h"
 
@@ -1213,11 +1213,11 @@ veriexec_file_convert(struct veriexec_fi
 {
 	if (vfe->filename)
 		prop_dictionary_set(rdict, "file",
-		prop_string_create_cstring(vfe->filename));
+		prop_string_create_copy(vfe->filename));
 	prop_dictionary_set_uint8(rdict, "entry-type", vfe->type);
 	prop_dictionary_set_uint8(rdict, "status", vfe->status);
 	prop_dictionary_set(rdict, "fp-type",
-	prop_string_create_cstring(vfe->ops->type));
+	prop_string_create_copy(vfe->ops->type));
 	prop_dictionary_set(rdict, "fp",
 	prop_data_create_data(vfe->fp, vfe->ops->hash_len));
 }



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

2020-06-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jun  8 19:50:11 UTC 2020

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

Log Message:
usr.bin/make: fix test failure

The two files include-sub.mk and include-subsub.mk were never intended to
be test cases on their own.  They belong to include-main.mk.

Fixes PR bin/55360.


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

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

Modified files:

Index: src/tests/usr.bin/make/t_make.sh
diff -u src/tests/usr.bin/make/t_make.sh:1.7 src/tests/usr.bin/make/t_make.sh:1.8
--- src/tests/usr.bin/make/t_make.sh:1.7	Tue Jan 27 12:57:14 2015
+++ src/tests/usr.bin/make/t_make.sh	Mon Jun  8 19:50:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_make.sh,v 1.7 2015/01/27 12:57:14 martin Exp $
+# $NetBSD: t_make.sh,v 1.8 2020/06/08 19:50:10 rillig Exp $
 #
 # Copyright (c) 2008, 2010, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -77,6 +77,12 @@ atf_init_test_cases()
 	for filename in "$(atf_get_srcdir)"/unit-tests/*.mk ; do
 	basename="${filename##*/}"
 	basename="${basename%.mk}"
+
+	# skip files that are not test cases on their own
+	case "${basename}" in
+	include-sub*) continue;;
+	esac
+
 	atfname="$(echo "${basename}" | tr "x-" "x_")"
 	descr='' # XXX
 test_case "${atfname}" "${basename}" "${descr}"



CVS commit: src/share/man/man3

2020-06-08 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jun  8 17:28:10 UTC 2020

Modified Files:
src/share/man/man3: bits.3 types.3

Log Message:
Pp before Bl


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man3/bits.3
cvs rdiff -u -r1.6 -r1.7 src/share/man/man3/types.3

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

Modified files:

Index: src/share/man/man3/bits.3
diff -u src/share/man/man3/bits.3:1.18 src/share/man/man3/bits.3:1.19
--- src/share/man/man3/bits.3:1.18	Mon Jul  3 21:30:58 2017
+++ src/share/man/man3/bits.3	Mon Jun  8 17:28:10 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bits.3,v 1.18 2017/07/03 21:30:58 wiz Exp $
+.\"	$NetBSD: bits.3,v 1.19 2020/06/08 17:28:10 sevan Exp $
 .\"
 .\" Copyright (c) 2006, 2010 David Young.  All rights reserved.
 .\"
@@ -58,7 +58,6 @@ Use
 and
 .Fn __BITS
 to define bitmasks:
-.Pp
 .Bl -tag -width __BITS -offset indent
 .It Fn __BIT "n"
 Return a bitmask with bit
@@ -82,7 +81,6 @@ The least significant bit is bit 0.
 and
 .Fn __SHIFTOUT_MASK
 help read and write bitfields from words:
-.Pp
 .Bl -tag -width __SHIFTOUT_MASK -offset indent
 .It Fn __SHIFTIN "v" "mask"
 Left-shift bits

Index: src/share/man/man3/types.3
diff -u src/share/man/man3/types.3:1.6 src/share/man/man3/types.3:1.7
--- src/share/man/man3/types.3:1.6	Sun Apr 10 10:02:34 2011
+++ src/share/man/man3/types.3	Mon Jun  8 17:28:10 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: types.3,v 1.6 2011/04/10 10:02:34 jruoho Exp $
+.\"	$NetBSD: types.3,v 1.7 2020/06/08 17:28:10 sevan Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -79,7 +79,6 @@ and provides additional types as well as
 .Xr param 3 ) .
 .Ss Standard Types
 The following standards-compliant system data types are defined:
-.Pp
 .Bl -column -offset indent \
 "suseconds_t " "process and process group IDs " "clock_settime(3) "
 .It Sy Type Ta Sy Typical use Ta Sy Example



CVS commit: src/share/man/man2

2020-06-08 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jun  8 17:19:44 UTC 2020

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
white space


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/share/man/man2/siginfo.2

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

Modified files:

Index: src/share/man/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.23 src/share/man/man2/siginfo.2:1.24
--- src/share/man/man2/siginfo.2:1.23	Sat May 25 05:11:14 2019
+++ src/share/man/man2/siginfo.2	Mon Jun  8 17:19:44 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.23 2019/05/25 05:11:14 kamil Exp $
+.\"	$NetBSD: siginfo.2,v 1.24 2020/06/08 17:19:44 sevan Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -278,7 +278,7 @@ High priority input available
 .Pp
 For
 .Dv SIGILL ,
-.Dv SIGFPE , 
+.Dv SIGFPE ,
 .Dv SIGBUS
 and
 .Dv SIGSEGV



CVS commit: src

2020-06-08 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun  8 16:36:18 UTC 2020

Modified Files:
src/distrib/sets/lists/comp: mi
src/sys/sys: Makefile

Log Message:
install fault.h


To generate a diff of this commit:
cvs rdiff -u -r1.2333 -r1.2334 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.174 -r1.175 src/sys/sys/Makefile

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2333 src/distrib/sets/lists/comp/mi:1.2334
--- src/distrib/sets/lists/comp/mi:1.2333	Sun Jun  7 14:55:13 2020
+++ src/distrib/sets/lists/comp/mi	Mon Jun  8 16:36:18 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2333 2020/06/07 14:55:13 thorpej Exp $
+#	$NetBSD: mi,v 1.2334 2020/06/08 16:36:18 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3048,6 +3048,7 @@
 ./usr/include/sys/exec_script.h			comp-c-include
 ./usr/include/sys/extattr.h			comp-c-include
 ./usr/include/sys/extent.h			comp-c-include
+./usr/include/sys/fault.h			comp-c-include
 ./usr/include/sys/fcntl.h			comp-c-include
 ./usr/include/sys/fd_set.h			comp-c-include
 ./usr/include/sys/fdio.h			comp-c-include

Index: src/sys/sys/Makefile
diff -u src/sys/sys/Makefile:1.174 src/sys/sys/Makefile:1.175
--- src/sys/sys/Makefile:1.174	Sat May 16 18:31:53 2020
+++ src/sys/sys/Makefile	Mon Jun  8 16:36:18 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.174 2020/05/16 18:31:53 christos Exp $
+#	$NetBSD: Makefile,v 1.175 2020/06/08 16:36:18 maxv Exp $
 
 .include 
 
@@ -20,6 +20,7 @@ INCS=	acct.h acl.h agpio.h aio.h ansi.h 
 	dkbad.h dkio.h dkstat.h domain.h drvctlio.h dvdio.h \
 	endian.h envsys.h errno.h evcnt.h event.h exec.h exec_aout.h \
 	exec_coff.h exec_ecoff.h exec_elf.h exec_script.h extattr.h extent.h \
+	fault.h \
 	fcntl.h fd_set.h fdio.h featuretest.h file.h filedesc.h filio.h \
 	flashio.h float_ieee754.h fstypes.h futex.h gcq.h gmon.h gpio.h hash.h \
 	idtype.h ieee754.h intr.h intrio.h inttypes.h ioccom.h ioctl.h \



CVS commit: xsrc/local/programs/ttf2wsfont

2020-06-08 Thread Rin Okuyama
Module Name:xsrc
Committed By:   rin
Date:   Mon Jun  8 15:01:59 UTC 2020

Modified Files:
xsrc/local/programs/ttf2wsfont: main.c

Log Message:
Fix minor problems detected by GCC9 -Wstringop-truncation.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/local/programs/ttf2wsfont/main.c

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

Modified files:

Index: xsrc/local/programs/ttf2wsfont/main.c
diff -u xsrc/local/programs/ttf2wsfont/main.c:1.3 xsrc/local/programs/ttf2wsfont/main.c:1.4
--- xsrc/local/programs/ttf2wsfont/main.c:1.3	Fri Jun 23 02:15:07 2017
+++ xsrc/local/programs/ttf2wsfont/main.c	Mon Jun  8 15:01:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.3 2017/06/23 02:15:07 macallan Exp $	*/
+/*	$NetBSD: main.c,v 1.4 2020/06/08 15:01:59 rin Exp $	*/
 
 /*
  * Copyright (c) 2011 Michael Lorenz
@@ -76,7 +76,7 @@ main(int argc, char *argv[])
 	int width, datalen, didx, i, start, end, out;
 	FILE *output;
 	uint8_t *fontdata;
-	char fontname[128], filename[128];
+	char fontname[128], filename[sizeof(fontname) + 4 /* .wsf */];
 
 	if (argc != 3) {
 		printf("usage: ttf2wsfont some_font.ttf height\n");
@@ -141,12 +141,13 @@ main(int argc, char *argv[])
 	}
 
 	/* now output as a header file */
-	snprintf(fontname, 128, "%s_%dx%d", face->family_name, width, cell_height);
+	snprintf(fontname, sizeof(fontname), "%s_%dx%d", face->family_name,
+	width, cell_height);
 	for (i = 0; i < strlen(fontname); i++) {
 		if (isblank((int)fontname[i]))
 			fontname[i]='_';
 	}
-	snprintf(filename, 128, "%s.h", fontname);
+	snprintf(filename, sizeof(filename), "%s.h", fontname);
 	if ((output = fopen(filename, "w")) == NULL) {
 		fprintf(stderr, "Can't open output file %s\n", filename);
 		return -1;
@@ -185,14 +186,14 @@ main(int argc, char *argv[])
 	fprintf(output, "};\n");
 	fclose(output);
 	/* dump as binary */
-	snprintf(filename, 128, "%s.wsf", fontname);	
+	snprintf(filename, sizeof(filename), "%s.wsf", fontname);	
 	if ((out = open(filename, O_RDWR | O_CREAT | O_TRUNC, DEFFILEMODE)) > 0) {
 		char nbuf[64];
 		uint32_t foo;
 		write(out, "WSFT", 4);
-		memset(nbuf, 0, 64);
-		strncpy(nbuf, face->family_name, 64);
-		write(out, nbuf, 64);
+		memset(nbuf, 0, sizeof(nbuf));
+		strlcpy(nbuf, face->family_name, sizeof(nbuf));
+		write(out, nbuf, sizeof(nbuf));
 		/* firstchar */
 		foo = htole32(32);
 		write(out, &foo, 4);



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

2020-06-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jun  8 11:51:48 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: GENERIC

Log Message:
Add smscphy(4)


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/evbarm/conf/GENERIC

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/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.78 src/sys/arch/evbarm/conf/GENERIC:1.79
--- src/sys/arch/evbarm/conf/GENERIC:1.78	Wed May 20 09:18:25 2020
+++ src/sys/arch/evbarm/conf/GENERIC	Mon Jun  8 11:51:48 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.78 2020/05/20 09:18:25 hkenken Exp $
+#	$NetBSD: GENERIC,v 1.79 2020/06/08 11:51:48 jmcneill Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -290,6 +290,7 @@ qsphy* 		at mii? phy ?		# Quality Semico
 rdcphy* 	at mii? phy ?		# RDC R6040 10/100 PHY
 rgephy* 	at mii? phy ?		# Realtek 8169S/8110S internal PHYs
 rlphy* 		at mii? phy ?		# Realtek 8139/8201L PHYs
+smscphy*	at mii? phy ?		# SMSC LAN87xx PHYs
 sqphy* 		at mii? phy ?		# Seeq 80220/80221/80223 PHYs
 tlphy* 		at mii? phy ?		# ThunderLAN PHYs
 tqphy* 		at mii? phy ?		# TDK Semiconductor PHYs



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

2020-06-08 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Jun  8 07:48:58 UTC 2020

Modified Files:
src/sys/arch/arm/imx: imx6_ccm.c

Log Message:
Fix wrong divider setting.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/imx/imx6_ccm.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/imx/imx6_ccm.c
diff -u src/sys/arch/arm/imx/imx6_ccm.c:1.17 src/sys/arch/arm/imx/imx6_ccm.c:1.18
--- src/sys/arch/arm/imx/imx6_ccm.c:1.17	Fri Jun  5 02:30:54 2020
+++ src/sys/arch/arm/imx/imx6_ccm.c	Mon Jun  8 07:48:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ccm.c,v 1.17 2020/06/05 02:30:54 hkenken Exp $	*/
+/*	$NetBSD: imx6_ccm.c,v 1.18 2020/06/08 07:48:57 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2010-2012, 2014  Genetec Corporation.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.17 2020/06/05 02:30:54 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.18 2020/06/08 07:48:57 hkenken Exp $");
 
 #include "opt_cputypes.h"
 
@@ -1295,7 +1295,7 @@ imxccm_clk_set_rate_div(struct imxccm_so
 	KASSERT(parent != NULL);
 
 	u_int rate_parent = imxccm_clk_get_rate(sc, &parent->base);
-	u_int divider = rate_parent / rate;
+	u_int divider = uimax(1, rate_parent / rate);
 
 	bus_space_handle_t ioh;
 	if (div->base == IMX6_CLK_REG_CCM_ANALOG)