CVS commit: src/sys
Module Name:src Committed By: simonb Date: Thu Nov 12 07:44:01 UTC 2020 Modified Files: src/sys/conf: param.c src/sys/kern: init_main.c src/sys/sys: param.h Log Message: Set a better default for MAXFILES on larger RAM machines if not otherwise specified the kernel config file. Arbitary numbers are 20,000 files for 16GB RAM or more and 10,000 files for 1GB RAM or more. TODO: Adjust this and other values totally dynamically. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/conf/param.c cvs rdiff -u -r1.532 -r1.533 src/sys/kern/init_main.c cvs rdiff -u -r1.678 -r1.679 src/sys/sys/param.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/conf/param.c diff -u src/sys/conf/param.c:1.68 src/sys/conf/param.c:1.69 --- src/sys/conf/param.c:1.68 Tue Apr 9 22:05:27 2019 +++ src/sys/conf/param.c Thu Nov 12 07:44:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: param.c,v 1.68 2019/04/09 22:05:27 pgoyette Exp $ */ +/* $NetBSD: param.c,v 1.69 2020/11/12 07:44:01 simonb Exp $ */ /* * Copyright (c) 1980, 1986, 1989 Regents of the University of California. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: param.c,v 1.68 2019/04/09 22:05:27 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: param.c,v 1.69 2020/11/12 07:44:01 simonb Exp $"); #ifdef _KERNEL_OPT #include "opt_hz.h" @@ -105,10 +105,6 @@ __KERNEL_RCSID(0, "$NetBSD: param.c,v 1. #define HZ 100 #endif -#ifndef MAXFILES -#define MAXFILES (3 * (NPROC + MAXUSERS) + 80) -#endif - #ifndef MAXEXEC #define MAXEXEC 16 #endif Index: src/sys/kern/init_main.c diff -u src/sys/kern/init_main.c:1.532 src/sys/kern/init_main.c:1.533 --- src/sys/kern/init_main.c:1.532 Wed Nov 4 01:30:19 2020 +++ src/sys/kern/init_main.c Thu Nov 12 07:44:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.532 2020/11/04 01:30:19 chs Exp $ */ +/* $NetBSD: init_main.c,v 1.533 2020/11/12 07:44:01 simonb Exp $ */ /*- * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.532 2020/11/04 01:30:19 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.533 2020/11/12 07:44:01 simonb Exp $"); #include "opt_cnmagic.h" #include "opt_ddb.h" @@ -485,7 +485,22 @@ main(void) 10, VNODE_KMEM_MAXPCT) / VNODE_COST; if (usevnodes > desiredvnodes) desiredvnodes = usevnodes; -#endif +#endif /* NVNODE_IMPLICIT */ +#ifdef MAXFILES_IMPLICIT + /* + * If maximum number of files is not explicitly defined in + * kernel config, adjust the number so that it is somewhat + * more reasonable on machines with larger memory sizes. + * Arbitary numbers are 20,000 files for 16GB RAM or more + * and 10,000 files for 1GB RAM or more. + * + * XXXtodo: adjust this and other values totally dynamically + */ + if (ctob((uint64_t)physmem) >= 16ULL * 1024 * 1024 * 1024) + maxfiles = MAX(maxfiles, 2); + if (ctob((uint64_t)physmem) >= 1024 * 1024 * 1024) + maxfiles = MAX(maxfiles, 1); +#endif /* MAXFILES_IMPLICIT */ /* Initialize fstrans. */ fstrans_init(); Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.678 src/sys/sys/param.h:1.679 --- src/sys/sys/param.h:1.678 Sun Nov 1 18:51:03 2020 +++ src/sys/sys/param.h Thu Nov 12 07:44:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.678 2020/11/01 18:51:03 pgoyette Exp $ */ +/* $NetBSD: param.h,v 1.679 2020/11/12 07:44:01 simonb Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -148,13 +148,17 @@ #include #include #ifndef NPROC -#define NPROC (20 + 16 * MAXUSERS) +#define NPROC (20 + 16 * MAXUSERS) +#endif +#ifndef MAXFILES +#define MAXFILES (3 * (NPROC + MAXUSERS) + 80) +#define MAXFILES_IMPLICIT #endif #ifndef NTEXT -#define NTEXT (80 + NPROC / 8) /* actually the object cache */ +#define NTEXT (80 + NPROC / 8) /* actually the object cache */ #endif #ifndef NVNODE -#define NVNODE (NPROC + NTEXT + 100) +#define NVNODE (NPROC + NTEXT + 100) #define NVNODE_IMPLICIT #endif #ifndef VNODE_KMEM_MAXPCT @@ -163,7 +167,7 @@ #ifndef BUFCACHE_VA_MAXPCT #define BUFCACHE_VA_MAXPCT 20 #endif -#define VNODE_COST 2048 /* assumed space in bytes */ +#define VNODE_COST 2048 /* assumed space in bytes */ #endif /* _KERNEL */ /* Signals. */
CVS commit: src/external/cddl/osnet/dev/dtrace/aarch64
Module Name:src Committed By: rin Date: Thu Nov 12 02:15:56 UTC 2020 Modified Files: src/external/cddl/osnet/dev/dtrace/aarch64: dtrace_subr.c Log Message: One more catch up with ``aarch64 is not mips'' change. Fix evbarm-aarch64 build. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dev/dtrace/aarch64/dtrace_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/external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c diff -u src/external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c:1.3 src/external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c:1.4 --- src/external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c:1.3 Wed Feb 12 06:05:23 2020 +++ src/external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c Thu Nov 12 02:15:56 2020 @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dtrace_subr.c,v 1.3 2020/02/12 06:05:23 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dtrace_subr.c,v 1.4 2020/11/12 02:15:56 rin Exp $"); #include #include @@ -128,7 +128,7 @@ void dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) { - (*func)(0, (uintptr_t)AARCH64_KSEG_START); + (*func)(0, (uintptr_t)AARCH64_DIRECTMAP_START); (*func)((uintptr_t)VM_KERNEL_IO_ADDRESS, ~(uintptr_t)0); }
CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: rin Date: Thu Nov 12 01:03:22 UTC 2020 Modified Files: src/sys/arch/arm/arm: cpu_exec.c Log Message: If neither COMPAT_NETBSD32 nor MODULAR is defined, there's no chance for lwp to be running under COMPAT_NETBSD32. Suggested by mrg. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/arm/cpu_exec.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/arm/cpu_exec.c diff -u src/sys/arch/arm/arm/cpu_exec.c:1.11 src/sys/arch/arm/arm/cpu_exec.c:1.12 --- src/sys/arch/arm/arm/cpu_exec.c:1.11 Tue Nov 10 21:40:07 2020 +++ src/sys/arch/arm/arm/cpu_exec.c Thu Nov 12 01:03:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_exec.c,v 1.11 2020/11/10 21:40:07 rin Exp $ */ +/* $NetBSD: cpu_exec.c,v 1.12 2020/11/12 01:03:22 rin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.11 2020/11/10 21:40:07 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.12 2020/11/12 01:03:22 rin Exp $"); #include "opt_compat_netbsd.h" @@ -55,7 +55,11 @@ arm_netbsd_elf32_probe(struct lwp *l, st const Elf_Ehdr * const eh = eh0; const bool elf_aapcs_p = (eh->e_flags & EF_ARM_EABIMASK) >= EF_ARM_EABI_VER4; +#if defined(COMPAT_NETBSD32) || defined(MODULAR) const bool netbsd32_p = (epp->ep_esch->es_emul != _netbsd); +#else + const bool netbsd32_p = false; +#endif #ifdef __ARM_EABI__ const bool aapcs_p = true; #else
CVS commit: src/sys/arch/powerpc/booke/pci
Module Name:src Committed By: rin Date: Thu Nov 12 00:44:22 UTC 2020 Modified Files: src/sys/arch/powerpc/booke/pci: pq3pci.c Log Message: pq3pci_msi_claim(): remove KASSERT that is valid when allocating MSI vectors, while apparently invalid when freeing them. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci/pq3pci.c diff -u src/sys/arch/powerpc/booke/pci/pq3pci.c:1.26 src/sys/arch/powerpc/booke/pci/pq3pci.c:1.27 --- src/sys/arch/powerpc/booke/pci/pq3pci.c:1.26 Thu Nov 12 00:37:51 2020 +++ src/sys/arch/powerpc/booke/pci/pq3pci.c Thu Nov 12 00:44:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pq3pci.c,v 1.26 2020/11/12 00:37:51 rin Exp $ */ +/* $NetBSD: pq3pci.c,v 1.27 2020/11/12 00:44:22 rin Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -39,7 +39,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.26 2020/11/12 00:37:51 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.27 2020/11/12 00:44:22 rin Exp $"); #include "locators.h" @@ -1196,7 +1196,6 @@ pq3pci_msi_claim(pci_intr_handle_t handl KASSERT(msig != NULL); struct pq3pci_msihand * const msih = >msig_ihands[irq & 31]; mutex_spin_enter(>msig_lock); - KASSERT(msig->msig_free_mask & irq_mask); msig->msig_free_mask ^= irq_mask; mutex_spin_exit(>msig_lock); return msih;
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Thu Nov 12 00:40:55 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: varmod-defined.mk varmod-loop.exp varmod-loop.mk Log Message: make(1): fix tests varmod-defined and varmod-loop regarding dollars Some derived versions of NetBSD's make set .MAKE.SAVE_DOLLARS to no. In these versions, running the tests would fail. Therefore better set .MAKE.SAVE_DOLLARS to yes explicitly as far as necessary. Suggested by sjg. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varmod-defined.mk cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varmod-loop.exp cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmod-loop.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/varmod-defined.mk diff -u src/usr.bin/make/unit-tests/varmod-defined.mk:1.8 src/usr.bin/make/unit-tests/varmod-defined.mk:1.9 --- src/usr.bin/make/unit-tests/varmod-defined.mk:1.8 Sun Nov 8 20:29:13 2020 +++ src/usr.bin/make/unit-tests/varmod-defined.mk Thu Nov 12 00:40:55 2020 @@ -1,8 +1,10 @@ -# $NetBSD: varmod-defined.mk,v 1.8 2020/11/08 20:29:13 rillig Exp $ +# $NetBSD: varmod-defined.mk,v 1.9 2020/11/12 00:40:55 rillig Exp $ # # Tests for the :D variable modifier, which returns the given string # if the variable is defined. It is closely related to the :U modifier. +.MAKE.SAVE_DOLLARS= yes + DEF= defined .undef UNDEF Index: src/usr.bin/make/unit-tests/varmod-loop.exp diff -u src/usr.bin/make/unit-tests/varmod-loop.exp:1.4 src/usr.bin/make/unit-tests/varmod-loop.exp:1.5 --- src/usr.bin/make/unit-tests/varmod-loop.exp:1.4 Sun Nov 8 18:05:32 2020 +++ src/usr.bin/make/unit-tests/varmod-loop.exp Thu Nov 12 00:40:55 2020 @@ -1,10 +1,10 @@ -ParseReadLine (115): 'USE_8_DOLLARS= ${:U1:@var@${8_DOLLARS}@} ${8_DOLLARS} ' +ParseReadLine (117): 'USE_8_DOLLARS= ${:U1:@var@${8_DOLLARS}@} ${8_DOLLARS} ' CondParser_Eval: ${USE_8_DOLLARS} != "\$\$\$\$ \$\$\$\$ \$\$\$\$" lhs = " ", rhs = " ", op = != -ParseReadLine (120): 'SUBST_CONTAINING_LOOP:= ${USE_8_DOLLARS}' +ParseReadLine (122): 'SUBST_CONTAINING_LOOP:= ${USE_8_DOLLARS}' CondParser_Eval: ${SUBST_CONTAINING_LOOP} != "\$\$ \$\$\$\$ \$\$\$\$" lhs = "$$ ", rhs = "$$ ", op = != -ParseReadLine (145): '.MAKEFLAGS: -d0' +ParseReadLine (147): '.MAKEFLAGS: -d0' ParseDoDependency(.MAKEFLAGS: -d0) :+one+ +two+ +three+: :x1y x2y x3y: Index: src/usr.bin/make/unit-tests/varmod-loop.mk diff -u src/usr.bin/make/unit-tests/varmod-loop.mk:1.7 src/usr.bin/make/unit-tests/varmod-loop.mk:1.8 --- src/usr.bin/make/unit-tests/varmod-loop.mk:1.7 Sun Nov 8 18:05:32 2020 +++ src/usr.bin/make/unit-tests/varmod-loop.mk Thu Nov 12 00:40:55 2020 @@ -1,7 +1,9 @@ -# $NetBSD: varmod-loop.mk,v 1.7 2020/11/08 18:05:32 rillig Exp $ +# $NetBSD: varmod-loop.mk,v 1.8 2020/11/12 00:40:55 rillig Exp $ # # Tests for the :@var@...${var}...@ variable modifier. +.MAKE.SAVE_DOLLARS= yes + all: mod-loop-varname all: mod-loop-resolve all: mod-loop-varname-dollar
CVS commit: src/sys/arch/powerpc/booke/pci
Module Name:src Committed By: rin Date: Thu Nov 12 00:37:51 UTC 2020 Modified Files: src/sys/arch/powerpc/booke/pci: pq3pci.c Log Message: Oops, forget to commit local change necessary to support nvme(4) on RB800; provide pci_intr_setattr(9) (no-op). To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci/pq3pci.c diff -u src/sys/arch/powerpc/booke/pci/pq3pci.c:1.25 src/sys/arch/powerpc/booke/pci/pq3pci.c:1.26 --- src/sys/arch/powerpc/booke/pci/pq3pci.c:1.25 Tue Jul 7 03:38:48 2020 +++ src/sys/arch/powerpc/booke/pci/pq3pci.c Thu Nov 12 00:37:51 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pq3pci.c,v 1.25 2020/07/07 03:38:48 thorpej Exp $ */ +/* $NetBSD: pq3pci.c,v 1.26 2020/11/12 00:37:51 rin Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -39,7 +39,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.25 2020/07/07 03:38:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.26 2020/11/12 00:37:51 rin Exp $"); #include "locators.h" @@ -1753,6 +1753,7 @@ pq3pci_pci_chipset_init(struct pq3pci_so pc->pc_intr_type = pq3pci_intr_type; pc->pc_intr_alloc = pq3pci_intr_alloc; pc->pc_intr_release = pq3pci_intr_release; + pc->pc_intr_setattr = genppc_pci_intr_setattr; pc->pc_intx_alloc = genppc_pci_intx_alloc; pc->pc_msi_v = sc;
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Thu Nov 12 00:29:55 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: varmod-ifelse.exp varmod-ifelse.mk Log Message: make(1): add test for unhandled parse error in :? variable modifier To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-ifelse.exp cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod-ifelse.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/varmod-ifelse.exp diff -u src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.3 src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.4 --- src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.3 Fri Oct 23 14:38:39 2020 +++ src/usr.bin/make/unit-tests/varmod-ifelse.exp Thu Nov 12 00:29:55 2020 @@ -3,6 +3,14 @@ make: "varmod-ifelse.mk" line 27: Malfor make: Bad conditional expression ` == ""' in == ""?bad-assign:bad-assign make: Bad conditional expression ` == ""' in == ""?bad-cond:bad-cond make: "varmod-ifelse.mk" line 44: Malformed conditional (${${UNDEF} == "":?bad-cond:bad-cond}) +make: Bad conditional expression `1 == == 2' in 1 == == 2?yes:no +make: "varmod-ifelse.mk" line 66: Malformed conditional (${1 == == 2:?yes:no} != "") +CondParser_Eval: "${1 == == 2:?yes:no}" != "" +CondParser_Eval: 1 == == 2 +lhs = 1.00, rhs = 0.00, op = == +make: Bad conditional expression `1 == == 2' in 1 == == 2?yes:no +lhs = "", rhs = "", op = != +make: "varmod-ifelse.mk" line 92: warning: Oops, the parse error should have been propagated. make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 Index: src/usr.bin/make/unit-tests/varmod-ifelse.mk diff -u src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.5 src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.6 --- src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.5 Fri Oct 23 14:24:51 2020 +++ src/usr.bin/make/unit-tests/varmod-ifelse.mk Thu Nov 12 00:29:55 2020 @@ -1,4 +1,4 @@ -# $NetBSD: varmod-ifelse.mk,v 1.5 2020/10/23 14:24:51 rillig Exp $ +# $NetBSD: varmod-ifelse.mk,v 1.6 2020/11/12 00:29:55 rillig Exp $ # # Tests for the ${cond:?then:else} variable modifier, which evaluates either # the then-expression or the else-expression, depending on the condition. @@ -57,5 +57,41 @@ COND:= ${${UNDEF} == "":?bad-assign:bad- . error .endif +# This line generates 2 error messages. The first comes from evaluating the +# malformed conditional "1 == == 2", which is reported as "Bad conditional +# expression" by ApplyModifier_IfElse. The variable expression containing that +# conditional therefore returns a parse error from Var_Parse, and this parse +# error propagates to CondEvalExpression, where the "Malformed conditional" +# comes from. +.if ${1 == == 2:?yes:no} != "" +. error +.else +. error +.endif + +# If the "Bad conditional expression" appears in a quoted string literal, the +# error message "Malformed conditional" is not printed, leaving only the "Bad +# conditional expression". +# +# XXX: The left-hand side is enclosed in quotes. This results in Var_Parse +# being called without VARE_UNDEFERR being set. When ApplyModifier_IfElse +# returns AMR_CLEANUP as result, Var_Parse returns varUndefined since the +# value of the variable expression is still undefined. CondParser_String is +# then supposed to do proper error handling, but since varUndefined is local +# to var.c, it cannot distinguish this return value from an ordinary empty +# string. The left-hand side of the comparison is therefore just an empty +# string, which is obviously equal to the empty string on the right-hand side. +# +# XXX: The debug log for -dc shows a comparison between 1.0 and 0.0. The +# condition should be detected as being malformed before any comparison is +# done since there is no well-formed comparison in the condition at all. +.MAKEFLAGS: -dc +.if "${1 == == 2:?yes:no}" != "" +. error +.else +. warning Oops, the parse error should have been propagated. +.endif +.MAKEFLAGS: -d0 + all: @:;
CVS commit: src/games/warp
Module Name:src Committed By: christos Date: Wed Nov 11 20:04:02 UTC 2020 Modified Files: src/games/warp: Makefile Log Message: Comment out debugging build (it still randomly crashes though) pointed out by wiz To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/games/warp/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/warp/Makefile diff -u src/games/warp/Makefile:1.4 src/games/warp/Makefile:1.5 --- src/games/warp/Makefile:1.4 Wed Nov 11 14:54:53 2020 +++ src/games/warp/Makefile Wed Nov 11 15:04:02 2020 @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.4 2020/11/11 19:54:53 christos Exp $ +# $NetBSD: Makefile,v 1.5 2020/11/11 20:04:02 christos Exp $ .include PROG= warp -DBG=-g +#DBG=-g SRCS= bang.c init.c intrp.c move.c object.c play.c score.c sig.c term.c \ them.c us.c util.c version.c warp.c weapon.c
CVS commit: src/distrib/sets/lists/base
Module Name:src Committed By: christos Date: Wed Nov 11 19:56:59 UTC 2020 Modified Files: src/distrib/sets/lists/base: mi Log Message: Add /var/games/warp To generate a diff of this commit: cvs rdiff -u -r1.1270 -r1.1271 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.1270 src/distrib/sets/lists/base/mi:1.1271 --- src/distrib/sets/lists/base/mi:1.1270 Tue Nov 10 16:47:40 2020 +++ src/distrib/sets/lists/base/mi Wed Nov 11 14:56:59 2020 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1270 2020/11/10 21:47:40 kamil Exp $ +# $NetBSD: mi,v 1.1271 2020/11/11 19:56:59 christos Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -6146,6 +6146,7 @@ ./var/games/larnbase-games-root ./var/games/phantasiabase-games-root ./var/games/sailbase-games-root +./var/games/warpbase-games-root ./var/games/savebase-obsolete obsolete ./var/heimdal base-krb5-root ./var/lock base-obsolete obsolete
CVS commit: src/etc/mtree
Module Name:src Committed By: christos Date: Wed Nov 11 19:56:09 UTC 2020 Modified Files: src/etc/mtree: NetBSD.dist.base Log Message: Add /var/games/warp To generate a diff of this commit: cvs rdiff -u -r1.228 -r1.229 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.228 src/etc/mtree/NetBSD.dist.base:1.229 --- src/etc/mtree/NetBSD.dist.base:1.228 Tue Nov 10 16:47:49 2020 +++ src/etc/mtree/NetBSD.dist.base Wed Nov 11 14:56:09 2020 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.228 2020/11/10 21:47:49 kamil Exp $ +# $NetBSD: NetBSD.dist.base,v 1.229 2020/11/11 19:56:09 christos Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -1338,6 +1338,7 @@ ./var/games/larn uname=games gname=games mode=0775 ./var/games/phantasia uname=games gname=games mode=0775 ./var/games/sail uname=games gname=games mode=0775 +./var/games/warp uname=games gname=games mode=0775 ./var/heimdal ./var/log ./var/log/rdist
CVS commit: src/games/warp
Module Name:src Committed By: christos Date: Wed Nov 11 19:55:33 UTC 2020 Modified Files: src/games/warp: config.h config.h.SH config.sh init.c intrp.c score.c score.h sig.c term.c util.h warp.c Log Message: use strchr, strrchr, random, more lint removal, savefile in /var/games/warp not /usr/share/games/warp... To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/games/warp/config.h src/games/warp/sig.c \ src/games/warp/util.h cvs rdiff -u -r1.2 -r1.3 src/games/warp/config.h.SH cvs rdiff -u -r1.1 -r1.2 src/games/warp/config.sh cvs rdiff -u -r1.3 -r1.4 src/games/warp/init.c src/games/warp/score.h cvs rdiff -u -r1.5 -r1.6 src/games/warp/intrp.c src/games/warp/score.c cvs rdiff -u -r1.6 -r1.7 src/games/warp/term.c src/games/warp/warp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/warp/config.h diff -u src/games/warp/config.h:1.4 src/games/warp/config.h:1.5 --- src/games/warp/config.h:1.4 Wed Nov 11 12:11:19 2020 +++ src/games/warp/config.h Wed Nov 11 14:55:33 2020 @@ -85,12 +85,6 @@ */ #define PREFSHELL "/bin/csh" /**/ -/* RANDBITS: - * This symbol contains the number of bits of random number the rand() - * function produces. Usual values are 15, 16, and 31. - */ -#define RANDBITS 15 /**/ - /* ROOTID: * This symbol contains the uid of root, normally 0. */ Index: src/games/warp/sig.c diff -u src/games/warp/sig.c:1.4 src/games/warp/sig.c:1.5 --- src/games/warp/sig.c:1.4 Tue Nov 10 17:42:19 2020 +++ src/games/warp/sig.c Wed Nov 11 14:55:33 2020 @@ -25,9 +25,6 @@ void sig_init(void) { -#ifdef lint -; -#else sigignore(SIGINT); /* for inquiry of existence via kill call */ #ifdef SIGTTOU sigignore(SIGTTOU); @@ -38,8 +35,10 @@ sig_init(void) sigset(SIGQUIT, sig_catcher); sigset(SIGILL, sig_catcher); sigset(SIGFPE, sig_catcher); +#if 0 sigset(SIGBUS, sig_catcher); sigset(SIGSEGV, sig_catcher); +#endif sigset(SIGSYS, sig_catcher); sigset(SIGTERM, sig_catcher); } @@ -53,7 +52,6 @@ sig_init(void) sigset(SIGTSTP, stop_catcher); sigset(SIGSTOP, stop_catcher); #endif -#endif /* lint */ } #ifdef SIGTSTP Index: src/games/warp/util.h diff -u src/games/warp/util.h:1.4 src/games/warp/util.h:1.5 --- src/games/warp/util.h:1.4 Tue Nov 10 17:42:19 2020 +++ src/games/warp/util.h Wed Nov 11 14:55:33 2020 @@ -6,49 +6,19 @@ * */ -#if RANDBITS < 15 || defined(lint) -#define rand_mod(m) getpid() -#define RANDRAND 0.0 -#define HALFRAND 0 -#define myrand() getpid() -#else -#if RANDBITS == 15 /* 15 bits of rand()? */ -#define RANDRAND 268435456.0 /* that's 2**28 */ -#define HALFRAND 0x4000 /* that's 2**14 */ -int rand(void); -#define myrand() (rand()&32767) -#define rand_mod(m) ((int)((double)myrand() / 32768.0 * ((double)(m -/* pick number in 0..m-1 */ - -#else - -#if RANDBITS < 31 /* 16 bits of rand()? */ -#define RANDRAND 1073741824.0 /* that's 2**30 */ -#define HALFRAND 0x8000 /* that's 2**15 */ -unsigned rand(); -#define myrand() (rand()&65535) -#define rand_mod(m) ((int)((double)myrand() / 65536.0 * ((double)(m -/* pick number in 0..m-1 */ - -#else /* assume 31 bits */ #define RANDRAND 1152921504606846976.0 /* that's 2**60 */ #define HALFRAND 0x4000 /* that's 2**30 */ -long rand(); -#define myrand() rand() +#define myrand() (int)random() #define rand_mod(m) ((myrand() / 37) % (m)) /* pick number in 0..m-1 */ /* * The reason for the /37 above is that our random number generator yields * successive evens and odds, for some reason. This makes strange star maps. */ -#endif -#endif -#endif - /* we get fractions of seconds from calling ftime on timebuf */ -EXT struct timeb timebuf; -#define roundsleep(x) (ftime(),sleep(timebuf.millitm > 500?x+1:x)) +EXT struct timespec timebuf; +#define roundsleep(x) (clock_gettime(CLOCK_REALTIME, ),sleep(timebuf.tv_nsec > 50 ?x+1:x)) #define waiting 0 Index: src/games/warp/config.h.SH diff -u src/games/warp/config.h.SH:1.2 src/games/warp/config.h.SH:1.3 --- src/games/warp/config.h.SH:1.2 Tue Nov 10 17:42:19 2020 +++ src/games/warp/config.h.SH Wed Nov 11 14:55:33 2020 @@ -87,16 +87,16 @@ cat
CVS commit: src/games/warp
Module Name:src Committed By: christos Date: Wed Nov 11 19:54:54 UTC 2020 Modified Files: src/games/warp: Makefile Log Message: no need for -lcompat To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/games/warp/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/warp/Makefile diff -u src/games/warp/Makefile:1.3 src/games/warp/Makefile:1.4 --- src/games/warp/Makefile:1.3 Wed Nov 11 12:11:19 2020 +++ src/games/warp/Makefile Wed Nov 11 14:54:53 2020 @@ -1,14 +1,15 @@ -# $NetBSD: Makefile,v 1.3 2020/11/11 17:11:19 christos Exp $ +# $NetBSD: Makefile,v 1.4 2020/11/11 19:54:53 christos Exp $ .include PROG= warp +DBG=-g SRCS= bang.c init.c intrp.c move.c object.c play.c score.c sig.c term.c \ them.c us.c util.c version.c warp.c weapon.c -DPADD= ${LIBTERMLIB} ${LIBM} ${LIBCOMPAT} -LDADD= -ltermlib -lm -lcompat +DPADD= ${LIBTERMLIB} ${LIBM} +LDADD= -ltermlib -lm CPPFLAGS+=-DHAVETERMLIB @@ -18,9 +19,6 @@ HIDEGAME=hidegame SETGIDGAME=yes MAN= warp.6 -BINGRP= games -BINMODE=2555 - warp.6: ${_MKTARGET_CREATE} cat ${.CURDIR}/warp.man > ${.TARGET} @@ -69,14 +67,4 @@ FILES+=warp.doc warp.news README FILESDIR=/usr/share/games/warp .endif -CFLAGS+= -Wno-error=old-style-definition -Wno-error=strict-prototypes -CFLAGS+= -Wno-error=comment -Wno-error=maybe-uninitialized -CFLAGS+= -Wno-error=discarded-qualifiers -Wno-error=dangling-else -CFLAGS+= -Wno-error=char-subscripts -Wno-error=parentheses -CFLAGS+= -Wno-error=unused-value -Wno-error=format-extra-args -CFLAGS+= -Wno-error=format-overflow= -Wno-error=builtin-declaration-mismatch -CFLAGS+= -Wno-error=format= -Wno-error=sign-compare -Wno-error=return-type -CFLAGS+= -Wno-error=unused-label -Wno-error=unused-variable -CFLAGS+= -Wno-error=format-nonliteral -Wno-error=implicit-fallthrough= - .include
CVS commit: src/sys/net
Module Name:src Committed By: riastradh Date: Wed Nov 11 18:08:35 UTC 2020 Modified Files: src/sys/net: if_wg.c Log Message: wg: Sprinkle #ifdef INET6. Avoid unconditional use of ip6 structs. Fixes no-INET6 build. Based on patch from Brad Spencer: https://mail-index.NetBSD.org/current-users/2020/11/11/msg039883.html To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/net/if_wg.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/net/if_wg.c diff -u src/sys/net/if_wg.c:1.61 src/sys/net/if_wg.c:1.62 --- src/sys/net/if_wg.c:1.61 Thu Oct 15 10:09:49 2020 +++ src/sys/net/if_wg.c Wed Nov 11 18:08:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wg.c,v 1.61 2020/10/15 10:09:49 roy Exp $ */ +/* $NetBSD: if_wg.c,v 1.62 2020/11/11 18:08:34 riastradh Exp $ */ /* * Copyright (C) Ryota Ozaki @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.61 2020/10/15 10:09:49 roy Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.62 2020/11/11 18:08:34 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_altq_enabled.h" @@ -1611,7 +1611,18 @@ static struct socket * wg_get_so_by_af(struct wg_softc *wg, const int af) { - return (af == AF_INET) ? wg->wg_so4 : wg->wg_so6; + switch (af) { +#ifdef INET + case AF_INET: + return wg->wg_so4; +#endif +#ifdef INET6 + case AF_INET6: + return wg->wg_so6; +#endif + default: + panic("wg: no such af: %d", af); + } } static struct socket * @@ -2349,9 +2360,14 @@ wg_validate_inner_packet(const char *pac WG_DLOG("af=%d\n", *af); - if (*af == AF_INET) { + switch (*af) { +#ifdef INET + case AF_INET: packet_len = ntohs(ip->ip_len); - } else { + break; +#endif +#ifdef INET6 + case AF_INET6: { const struct ip6_hdr *ip6; if (__predict_false(decrypted_len < sizeof(struct ip6_hdr))) @@ -2359,6 +2375,11 @@ wg_validate_inner_packet(const char *pac ip6 = (const struct ip6_hdr *)packet; packet_len = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen); + break; + } +#endif + default: + return false; } WG_DLOG("packet_len=%u\n", packet_len); @@ -2432,12 +2453,16 @@ sockaddr_port_match(const struct sockadd return false; switch (sa1->sa_family) { +#ifdef INET case AF_INET: return satocsin(sa1)->sin_port == satocsin(sa2)->sin_port; +#endif +#ifdef INET6 case AF_INET6: return satocsin6(sa1)->sin6_port == satocsin6(sa2)->sin6_port; +#endif default: - return true; + return false; } } @@ -3938,8 +3963,7 @@ wg_send_data_msg(struct wg_peer *wgp, st struct wg_msg_data *wgmd; bool free_padded_buf = false; struct mbuf *n; - size_t leading_len = max_linkhdr + sizeof(struct ip6_hdr) + - sizeof(struct udphdr); + size_t leading_len = max_hdr + sizeof(struct udphdr); mlen = m_length(m); inner_len = mlen;
CVS commit: src/games/warp
Module Name:src Committed By: christos Date: Wed Nov 11 17:11:19 UTC 2020 Modified Files: src/games/warp: Makefile config.h intrp.c score.c term.c term.h warp.h Log Message: - use termios - enable setgid games - enable savedir To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/games/warp/Makefile cvs rdiff -u -r1.3 -r1.4 src/games/warp/config.h cvs rdiff -u -r1.4 -r1.5 src/games/warp/intrp.c src/games/warp/score.c \ src/games/warp/term.h src/games/warp/warp.h cvs rdiff -u -r1.5 -r1.6 src/games/warp/term.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/warp/Makefile diff -u src/games/warp/Makefile:1.2 src/games/warp/Makefile:1.3 --- src/games/warp/Makefile:1.2 Tue Nov 10 03:49:08 2020 +++ src/games/warp/Makefile Wed Nov 11 12:11:19 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2020/11/10 08:49:08 kamil Exp $ +# $NetBSD: Makefile,v 1.3 2020/11/11 17:11:19 christos Exp $ .include @@ -18,6 +18,9 @@ HIDEGAME=hidegame SETGIDGAME=yes MAN= warp.6 +BINGRP= games +BINMODE=2555 + warp.6: ${_MKTARGET_CREATE} cat ${.CURDIR}/warp.man > ${.TARGET} Index: src/games/warp/config.h diff -u src/games/warp/config.h:1.3 src/games/warp/config.h:1.4 --- src/games/warp/config.h:1.3 Tue Nov 10 17:42:19 2020 +++ src/games/warp/config.h Wed Nov 11 12:11:19 2020 @@ -20,12 +20,12 @@ */ #define SIGNEDCHAR /**/ -/* TERMIO: +/* TERMIOS: * This symbol, if defined, indicates that the program should include * termio.h rather than sgtty.h. There are also differences in the * ioctl() calls that depend on the value of this symbol. */ -#undef TERMIO /**/ +#define TERMIOS /**/ /* USENDIR: * This symbol, if defined, indicates that the program should compile Index: src/games/warp/intrp.c diff -u src/games/warp/intrp.c:1.4 src/games/warp/intrp.c:1.5 --- src/games/warp/intrp.c:1.4 Tue Nov 10 17:42:19 2020 +++ src/games/warp/intrp.c Wed Nov 11 12:11:19 2020 @@ -568,7 +568,7 @@ getrealname(uid_t uid) if (fork()) wait(0); else { - setuid(getuid()); + setgid(getgid()); if ((tmpfp = fopen(filexp(FULLNAMEFILE),"w")) == NULL) exit(1); fprintf(tmpfp, "%s\n", buf); Index: src/games/warp/score.c diff -u src/games/warp/score.c:1.4 src/games/warp/score.c:1.5 --- src/games/warp/score.c:1.4 Tue Nov 10 17:42:19 2020 +++ src/games/warp/score.c Wed Nov 11 12:11:19 2020 @@ -35,20 +35,18 @@ score_init(void) int i; FILE *savfil; -#if 0 if (stat(SAVEDIR,)) { printf("Cannot access %s\r\n",SAVEDIR); finalize(1); } -if (filestat.st_uid != geteuid()) { - printf("Warp will not run right without being setuid.\r\n"); +if (filestat.st_gid != getegid()) { + printf("Warp will not run right without being setgid.\r\n"); finalize(1); } if ((filestat.st_mode & 0605) != 0605) { printf("%s is not protected correctly (must be u+rw o+rx).\r\n",SAVEDIR); finalize(1); } -#endif #ifdef SCOREFULL interp(longlognam, sizeof longlognam, "%N"); @@ -241,9 +239,7 @@ wscore(void) printf("WHO SCORE DF CDF E B WV FLAGS\r\n"); resetty(); snprintf(spbuf, sizeof(spbuf), "/bin/cat %ssave.*",SAVEDIR); -#ifndef lint execl("/bin/sh", "sh", "-c", spbuf, NULL); -#endif finalize(1); } @@ -421,10 +417,8 @@ wavescore(void) snprintf(spbuf, sizeof(spbuf), "Star save ratio: %1.8f (%d/%d)", starscore, numstars, inumstars); mvaddstr( 6,5, spbuf); -#ifndef lint bonuses += tmp = (long) (((double)curscore / possiblescore) * (starscore*starscore) * smarts * 20); -#endif snprintf(spbuf, sizeof(spbuf), "%6ld", tmp); mvaddstr( 6, 68, spbuf); row = 7; Index: src/games/warp/term.h diff -u src/games/warp/term.h:1.4 src/games/warp/term.h:1.5 --- src/games/warp/term.h:1.4 Tue Nov 10 17:42:19 2020 +++ src/games/warp/term.h Wed Nov 11 12:11:19 2020 @@ -181,9 +181,16 @@ EXT char INTRCH INIT('\03'); /* stuff wanted by terminal mode diddling routines */ -#ifdef TERMIO +#ifdef TERMIOS +EXT struct termios _tty, _oldtty; +#elif defined(TERMIO) +typedef int speed_t; EXT struct termio _tty, _oldtty; +#define tcsetattr(fd, how, ti) ioctl(fd, how, ti) +#define tcgetattr(fd, ti) ioctl(fd, TCGETA, ti) +#define cfgetospeed(ti) ((ti)->c_cflag & CBAUD) #else +typedef int speed_t; EXT struct sgttyb _tty; EXT int _res_flg INIT(0); #endif @@ -193,18 +200,18 @@ EXT bool bizarre INIT(false); /* do we /* terminal mode diddling routines */ -#ifdef TERMIO +#if defined(TERMIO) || defined(TERMIOS) -#define raw() ((bizarre=1),_tty.c_lflag &=~ISIG,_tty.c_cc[VMIN] = 1,ioctl(_tty_ch,TCSETAF,&_tty)) -#define noraw() ((bizarre=1),_tty.c_lflag |= ISIG,_tty.c_cc[VEOF] = CEOF,ioctl(_tty_ch,TCSETAF,&_tty)) -#define crmode() ((bizarre=1),_tty.c_lflag &=~ICANON,_tty.c_cc[VMIN] = 1,ioctl(_tty_ch,TCSETAF,&_tty)) -#define nocrmode() ((bizarre=1),_tty.c_lflag |= ICANON,_tty.c_cc[VEOF]
CVS commit: src/games/warp
Module Name:src Committed By: kamil Date: Wed Nov 11 11:54:42 UTC 2020 Modified Files: src/games/warp: warp.c Log Message: Fix the old leftover license note Larry Wall: "I outgrew commercial-free licensing about 30 years ago." To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/games/warp/warp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/warp/warp.c diff -u src/games/warp/warp.c:1.5 src/games/warp/warp.c:1.6 --- src/games/warp/warp.c:1.5 Tue Nov 10 22:52:32 2020 +++ src/games/warp/warp.c Wed Nov 11 11:54:42 2020 @@ -5,17 +5,33 @@ char rcsid[] = "@(#)Header: warp.c,v 7.0 * helpers: Jonathan and Mark Biggar, and Dan Faigin * special thanks to my sweetie Gloria who suggested the Planet Crusher * - * Copyright (C) 1986, Larry Wall - * - * This program may be copied as long as this copyright notice is - * included, and as long as it is not being copied for purposes - * of profit. If you want to modify this program in any way other - * than normal configuration changes, common decency would suggest - * that you also modify the name of the program so that my good name - * (what there is of it) is not impugned. (Calling it something like - * "warpx" or "superwarp" would be fine.) Also, give it another - * WARPDIR so that the scoreboards don't get confused. - * + * Copyright (c) 2020 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Larry Wall. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * * version 5.0 04/20/83 * 5.1 05/05/83 various tidbits * 5.2 05/12/83 VAX -> vax, ifdef'ed a SIGCONT