CVS commit: src/sys/arch/mips/include
Module Name:src Committed By: simonb Date: Wed Mar 24 05:35:06 UTC 2021 Modified Files: src/sys/arch/mips/include: frame.h Log Message: We don't really need a comment at the end of the file saying "this is the end of the file". To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/include/frame.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/mips/include/frame.h diff -u src/sys/arch/mips/include/frame.h:1.10 src/sys/arch/mips/include/frame.h:1.11 --- src/sys/arch/mips/include/frame.h:1.10 Sun Jul 26 08:08:41 2020 +++ src/sys/arch/mips/include/frame.h Wed Mar 24 05:35:05 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: frame.h,v 1.10 2020/07/26 08:08:41 simonb Exp $ */ +/* $NetBSD: frame.h,v 1.11 2021/03/24 05:35:05 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -49,5 +49,3 @@ void sendsig_sigcontext(const ksiginfo_t #endif /* _LOCORE */ #endif /* _MIPS_FRAME_H_ */ - -/* End of frame.h */
CVS commit: src/sys
Module Name:src Committed By: simonb Date: Wed Mar 24 05:00:24 UTC 2021 Modified Files: src/sys/arch/aarch64/include: types.h src/sys/arch/evbarm/rpi: vcio.h src/sys/arch/m68k/include: types.h src/sys/arch/mips/include: cdefs.h src/sys/dev/rcons: README Log Message: s/depreciated/deprecated/g To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/aarch64/include/types.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/rpi/vcio.h cvs rdiff -u -r1.33 -r1.34 src/sys/arch/m68k/include/types.h cvs rdiff -u -r1.16 -r1.17 src/sys/arch/mips/include/cdefs.h cvs rdiff -u -r1.1 -r1.2 src/sys/dev/rcons/README 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/include/types.h diff -u src/sys/arch/aarch64/include/types.h:1.17 src/sys/arch/aarch64/include/types.h:1.18 --- src/sys/arch/aarch64/include/types.h:1.17 Sat Jan 23 22:24:49 2021 +++ src/sys/arch/aarch64/include/types.h Wed Mar 24 05:00:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.17 2021/01/23 22:24:49 jmcneill Exp $ */ +/* $NetBSD: types.h,v 1.18 2021/03/24 05:00:24 simonb Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -40,8 +40,8 @@ #if defined(_KERNEL) || defined(_KMEMUSER) || defined(_KERNTYPES) || \ defined(_STANDALONE) -typedef unsigned long vm_offset_t; /* depreciated */ -typedef unsigned long vm_size_t; /* depreciated */ +typedef unsigned long vm_offset_t; /* deprecated */ +typedef unsigned long vm_size_t; /* deprecated */ typedef unsigned long paddr_t; typedef unsigned long psize_t; Index: src/sys/arch/evbarm/rpi/vcio.h diff -u src/sys/arch/evbarm/rpi/vcio.h:1.1 src/sys/arch/evbarm/rpi/vcio.h:1.2 --- src/sys/arch/evbarm/rpi/vcio.h:1.1 Sun Oct 14 16:16:52 2012 +++ src/sys/arch/evbarm/rpi/vcio.h Wed Mar 24 05:00:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vcio.h,v 1.1 2012/10/14 16:16:52 skrll Exp $ */ +/* $NetBSD: vcio.h,v 1.2 2021/03/24 05:00:24 simonb Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #define _EVBARM_RPI_VCIO_H_ #define BCMMBOX_CHANPM 0 -#define BCMMBOX_CHANFB 1 /* will be depreciated */ +#define BCMMBOX_CHANFB 1 /* will be deprecated */ #define BCMMBOX_CHANVUART 2 #define BCMMBOX_CHANVCHIQ 3 #define BCMMBOX_CHANLEDS 4 Index: src/sys/arch/m68k/include/types.h diff -u src/sys/arch/m68k/include/types.h:1.33 src/sys/arch/m68k/include/types.h:1.34 --- src/sys/arch/m68k/include/types.h:1.33 Sat Jan 23 22:31:19 2016 +++ src/sys/arch/m68k/include/types.h Wed Mar 24 05:00:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.33 2016/01/23 22:31:19 christos Exp $ */ +/* $NetBSD: types.h,v 1.34 2021/03/24 05:00:24 simonb Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -44,8 +44,8 @@ typedef struct label_t { /* consistent #endif #if defined(_KERNEL) || defined(_KMEMUSER) || defined(_KERNTYPES) || defined(_STANDALONE) -typedef unsigned long vm_offset_t; /* depreciated */ -typedef unsigned long vm_size_t; /* depreciated */ +typedef unsigned long vm_offset_t; /* deprecated */ +typedef unsigned long vm_size_t; /* deprecated */ typedef unsigned long paddr_t; typedef unsigned long psize_t; Index: src/sys/arch/mips/include/cdefs.h diff -u src/sys/arch/mips/include/cdefs.h:1.16 src/sys/arch/mips/include/cdefs.h:1.17 --- src/sys/arch/mips/include/cdefs.h:1.16 Sun Jul 26 08:08:41 2020 +++ src/sys/arch/mips/include/cdefs.h Wed Mar 24 05:00:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.16 2020/07/26 08:08:41 simonb Exp $ */ +/* $NetBSD: cdefs.h,v 1.17 2021/03/24 05:00:24 simonb Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -31,7 +31,7 @@ #define _MIPS_CDEFS_H_ /* - * These are depreciated. Use __mips_{o32,o64,n32,n64} instead. + * These are deprecated. Use __mips_{o32,o64,n32,n64} instead. */ /* MIPS Subprogram Interface Model */ #define _MIPS_SIM_ABIX32 4 /* 64 bit safe, ILP32 o32 model */ Index: src/sys/dev/rcons/README diff -u src/sys/dev/rcons/README:1.1 src/sys/dev/rcons/README:1.2 --- src/sys/dev/rcons/README:1.1 Fri Dec 17 01:41:52 1999 +++ src/sys/dev/rcons/README Wed Mar 24 05:00:24 2021 @@ -1,3 +1,3 @@ -$NetBSD: README,v 1.1 1999/12/17 01:41:52 ad Exp $ +$NetBSD: README,v 1.2 2021/03/24 05:00:24 simonb Exp $ -This code is depreciated. Use wscons instead. +This code is deprecated. Use wscons instead.
CVS commit: src/external/cddl/osnet/dev/fbt/aarch64
Module Name:src Committed By: simonb Date: Wed Mar 24 04:46:41 UTC 2021 Modified Files: src/external/cddl/osnet/dev/fbt/aarch64: fbt_isa.c fbt_isa.h Log Message: Add NetBSD CVS IDs. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h 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/fbt/aarch64/fbt_isa.c diff -u src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.6 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.7 --- src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.6 Wed Feb 12 06:05:31 2020 +++ src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c Wed Mar 24 04:46:41 2021 @@ -1,3 +1,5 @@ +/* $NetBSD: fbt_isa.c,v 1.7 2021/03/24 04:46:41 simonb Exp $ */ + /* * CDDL HEADER START * Index: src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h diff -u src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h:1.1 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h:1.2 --- src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h:1.1 Tue Dec 3 22:10:56 2019 +++ src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h Wed Mar 24 04:46:41 2021 @@ -1,3 +1,5 @@ +/* $NetBSD: fbt_isa.h,v 1.2 2021/03/24 04:46:41 simonb Exp $ */ + /* * CDDL HEADER START *
CVS commit: src/share/mk
Module Name:src Committed By: simonb Date: Wed Mar 24 04:36:57 UTC 2021 Modified Files: src/share/mk: bsd.README Log Message: Add aarch64 and sparc64 to MKZFS yes. Sort the machine names for the "Default: yes on ..." lines. To generate a diff of this commit: cvs rdiff -u -r1.415 -r1.416 src/share/mk/bsd.README 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.README diff -u src/share/mk/bsd.README:1.415 src/share/mk/bsd.README:1.416 --- src/share/mk/bsd.README:1.415 Tue Nov 10 21:47:49 2020 +++ src/share/mk/bsd.README Wed Mar 24 04:36:57 2021 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.README,v 1.415 2020/11/10 21:47:49 kamil Exp $ +# $NetBSD: bsd.README,v 1.416 2021/03/24 04:36:57 simonb Exp $ # @(#)bsd.README 8.2 (Berkeley) 4/2/94 This is the README file for the make "include" files for the NetBSD @@ -134,7 +134,7 @@ MKCATPAGES If "no", don't build or insta Default: no MKCOMPAT If "no", don't build or install the src/compat. - Default: yes on amd64/mips64/sparc64, no elsewhere. + Default: yes on amd64, mips64 and sparc64, no elsewhere. MKCOMPATTESTS If "yes", build and install the NetBSD test suite when building and installing src/compat. @@ -371,7 +371,7 @@ MKNLS If "no", don't build or install t MKNOUVEAUFIRMWARE If "yes", install the /libdata/firmware/nouveau directory, which is necessary for the nouveau DRM driver. - Default: yes on i386 and amd64, no elsewhere. + Default: yes on amd64 and i386, no elsewhere. MKNPF If "no", don't build or install the NPF and its modules. Default: yes @@ -429,7 +429,7 @@ MKPROFILE If "no", don't build or instal MKRADEONFIRMWARE If "yes", install the /libdata/firmware/radeon directory, which is necessary for the radeon DRM driver. - Default: yes on i386 and amd64, no elsewhere. + Default: yes on amd64 and i386, no elsewhere. MKRELRO If "partial", set the non-PLT GOT to read-only. If "full" also force immediate symbol binding. @@ -544,7 +544,7 @@ MKZFS If "no", do not build and install used to manage ZFS file system. Do not build zfs and solaris compatibility kernel modules. Note: ZFS requires 64bit atomic operations. - Default: yes on amd64, no elsewhere. + Default: yes on aarch64, amd64 and sparc64, no elsewhere. MKRUMP If "no", do not build and install rump related headers, libraries, and programs.
CVS commit: src/sys/arch/sandpoint/stand/altboot
Module Name:src Committed By: rin Date: Wed Mar 24 02:53:16 UTC 2021 Modified Files: src/sys/arch/sandpoint/stand/altboot: Makefile Log Message: Remove "lib" directory for cleandir. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sandpoint/stand/altboot/Makefile 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/sandpoint/stand/altboot/Makefile diff -u src/sys/arch/sandpoint/stand/altboot/Makefile:1.17 src/sys/arch/sandpoint/stand/altboot/Makefile:1.18 --- src/sys/arch/sandpoint/stand/altboot/Makefile:1.17 Sat Apr 8 19:53:22 2017 +++ src/sys/arch/sandpoint/stand/altboot/Makefile Wed Mar 24 02:53:16 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 2017/04/08 19:53:22 christos Exp $ +# $NetBSD: Makefile,v 1.18 2021/03/24 02:53:16 rin Exp $ S= ${.CURDIR}/../../../.. @@ -51,6 +51,11 @@ SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} +cleandir distclean: .WAIT cleanlibdir + +cleanlibdir: + -rm -rf lib + ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${_MKTARGET_LINK} ${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Mar 23 23:12:21 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c d_c99_init.c d_c99_init.exp Log Message: tests/lint: fix outdated comments To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/d_c99_init.c cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/d_c99_init.exp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.26 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.27 --- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.26 Sun Mar 21 14:36:59 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c Tue Mar 23 23:12:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_bool_strict.c,v 1.26 2021/03/21 14:36:59 rillig Exp $ */ +/* $NetBSD: d_c99_bool_strict.c,v 1.27 2021/03/23 23:12:21 rillig Exp $ */ # 3 "d_c99_bool_strict.c" /* @@ -151,10 +151,10 @@ enum strict_bool_constant_expressions { /* * Without strict bool mode, these two variants of an expression can * occur when a preprocessor macro is either defined to 1 or left - * empty, as in lint1/ops.def. + * empty (since C99), as in lint1/ops.def. * - * TODO: figure out an elegant way to achieve the same effect in - * strict bool mode. + * In strict bool mode, the resulting expression can be compared + * against 0 to achieve the same effect (so +0 != 0 or 1 + 0 != 0). */ BINARY_PLUS = (1 + 0) ? 100 : 101, /* expect: 331 */ UNARY_PLUS = (+0) ? 100 : 101, /* expect: 331 */ Index: src/tests/usr.bin/xlint/lint1/d_c99_init.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.12 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.13 --- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.12 Sat Mar 20 08:59:46 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_init.c Tue Mar 23 23:12:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_init.c,v 1.12 2021/03/20 08:59:46 rillig Exp $ */ +/* $NetBSD: d_c99_init.c,v 1.13 2021/03/23 23:12:21 rillig Exp $ */ # 3 "d_c99_init.c" /* @@ -47,7 +47,6 @@ void initialization_with_redundant_braces(any arg) { any local = { arg }; /* expect: 185 */ - // TODO: message 185 needs to be reworded to "cannot initialize '%s' from '%s'". use(); } Index: src/tests/usr.bin/xlint/lint1/d_c99_init.exp diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.exp:1.10 src/tests/usr.bin/xlint/lint1/d_c99_init.exp:1.11 --- src/tests/usr.bin/xlint/lint1/d_c99_init.exp:1.10 Sun Mar 21 20:44:59 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_init.exp Tue Mar 23 23:12:21 2021 @@ -1,6 +1,6 @@ d_c99_init.c(22): error: invalid initializer type int [176] d_c99_init.c(23): error: too many initializers [174] d_c99_init.c(49): error: cannot initialize 'pointer to const void' from 'struct any' [185] -d_c99_init.c(66): error: too many array initializers, expected 3 [173] -d_c99_init.c(131): error: syntax error 'named member must only be used with struct/union' [249] -d_c99_init.c(143): error: invalid initializer type int [176] +d_c99_init.c(65): error: too many array initializers, expected 3 [173] +d_c99_init.c(130): error: syntax error 'named member must only be used with struct/union' [249] +d_c99_init.c(142): error: invalid initializer type int [176]
CVS commit: src
Module Name:src Committed By: rillig Date: Tue Mar 23 22:58:08 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_init_array_using_string.c d_init_array_using_string.exp src/usr.bin/xlint/lint1: init.c Log Message: lint: fix wrong warning about initialization using string literal Missing braces after 'if', since init.c 1.68 from 2021-02-20. GCC 10 doesn't complain about this even with -Wmisleading-indentation since at least one of the involved lines is a macro invocation (in this case both lines). GCC 11 will warn about this. Clang warns about this, but the regular Clang build currently fails for other reasons, so this problem didn't show up there either. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c \ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp cvs rdiff -u -r1.114 -r1.115 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c diff -u src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.1 src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.1 Tue Mar 23 21:19:08 2021 +++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c Tue Mar 23 22:58:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_init_array_using_string.c,v 1.1 2021/03/23 21:19:08 rillig Exp $ */ +/* $NetBSD: d_init_array_using_string.c,v 1.2 2021/03/23 22:58:08 rillig Exp $ */ # 3 "d_init_array_using_string.c" /* @@ -71,7 +71,7 @@ test_array_initialization_in_struct(void }; struct cs_ws extra_braces = { - { "" }, /* expect: illegal combination *//*FIXME*/ - { L"" }, /* expect: illegal combination *//*FIXME*/ + { "" }, + { L"" }, }; } Index: src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp diff -u src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.1 src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.2 --- src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.1 Tue Mar 23 21:19:08 2021 +++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp Tue Mar 23 22:58:08 2021 @@ -6,5 +6,3 @@ d_init_array_using_string.c(59): warning d_init_array_using_string.c(60): warning: illegal combination of integer (char) and pointer (pointer to char) [183] d_init_array_using_string.c(69): warning: non-null byte ignored in string initializer [187] d_init_array_using_string.c(70): warning: non-null byte ignored in string initializer [187] -d_init_array_using_string.c(74): warning: illegal combination of integer (char) and pointer (pointer to char) [183] -d_init_array_using_string.c(75): warning: illegal combination of integer (int) and pointer (pointer to int) [183] Index: src/usr.bin/xlint/lint1/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.114 src/usr.bin/xlint/lint1/init.c:1.115 --- src/usr.bin/xlint/lint1/init.c:1.114 Tue Mar 23 20:21:07 2021 +++ src/usr.bin/xlint/lint1/init.c Tue Mar 23 22:58:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.114 2021/03/23 20:21:07 rillig Exp $ */ +/* $NetBSD: init.c,v 1.115 2021/03/23 22:58:08 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.114 2021/03/23 20:21:07 rillig Exp $"); +__RCSID("$NetBSD: init.c,v 1.115 2021/03/23 22:58:08 rillig Exp $"); #endif #include @@ -1128,9 +1128,10 @@ init_array_using_string(tnode_t *tn) * If the array is already partly initialized, we are * wrong here. */ - if (istk->i_remaining != istk->i_type->t_dim) + if (istk->i_remaining != istk->i_type->t_dim) { debug_leave(); return false; + } } else { debug_leave(); return false;
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Tue Mar 23 22:27:38 UTC 2021 Modified Files: src/sys/dev/fdt: dwcmmc_fdt.c Log Message: Match generic "snps,dw-mshc" compat string as found in BeagleV. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/fdt/dwcmmc_fdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/fdt/dwcmmc_fdt.c diff -u src/sys/dev/fdt/dwcmmc_fdt.c:1.16 src/sys/dev/fdt/dwcmmc_fdt.c:1.17 --- src/sys/dev/fdt/dwcmmc_fdt.c:1.16 Wed Jan 27 03:10:21 2021 +++ src/sys/dev/fdt/dwcmmc_fdt.c Tue Mar 23 22:27:38 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: dwcmmc_fdt.c,v 1.16 2021/01/27 03:10:21 thorpej Exp $ */ +/* $NetBSD: dwcmmc_fdt.c,v 1.17 2021/03/23 22:27:38 jmcneill Exp $ */ /*- * Copyright (c) 2015-2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.16 2021/01/27 03:10:21 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.17 2021/03/23 22:27:38 jmcneill Exp $"); #include #include @@ -66,8 +66,14 @@ static const struct dwcmmc_fdt_config dw .intr_cardmask = __BIT(24), }; +static const struct dwmmc_fdt_config dwmmc_default_config = { + .flags = DWC_MMC_F_USE_HOLD_REG | + DWC_MMC_F_DMA, +}; + static const struct device_compatible_entry compat_data[] = { { .compat = "rockchip,rk3288-dw-mshc", .data = _rk3288_config }, + { .compat = "snps,dw-mshc", .data = _default_config }, DEVICE_COMPAT_EOL }; @@ -158,7 +164,7 @@ dwcmmc_fdt_attach(device_t parent, devic sc->sc_bus_width = 4; sc->sc_fifo_depth = fifo_depth; - sc->sc_intr_cardmask = esc->sc_conf->intr_cardmask; + sc->sc_entr_cardmask = esc->sc_conf->intr_cardmask; sc->sc_ciu_div = esc->sc_conf->ciu_div; sc->sc_flags = esc->sc_conf->flags; sc->sc_pre_power_on = dwcmmc_fdt_pre_power_on;
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Tue Mar 23 22:02:44 UTC 2021 Modified Files: src/share/mk: sys.mk Log Message: >From Greg A. Woods: - add LDSTATIC to all the LINK rules, replacing CPPFLAGS which should not be used - create new COMPILE_LINK rules that are like LINK rules but have CPPFLAGS where appropriate To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/share/mk/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/sys.mk diff -u src/share/mk/sys.mk:1.145 src/share/mk/sys.mk:1.146 --- src/share/mk/sys.mk:1.145 Mon Mar 22 17:52:26 2021 +++ src/share/mk/sys.mk Tue Mar 23 18:02:44 2021 @@ -1,4 +1,4 @@ -# $NetBSD: sys.mk,v 1.145 2021/03/22 21:52:26 christos Exp $ +# $NetBSD: sys.mk,v 1.146 2021/03/23 22:02:44 christos Exp $ # @(#)sys.mk 8.2 (Berkeley) 3/21/94 # # This file contains the basic rules for make(1) and is read first @@ -19,10 +19,11 @@ MV?= mv -f AS?= as AFLAGS?= COMPILE.s?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} -c -LINK.s?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${LDFLAGS} +LINK.s?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${LDSTATIC} ${LDFLAGS} _ASM_TRADITIONAL_CPP= -x assembler-with-cpp COMPILE.S?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} ${_ASM_TRADITIONAL_CPP} -c -LINK.S?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} ${LDFLAGS} +LINK.S?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${LDSTATIC} ${LDFLAGS} +COMPILE_LINK.S?=${LINK.S} ${CPPFLAGS} CC?= cc .if ${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb" @@ -42,7 +43,8 @@ DTRACE_OPTS?= -fno-omit-frame-pointer -f CFLAGS?= ${DBG} LDFLAGS?= COMPILE.c?= ${CC} ${CFLAGS} ${DTRACE_OPTS} ${CPPFLAGS} -c -LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} +LINK.c?= ${CC} ${CFLAGS} ${LDSTATIC} ${LDFLAGS} +COMPILE_LINK.c?=${LINK.c} ${CPPFLAGS} # C Type Format data is required for DTrace CTFFLAGS ?= -g -L VERSION @@ -68,12 +70,14 @@ __BUILDSEED= ${BUILDSEED}/${__INITSEED}/ _CXXSEED?= ${BUILDSEED:D-frandom-seed=${__BUILDSEED:hash}} COMPILE.cc?= ${CXX} ${_CXXSEED} ${CXXFLAGS} ${DTRACE_OPTS} ${CPPFLAGS} -c -LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} +LINK.cc?= ${CXX} ${CXXFLAGS} ${LDSTATIC} ${LDFLAGS} +COMPILE_LINK.cc?=${LINK.cc} ${CPPFLAGS} OBJC?= ${CC} OBJCFLAGS?= ${CFLAGS} COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c -LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS} +LINK.m?= ${OBJC} ${OBJCFLAGS} ${LDSTATIC} ${LDFLAGS} +LINK.m?= ${LINK.m} ${CPPFLAGS} CPP?= cpp CPPFLAGS?= @@ -82,11 +86,14 @@ FC?= f77 FFLAGS?= -O RFLAGS?= COMPILE.f?= ${FC} ${FFLAGS} -c -LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS} +LINK.f?= ${FC} ${FFLAGS} ${LDSTATIC} ${LDFLAGS} +COMPILE_LINK.f?=${LINK.f} ${CPPFLAGS} COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c -LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS} +LINK.F?= ${FC} ${FFLAGS} ${LDSTATIC} ${LDFLAGS} +COMPILE_LINK.F?=${LINK.F} ${CPPFLAGS} COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c -LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS} +LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDSTATIC} ${LDFLAGS} +COMPILE_LINK.r?=${LINK.r} INSTALL?= install @@ -122,7 +129,7 @@ YACC.y?= ${YACC} ${YFLAGS} # C .c: - ${LINK.c} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} + ${COMPILE_LINK.c} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} .c.o: ${COMPILE.c} ${.IMPSRC} ${OBJECT_TARGET} ${CTFCONVERT_RUN} @@ -137,7 +144,7 @@ YACC.y?= ${YACC} ${YFLAGS} # C++ .cc .cpp .cxx .C: - ${LINK.cc} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} + ${COMPILE_LINK.cc} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} .cc.o .cpp.o .cxx.o .C.o: ${COMPILE.cc} ${.IMPSRC} ${OBJECT_TARGET} ${CTFCONVERT_RUN} @@ -148,7 +155,7 @@ YACC.y?= ${YACC} ${YFLAGS} # Fortran/Ratfor .f: - ${LINK.f} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} + ${COMPILE_LINK.f} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} .f.o: ${COMPILE.f} ${.IMPSRC} ${OBJECT_TARGET} ${CTFCONVERT_RUN} @@ -158,7 +165,7 @@ YACC.y?= ${YACC} ${YFLAGS} rm -f ${.PREFIX}.o .F: - ${LINK.F} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} + ${COMPILE_LINK.F} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} .F.o: ${COMPILE.F} ${.IMPSRC} ${OBJECT_TARGET} ${CTFCONVERT_RUN} @@ -168,7 +175,7 @@ YACC.y?= ${YACC} ${YFLAGS} rm -f ${.PREFIX}.o .r: - ${LINK.r} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} + ${COMPILE_LINK.r} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} .r.o: ${COMPILE.r} ${.IMPSRC} ${OBJECT_TARGET} ${CTFCONVERT_RUN} @@ -179,7 +186,7 @@ YACC.y?= ${YACC} ${YFLAGS} # Pascal .p: - ${LINK.p} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} + ${COMPILE_LINK.p} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} .p.o: ${COMPILE.p} ${.IMPSRC} ${OBJECT_TARGET} ${CTFCONVERT_RUN} @@ -190,7 +197,7 @@ YACC.y?= ${YACC} ${YFLAGS} # Assembly .s: - ${LINK.s} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} + ${COMPILE_LINK.s} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS} .s.o: ${COMPILE.s} ${.IMPSRC} ${OBJECT_TARGET} ${CTFCONVERT_RUN} @@ -199,7 +206,7 @@ YACC.y?= ${YACC} ${YFLAGS} ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o rm -f ${.PREFIX}.o .S: -
CVS commit: src
Module Name:src Committed By: rillig Date: Tue Mar 23 21:19:09 UTC 2021 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh Added Files: src/tests/usr.bin/xlint/lint1: d_init_array_using_string.c d_init_array_using_string.exp Log Message: tests/lint: test initialization using string literals The errors in line 74 and 75 of the test are wrong. Everything is fine there. The bug lies in init_array_using_string, try to see if you can spot it, neither GCC 9.3.0 nor Clang 8.0.1 could. To generate a diff of this commit: cvs rdiff -u -r1.1032 -r1.1033 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.35 -r1.36 src/tests/usr.bin/xlint/lint1/Makefile cvs rdiff -u -r0 -r1.1 \ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c \ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp cvs rdiff -u -r1.33 -r1.34 src/tests/usr.bin/xlint/lint1/t_integration.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1032 src/distrib/sets/lists/tests/mi:1.1033 --- src/distrib/sets/lists/tests/mi:1.1032 Sun Mar 14 11:49:37 2021 +++ src/distrib/sets/lists/tests/mi Tue Mar 23 21:19:08 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1032 2021/03/14 11:49:37 rillig Exp $ +# $NetBSD: mi,v 1.1033 2021/03/23 21:19:08 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -6151,6 +6151,8 @@ ./usr/tests/usr.bin/xlint/lint1/d_gcc_variable_array_init.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/d_incorrect_array_size.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint1/d_init_array_using_string.c tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/d_init_pop_member.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/d_init_pop_member.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/d_lint_assert.c tests-usr.bin-tests compattestfile,atf Index: src/tests/usr.bin/xlint/lint1/Makefile diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.35 src/tests/usr.bin/xlint/lint1/Makefile:1.36 --- src/tests/usr.bin/xlint/lint1/Makefile:1.35 Sun Mar 7 19:42:54 2021 +++ src/tests/usr.bin/xlint/lint1/Makefile Tue Mar 23 21:19:08 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.35 2021/03/07 19:42:54 rillig Exp $ +# $NetBSD: Makefile,v 1.36 2021/03/23 21:19:08 rillig Exp $ NOMAN= # defined @@ -70,6 +70,8 @@ FILES+= d_gcc_func.c FILES+= d_gcc_variable_array_init.c FILES+= d_incorrect_array_size.c FILES+= d_incorrect_array_size.exp +FILES+= d_init_array_using_string.c +FILES+= d_init_array_using_string.exp FILES+= d_init_pop_member.c FILES+= d_init_pop_member.exp FILES+= d_lint_assert.c Index: src/tests/usr.bin/xlint/lint1/t_integration.sh diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.33 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.34 --- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.33 Sun Mar 7 19:42:54 2021 +++ src/tests/usr.bin/xlint/lint1/t_integration.sh Tue Mar 23 21:19:08 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_integration.sh,v 1.33 2021/03/07 19:42:54 rillig Exp $ +# $NetBSD: t_integration.sh,v 1.34 2021/03/23 21:19:08 rillig Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -108,6 +108,7 @@ test_case cast_typeof test_case decl_old_style_arguments test_case fold_test test_case gcc_extension +test_case init_array_using_string test_case init_pop_member test_case lint_assert test_case return_type Added files: Index: src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.1 --- /dev/null Tue Mar 23 21:19:09 2021 +++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c Tue Mar 23 21:19:08 2021 @@ -0,0 +1,77 @@ +/* $NetBSD: d_init_array_using_string.c,v 1.1 2021/03/23 21:19:08 rillig Exp $ */ +# 3 "d_init_array_using_string.c" + +/* + * Test initialization of arrays and pointers by string literals. + */ + +void sink(const void *); + +void +test_assignment_initialization(void) +{ + const char *cs_match = ""; + const int *ws_match = L""; + + const char *cs_mismatch = L""; /* expect: illegal pointer combination */ + const int *ws_mismatch = ""; /* expect: illegal pointer combination */ +} + +void +test_pointer_initialization_in_struct(void) +{ + struct cs_ws { + const char *cs; + const int *ws; + }; + + struct cs_ws type_match = { + "", + L"", + }; + + struct cs_ws type_mismatch = { + L"", /* expect: illegal pointer combination */ + "",
CVS commit: src/external/mpl/bind/dist/lib
Module Name:src Committed By: christos Date: Tue Mar 23 20:59:03 UTC 2021 Modified Files: src/external/mpl/bind/dist/lib/dns: peer.c src/external/mpl/bind/dist/lib/isc: task.c src/external/mpl/bind/dist/lib/isc/netmgr: udp.c src/external/mpl/bind/dist/lib/ns: client.c interfacemgr.c Log Message: Consistently comment out code that lint can't handle (yet?) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/mpl/bind/dist/lib/dns/peer.c cvs rdiff -u -r1.10 -r1.11 src/external/mpl/bind/dist/lib/isc/task.c cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/lib/isc/netmgr/udp.c cvs rdiff -u -r1.12 -r1.13 src/external/mpl/bind/dist/lib/ns/client.c cvs rdiff -u -r1.9 -r1.10 src/external/mpl/bind/dist/lib/ns/interfacemgr.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/mpl/bind/dist/lib/dns/peer.c diff -u src/external/mpl/bind/dist/lib/dns/peer.c:1.5 src/external/mpl/bind/dist/lib/dns/peer.c:1.6 --- src/external/mpl/bind/dist/lib/dns/peer.c:1.5 Fri Feb 19 11:42:16 2021 +++ src/external/mpl/bind/dist/lib/dns/peer.c Tue Mar 23 16:59:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: peer.c,v 1.5 2021/02/19 16:42:16 christos Exp $ */ +/* $NetBSD: peer.c,v 1.6 2021/03/23 20:59:02 christos Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -216,8 +216,7 @@ dns_peer_newprefix(isc_mem_t *mem, const peer = isc_mem_get(mem, sizeof(*peer)); -#ifndef __lint__ -// XXX: bug +#ifndef __lint__ // XXX: bug *peer = (dns_peer_t){ .magic = DNS_PEER_MAGIC, .address = *addr, Index: src/external/mpl/bind/dist/lib/isc/task.c diff -u src/external/mpl/bind/dist/lib/isc/task.c:1.10 src/external/mpl/bind/dist/lib/isc/task.c:1.11 --- src/external/mpl/bind/dist/lib/isc/task.c:1.10 Fri Feb 19 11:42:19 2021 +++ src/external/mpl/bind/dist/lib/isc/task.c Tue Mar 23 16:59:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: task.c,v 1.10 2021/02/19 16:42:19 christos Exp $ */ +/* $NetBSD: task.c,v 1.11 2021/03/23 20:59:03 christos Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -1386,8 +1386,7 @@ isc_taskmgr_create(isc_mem_t *mctx, unsi REQUIRE(managerp != NULL && *managerp == NULL); manager = isc_mem_get(mctx, sizeof(*manager)); -#ifndef __lint__ -// XXX: bug +#ifndef __lint__ // XXX: bug *manager = (isc__taskmgr_t){ .common.impmagic = TASK_MANAGER_MAGIC, .common.magic = ISCAPI_TASKMGR_MAGIC }; #endif Index: src/external/mpl/bind/dist/lib/isc/netmgr/udp.c diff -u src/external/mpl/bind/dist/lib/isc/netmgr/udp.c:1.4 src/external/mpl/bind/dist/lib/isc/netmgr/udp.c:1.5 --- src/external/mpl/bind/dist/lib/isc/netmgr/udp.c:1.4 Fri Feb 19 11:42:20 2021 +++ src/external/mpl/bind/dist/lib/isc/netmgr/udp.c Tue Mar 23 16:59:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: udp.c,v 1.4 2021/02/19 16:42:20 christos Exp $ */ +/* $NetBSD: udp.c,v 1.5 2021/03/23 20:59:03 christos Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -543,7 +543,7 @@ isc__nm_udp_send(isc_nmhandle_t *handle, if (isc_nm_tid() == rsock->tid) { isc__netievent_udpsend_t ievent -#ifndef __lint__ // XXX lint broken +#ifndef __lint__ // XXX: bug = { .sock = rsock, .req = uvreq, .peer = *peer } #endif ; Index: src/external/mpl/bind/dist/lib/ns/client.c diff -u src/external/mpl/bind/dist/lib/ns/client.c:1.12 src/external/mpl/bind/dist/lib/ns/client.c:1.13 --- src/external/mpl/bind/dist/lib/ns/client.c:1.12 Fri Feb 19 11:42:22 2021 +++ src/external/mpl/bind/dist/lib/ns/client.c Tue Mar 23 16:59:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: client.c,v 1.12 2021/02/19 16:42:22 christos Exp $ */ +/* $NetBSD: client.c,v 1.13 2021/03/23 20:59:03 christos Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -2311,8 +2311,7 @@ ns__client_setup(ns_client_t *client, ns * Retain these values from the existing client, but * zero every thing else. */ -#ifndef __lint__ -/* XXX: bug ? */ +#ifndef __lint__ // XXX: bug *client = (ns_client_t){ .magic = 0, .mctx = oldmctx, .manager = oldmgr, Index: src/external/mpl/bind/dist/lib/ns/interfacemgr.c diff -u src/external/mpl/bind/dist/lib/ns/interfacemgr.c:1.9 src/external/mpl/bind/dist/lib/ns/interfacemgr.c:1.10 --- src/external/mpl/bind/dist/lib/ns/interfacemgr.c:1.9 Fri Feb 19 11:42:22 2021 +++ src/external/mpl/bind/dist/lib/ns/interfacemgr.c Tue Mar 23 16:59:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: interfacemgr.c,v 1.9 2021/02/19 16:42:22 christos Exp $ */ +/* $NetBSD: interfacemgr.c,v 1.10 2021/03/23 20:59:03 christos Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -398,8 +398,7 @@ ns_interface_create(ns_interfacemgr_t *m REQUIRE(NS_INTERFACEMGR_VALID(mgr)); ifp = isc_mem_get(mgr->mctx, sizeof(*ifp)); -#ifndef __lint__ -/* XXX: bug? */ +#ifndef __lint__ // XXX: bug *ifp = (ns_interface_t){ .generation = mgr->generation,
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Tue Mar 23 20:57:40 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: cgram.y lex.c Log Message: Add _Alignas() To generate a diff of this commit: cvs rdiff -u -r1.198 -r1.199 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/lint1/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.198 src/usr.bin/xlint/lint1/cgram.y:1.199 --- src/usr.bin/xlint/lint1/cgram.y:1.198 Tue Mar 23 14:40:50 2021 +++ src/usr.bin/xlint/lint1/cgram.y Tue Mar 23 16:57:40 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.198 2021/03/23 18:40:50 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.199 2021/03/23 20:57:40 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.198 2021/03/23 18:40:50 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.199 2021/03/23 20:57:40 christos Exp $"); #endif #include @@ -123,7 +123,7 @@ anonymize(sym_t *s) } %} -%expect 134 +%expect 165 %union { val_t *y_val; @@ -149,6 +149,7 @@ anonymize(sym_t *s) %token T_BUILTIN_OFFSETOF %token T_TYPEOF %token T_EXTENSION +%token T_ALIGNAS %token T_ALIGNOF %token T_ASTERISK %token T_MULTIPLICATIVE @@ -605,12 +606,19 @@ type_attribute_spec_list: | type_attribute_spec_list T_COMMA type_attribute_spec ; +align_as: + typespec + | constant_expr + ; + type_attribute: T_ATTRIBUTE T_LPAREN T_LPAREN { attron = true; } type_attribute_spec_list { attron = false; } T_RPAREN T_RPAREN + | T_ALIGNAS T_LPAREN align_as T_RPAREN { + } | T_PACKED { addpacked(); } Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.15 src/usr.bin/xlint/lint1/lex.c:1.16 --- src/usr.bin/xlint/lint1/lex.c:1.15 Sun Mar 21 10:49:21 2021 +++ src/usr.bin/xlint/lint1/lex.c Tue Mar 23 16:57:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.15 2021/03/21 14:49:21 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.16 2021/03/23 20:57:40 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.15 2021/03/21 14:49:21 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.16 2021/03/23 20:57:40 christos Exp $"); #endif #include @@ -135,6 +135,7 @@ static struct kwtab { kwdef_type( "__uint128_t", UINT128, 0,1,0,0,1), #endif kwdef_tqual( "__thread", THREAD, 0,0,1,0,1), + kwdef_token( "_Alignas", T_ALIGNAS, 0,0,0,0,1), kwdef_token( "_Alignof", T_ALIGNOF, 0,0,0,0,1), kwdef_type( "_Bool", BOOL, 0,1,0,0,1), kwdef_type( "_Complex", COMPLEX, 0,1,0,0,1),
CVS commit: src/external/mpl/bind/dist/lib/isc/unix/include/isc
Module Name:src Committed By: christos Date: Tue Mar 23 20:57:10 UTC 2021 Modified Files: src/external/mpl/bind/dist/lib/isc/unix/include/isc: align.h Log Message: We have _Alignas now To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h diff -u src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h:1.3 src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h:1.4 --- src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h:1.3 Fri Feb 19 11:42:20 2021 +++ src/external/mpl/bind/dist/lib/isc/unix/include/isc/align.h Tue Mar 23 16:57:10 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: align.h,v 1.3 2021/02/19 16:42:20 christos Exp $ */ +/* $NetBSD: align.h,v 1.4 2021/03/23 20:57:10 christos Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -18,8 +18,3 @@ #else /* ifdef HAVE_STDALIGN_H */ #define alignas(x) __attribute__((__aligned__(x))) #endif /* ifdef HAVE_STDALIGN_H */ -#ifdef __lint__ -// XXX: bug -#undef alignas -#define alignas(a) -#endif
CVS commit: src/external/mpl/bind/dist/lib/isc/netmgr
Module Name:src Committed By: christos Date: Tue Mar 23 20:56:25 UTC 2021 Modified Files: src/external/mpl/bind/dist/lib/isc/netmgr: netmgr-int.h Log Message: remove extra ;'s To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/external/mpl/bind/dist/lib/isc/netmgr/netmgr-int.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mpl/bind/dist/lib/isc/netmgr/netmgr-int.h diff -u src/external/mpl/bind/dist/lib/isc/netmgr/netmgr-int.h:1.4 src/external/mpl/bind/dist/lib/isc/netmgr/netmgr-int.h:1.5 --- src/external/mpl/bind/dist/lib/isc/netmgr/netmgr-int.h:1.4 Fri Feb 19 11:42:20 2021 +++ src/external/mpl/bind/dist/lib/isc/netmgr/netmgr-int.h Tue Mar 23 16:56:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netmgr-int.h,v 1.4 2021/02/19 16:42:20 christos Exp $ */ +/* $NetBSD: netmgr-int.h,v 1.5 2021/03/23 20:56:25 christos Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -364,13 +364,13 @@ typedef struct isc__netievent__socket { } isc__netievent__socket_t; #define NETIEVENT_SOCKET_TYPE(type) \ - typedef isc__netievent__socket_t isc__netievent_##type##_t; + typedef isc__netievent__socket_t isc__netievent_##type##_t #define NETIEVENT_SOCKET_DECL(type) \ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ isc_nm_t *nm, isc_nmsocket_t *sock); \ void isc__nm_put_netievent_##type(isc_nm_t *nm, \ - isc__netievent_##type##_t *ievent); + isc__netievent_##type##_t *ievent) #define NETIEVENT_SOCKET_DEF(type) \ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ @@ -394,13 +394,13 @@ typedef struct isc__netievent__socket_re } isc__netievent__socket_req_t; #define NETIEVENT_SOCKET_REQ_TYPE(type) \ - typedef isc__netievent__socket_req_t isc__netievent_##type##_t; + typedef isc__netievent__socket_req_t isc__netievent_##type##_t #define NETIEVENT_SOCKET_REQ_DECL(type)\ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ isc_nm_t *nm, isc_nmsocket_t *sock, isc__nm_uvreq_t *req); \ void isc__nm_put_netievent_##type(isc_nm_t *nm,\ - isc__netievent_##type##_t *ievent); + isc__netievent_##type##_t *ievent) #define NETIEVENT_SOCKET_REQ_DEF(type) \ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ @@ -427,14 +427,14 @@ typedef struct isc__netievent__socket_re } isc__netievent__socket_req_result_t; #define NETIEVENT_SOCKET_REQ_RESULT_TYPE(type) \ - typedef isc__netievent__socket_req_result_t isc__netievent_##type##_t; + typedef isc__netievent__socket_req_result_t isc__netievent_##type##_t #define NETIEVENT_SOCKET_REQ_RESULT_DECL(type)\ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ isc_nm_t *nm, isc_nmsocket_t *sock, isc__nm_uvreq_t *req, \ isc_result_t result); \ void isc__nm_put_netievent_##type(isc_nm_t *nm, \ - isc__netievent_##type##_t *ievent); + isc__netievent_##type##_t *ievent) #define NETIEVENT_SOCKET_REQ_RESULT_DEF(type) \ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ @@ -461,13 +461,13 @@ typedef struct isc__netievent__socket_ha } isc__netievent__socket_handle_t; #define NETIEVENT_SOCKET_HANDLE_TYPE(type) \ - typedef isc__netievent__socket_handle_t isc__netievent_##type##_t; + typedef isc__netievent__socket_handle_t isc__netievent_##type##_t #define NETIEVENT_SOCKET_HANDLE_DECL(type) \ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ isc_nm_t *nm, isc_nmsocket_t *sock, isc_nmhandle_t *handle); \ void isc__nm_put_netievent_##type(isc_nm_t *nm, \ - isc__netievent_##type##_t *ievent); + isc__netievent_##type##_t *ievent) #define NETIEVENT_SOCKET_HANDLE_DEF(type) \ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ @@ -493,13 +493,13 @@ typedef struct isc__netievent__socket_qu } isc__netievent__socket_quota_t; #define NETIEVENT_SOCKET_QUOTA_TYPE(type) \ - typedef isc__netievent__socket_quota_t isc__netievent_##type##_t; + typedef isc__netievent__socket_quota_t isc__netievent_##type##_t #define NETIEVENT_SOCKET_QUOTA_DECL(type)\ isc__netievent_##type##_t *isc__nm_get_netievent_##type( \ isc_nm_t *nm, isc_nmsocket_t *sock, isc_quota_t *quota); \ void isc__nm_put_netievent_##type(isc_nm_t *nm, \ - isc__netievent_##type##_t *ievent); + isc__netievent_##type##_t *ievent) #define NETIEVENT_SOCKET_QUOTA_DEF(type)
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Mar 23 20:21:08 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: init.c Log Message: lint: extract init_using_assign from init_using_expr No functional change. To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.113 src/usr.bin/xlint/lint1/init.c:1.114 --- src/usr.bin/xlint/lint1/init.c:1.113 Tue Mar 23 20:14:55 2021 +++ src/usr.bin/xlint/lint1/init.c Tue Mar 23 20:21:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.113 2021/03/23 20:14:55 rillig Exp $ */ +/* $NetBSD: init.c,v 1.114 2021/03/23 20:21:07 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.113 2021/03/23 20:14:55 rillig Exp $"); +__RCSID("$NetBSD: init.c,v 1.114 2021/03/23 20:21:07 rillig Exp $"); #endif #include @@ -966,6 +966,30 @@ check_non_constant_initializer(const tno } } +/* + * Local initialization of non-array-types with only one expression without + * braces is done by ASSIGN. + */ +static bool +init_using_assign(tnode_t *rn) +{ + tnode_t *ln, *tn; + + if (initsym->s_type->t_tspec == ARRAY) + return false; + if (initstk->i_enclosing != NULL) + return false; + + debug_step("handing over to ASSIGN"); + ln = new_name_node(initsym, 0); + ln->tn_type = tduptyp(ln->tn_type); + ln->tn_type->t_const = false; + tn = build(ASSIGN, ln, rn); + expr(tn, false, false, false, false); + /* XXX: why not clean up the initstack here already? */ + return true; +} + void init_using_expr(tnode_t *tn) { @@ -992,21 +1016,8 @@ init_using_expr(tnode_t *tn) * be enclosed by braces. */ - /* - * Local initialization of non-array-types with only one expression - * without braces is done by ASSIGN - */ - if ((sclass == AUTO || sclass == REG) && - initsym->s_type->t_tspec != ARRAY && initstk->i_enclosing == NULL) { - debug_step("handing over to ASSIGN"); - ln = new_name_node(initsym, 0); - ln->tn_type = tduptyp(ln->tn_type); - ln->tn_type->t_const = false; - tn = build(ASSIGN, ln, tn); - expr(tn, false, false, false, false); - /* XXX: why not clean up the initstack here already? */ + if ((sclass == AUTO || sclass == REG) && init_using_assign(tn)) goto done; - } initstack_pop_nobrace();
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Mar 23 20:14:55 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: init.c Log Message: lint: merge duplicate code in init_using_expr No functional change. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.112 src/usr.bin/xlint/lint1/init.c:1.113 --- src/usr.bin/xlint/lint1/init.c:1.112 Tue Mar 23 18:51:43 2021 +++ src/usr.bin/xlint/lint1/init.c Tue Mar 23 20:14:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.112 2021/03/23 18:51:43 rillig Exp $ */ +/* $NetBSD: init.c,v 1.113 2021/03/23 20:14:55 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.112 2021/03/23 18:51:43 rillig Exp $"); +__RCSID("$NetBSD: init.c,v 1.113 2021/03/23 20:14:55 rillig Exp $"); #endif #include @@ -980,10 +980,8 @@ init_using_expr(tnode_t *tn) debug_step("expr:"); debug_node(tn, debug_ind + 1); - if (initerr || tn == NULL) { - debug_leave(); - return; - } + if (initerr || tn == NULL) + goto done; sclass = initsym->s_scl; @@ -1007,8 +1005,7 @@ init_using_expr(tnode_t *tn) tn = build(ASSIGN, ln, tn); expr(tn, false, false, false, false); /* XXX: why not clean up the initstack here already? */ - debug_leave(); - return; + goto done; } initstack_pop_nobrace(); @@ -1016,17 +1013,12 @@ init_using_expr(tnode_t *tn) if (init_array_using_string(tn)) { debug_step("after initializing the string:"); /* XXX: why not clean up the initstack here already? */ - debug_initstack(); - debug_leave(); - return; + goto done_initstack; } initstack_next_nobrace(); - if (initerr || tn == NULL) { - debug_initstack(); - debug_leave(); - return; - } + if (initerr || tn == NULL) + goto done_initstack; initstk->i_remaining--; debug_step("%d elements remaining", initstk->i_remaining); @@ -1048,11 +1040,8 @@ init_using_expr(tnode_t *tn) debug_step("typeok '%s', '%s'", type_name(ln->tn_type), type_name(tn->tn_type)); - if (!typeok(INIT, 0, ln, tn)) { - debug_initstack(); - debug_leave(); - return; - } + if (!typeok(INIT, 0, ln, tn)) + goto done_initstack; /* * Store the tree memory. This is necessary because otherwise @@ -1072,7 +1061,9 @@ init_using_expr(tnode_t *tn) check_non_constant_initializer(tn, sclass); +done_initstack: debug_initstack(); +done: debug_leave(); }
CVS commit: src/sys/arch/sparc64/doc
Module Name:src Committed By: palle Date: Tue Mar 23 19:13:46 UTC 2021 Modified Files: src/sys/arch/sparc64/doc: TODO Log Message: sun4v: update TODO with findings related to crashes in user processes (pcbspill) To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sparc64/doc/TODO 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/sparc64/doc/TODO diff -u src/sys/arch/sparc64/doc/TODO:1.38 src/sys/arch/sparc64/doc/TODO:1.39 --- src/sys/arch/sparc64/doc/TODO:1.38 Tue Mar 16 20:11:30 2021 +++ src/sys/arch/sparc64/doc/TODO Tue Mar 23 19:13:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: TODO,v 1.38 2021/03/16 20:11:30 palle Exp $ */ +/* $NetBSD: TODO,v 1.39 2021/03/23 19:13:46 palle Exp $ */ Things to be done: @@ -17,8 +17,9 @@ sun4v: - ldom virtual network interface (vnet) is working (verified by exiting sysinst and issuing a ping command) - the sysinst tool starts, disk setup is working, - but the process crashes when selecting network installtion method - (probably due to trashing of user proces registers) + but the process crashes when selecting network installation method + (the pcbspill function in locore.s incorrectly only spills one register + window even if more than one is are present) T2000 ldom with 8 VCPU and 4GB: On this platform it crashes in /sbin/init doing an access() call where %o0 is corrupted (zero) - idle handling - call hypervisor trap (openbsd code...??)
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Mar 23 18:51:43 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: init.c Log Message: lint: fix documentation about optional braces in initializers To generate a diff of this commit: cvs rdiff -u -r1.111 -r1.112 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.111 src/usr.bin/xlint/lint1/init.c:1.112 --- src/usr.bin/xlint/lint1/init.c:1.111 Tue Mar 23 18:40:50 2021 +++ src/usr.bin/xlint/lint1/init.c Tue Mar 23 18:51:43 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.111 2021/03/23 18:40:50 rillig Exp $ */ +/* $NetBSD: init.c,v 1.112 2021/03/23 18:51:43 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.111 2021/03/23 18:40:50 rillig Exp $"); +__RCSID("$NetBSD: init.c,v 1.112 2021/03/23 18:51:43 rillig Exp $"); #endif #include @@ -61,10 +61,10 @@ __RCSID("$NetBSD: init.c,v 1.111 2021/03 * struct { int x, y; } point = { 3, 4 }; * struct { int x, y; } point = { .y = 3, .x = 4 }; * - * The initializer that follows the '=' may be surrounded by an extra pair of - * braces, like in the example 'number_with_braces'. For multi-dimensional - * arrays, the inner braces may be omitted like in array_flat or spelled out - * like in array_nested. + * Any scalar expression in the initializer may be surrounded by an extra pair + * of braces, like in the example 'number_with_braces' (C99 6.7.8p11). For + * multi-dimensional arrays, the inner braces may be omitted like in + * array_flat or spelled out like in array_nested. * * For the initializer, the grammar parser calls these functions: *
CVS commit: src/external/mpl/bind/dist/lib/dns
Module Name:src Committed By: rillig Date: Tue Mar 23 18:46:07 UTC 2021 Modified Files: src/external/mpl/bind/dist/lib/dns: rbtdb.c Log Message: bind: remove the workaround for a bug in lint for compound literals This bug has been fixed in init.c 1.111 from a few minutes ago. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/external/mpl/bind/dist/lib/dns/rbtdb.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/mpl/bind/dist/lib/dns/rbtdb.c diff -u src/external/mpl/bind/dist/lib/dns/rbtdb.c:1.10 src/external/mpl/bind/dist/lib/dns/rbtdb.c:1.11 --- src/external/mpl/bind/dist/lib/dns/rbtdb.c:1.10 Mon Mar 22 15:12:24 2021 +++ src/external/mpl/bind/dist/lib/dns/rbtdb.c Tue Mar 23 18:46:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rbtdb.c,v 1.10 2021/03/22 15:12:24 rillig Exp $ */ +/* $NetBSD: rbtdb.c,v 1.11 2021/03/23 18:46:07 rillig Exp $ */ /* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") @@ -892,13 +892,9 @@ update_rrsetstats(dns_rbtdb_t *rbtdb, co dns_rdatastatstype_t statattributes = 0; dns_rdatastatstype_t base = 0; dns_rdatastatstype_t type; -#ifdef __lint__ // XXX: bug in lint; see msg_171.c 1.3 - rdatasetheader_t *header; -#else rdatasetheader_t *header = &(rdatasetheader_t){ .type = htype, .attributes = ATOMIC_VAR_INIT(hattributes) }; -#endif if (!do_stats(header)) { return;
CVS commit: src
Module Name:src Committed By: rillig Date: Tue Mar 23 18:40:50 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: msg_171.c msg_171.exp src/usr.bin/xlint/lint1: cgram.y decl.c externs1.h init.c Log Message: lint: fix wrong error message about type mismatch in compound literal Now that the code contains explicit markers for starting and ending an initialization, and having the guarantee that an assertion fails whenever some code accesses the state of the "current initialization" even though there is no ongoing initialization gives me much more confidence in the correctness of the code. The calls to begin_initialization and end_initialization always appear in pairs, enclosing the minimal amount of code necessary for initialization. In a nutshell, global modifiable state is error-prone and hard to understand. A nice side effect is that the grammar no longer needs a special rule for the outermost initializer since the functions for the debug logging are now called explicitly. The code that misuses the initialization state just because it needs to temporarily store a sym_t somewhere is now clearly marked as such. A GCC statement expression can appear anywhere and is therefore independent of the initialization. Most probably the code can simply refer to the local variable in the grammar rule itself, or this variable needs to be encoded in the grammar %union. For sure there is a better way to handle this. There is no longer a need that the function 'declare' initializes the initialization state, it was just the wrong place to do this. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_171.c \ src/tests/usr.bin/xlint/lint1/msg_171.exp cvs rdiff -u -r1.197 -r1.198 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.158 -r1.159 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.83 -r1.84 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.110 -r1.111 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/msg_171.c diff -u src/tests/usr.bin/xlint/lint1/msg_171.c:1.5 src/tests/usr.bin/xlint/lint1/msg_171.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_171.c:1.5 Mon Mar 22 16:51:24 2021 +++ src/tests/usr.bin/xlint/lint1/msg_171.c Tue Mar 23 18:40:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_171.c,v 1.5 2021/03/22 16:51:24 rillig Exp $ */ +/* $NetBSD: msg_171.c,v 1.6 2021/03/23 18:40:50 rillig Exp $ */ # 3 "msg_171.c" // Test for message: cannot assign to '%s' from '%s' [171] @@ -23,6 +23,11 @@ example(int i, void *vp, struct s *s) * with automatic storage duration, like any normal named object. It is an * lvalue, which means that it is possible to take the address of the object. * Seen in external/mpl/bind/dist/lib/dns/rbtdb.c, update_rrsetstats. + * + * Before init.c 1.111 from 2021-03-23, lint could not handle these nested + * initializations (the outer one for the variable 'p', the inner one for the + * compound literal) and wrongly complained about a type mismatch between + * 'struct point' and 'pointer to struct point'. */ void pointer_to_compound_literal(void) @@ -33,21 +38,5 @@ pointer_to_compound_literal(void) }; struct point *p = &(struct point){ 12, 5, - }; /* expect: 171 *//*FIXME*/ - /* - * FIXME: The type mismatch in the above line occurs because lint - * wrongly assumes that there is only ever a single initialization - * going on, which takes place in initstk. - * - * In the debug log, this is marked by the two calls to initstack_init - * that are happily intermixed with 'begin initialization' and 'end - * initialization'. This was not planned for, and it worked well - * before C99, since compound literals are a new feature from C99. - * - * The proper fix, as for so many similar problems is to not use - * global variables for things that have a limited lifetime, but - * instead let the grammar determine the lifetime and scope of these - * objects, which makes them only accessible when they can actually be - * used. - */ + }; } Index: src/tests/usr.bin/xlint/lint1/msg_171.exp diff -u src/tests/usr.bin/xlint/lint1/msg_171.exp:1.5 src/tests/usr.bin/xlint/lint1/msg_171.exp:1.6 --- src/tests/usr.bin/xlint/lint1/msg_171.exp:1.5 Mon Mar 22 15:29:43 2021 +++ src/tests/usr.bin/xlint/lint1/msg_171.exp Tue Mar 23 18:40:50 2021 @@ -2,4 +2,3 @@ msg_171.c(14): error: cannot assign to ' msg_171.c(15): error: cannot assign to 'struct s' from 'int' [171] msg_171.c(17): error: cannot assign to 'pointer to void' from 'struct s' [171] msg_171.c(18): error: cannot assign to 'struct s' from 'pointer to void' [171] -msg_171.c(36): error: cannot assign to 'struct point' from 'pointer to struct point' [171] Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.197 src/usr.bin/xlint/lint1/cgram.y:1.198 ---
CVS commit: src/usr.sbin/rtadvd
Module Name:src Committed By: christos Date: Tue Mar 23 18:16:53 UTC 2021 Modified Files: src/usr.sbin/rtadvd: advcap.c config.c dump.c if.c timer.c Log Message: print function names as %s: not <%s> everywhere for consistency. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/rtadvd/advcap.c cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/rtadvd/config.c cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/rtadvd/dump.c cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/rtadvd/if.c cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/rtadvd/timer.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.sbin/rtadvd/advcap.c diff -u src/usr.sbin/rtadvd/advcap.c:1.18 src/usr.sbin/rtadvd/advcap.c:1.19 --- src/usr.sbin/rtadvd/advcap.c:1.18 Sat Feb 2 22:19:31 2019 +++ src/usr.sbin/rtadvd/advcap.c Tue Mar 23 14:16:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: advcap.c,v 1.18 2019/02/03 03:19:31 mrg Exp $ */ +/* $NetBSD: advcap.c,v 1.19 2021/03/23 18:16:53 christos Exp $ */ /* $KAME: advcap.c,v 1.11 2003/05/19 09:46:50 keiichi Exp $ */ /* @@ -139,7 +139,7 @@ getent(char *bp, char *name, char *cp) tf = open(RM = cp, O_RDONLY); } if (tf < 0) { - logit(LOG_INFO, "<%s> open: %m", __func__); + logit(LOG_INFO, "%s: open `%s': %m", __func__, cp); return (-2); } for (;;) { Index: src/usr.sbin/rtadvd/config.c diff -u src/usr.sbin/rtadvd/config.c:1.45 src/usr.sbin/rtadvd/config.c:1.46 --- src/usr.sbin/rtadvd/config.c:1.45 Mon Mar 22 14:41:11 2021 +++ src/usr.sbin/rtadvd/config.c Tue Mar 23 14:16:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: config.c,v 1.45 2021/03/22 18:41:11 christos Exp $ */ +/* $NetBSD: config.c,v 1.46 2021/03/23 18:16:53 christos Exp $ */ /* $KAME: config.c,v 1.93 2005/10/17 14:40:02 suz Exp $ */ /* @@ -169,44 +169,46 @@ getconfig(const char *intface, int exith struct rdnss *rdnss; struct dnssl *dnssl; -#define MUSTHAVE(var, cap) \ +#define MUSTHAVE(var, cap) \ do {\ int64_t t; \ if ((t = agetnum(cap)) < 0) { \ - fprintf(stderr, "rtadvd: need %s for interface %s\n", \ - cap, intface); \ + logit(LOG_ERR, "%s: need %s for interface %s", \ + __func__, cap, intface);\ goto errexit; \ }\ var = t; \ - } while (0) -#define MAYHAVE(var, cap, def) \ + } while (/*CONSTCOND*/0) + +#define MAYHAVE(var, cap, def) \ do {\ if ((var = agetnum(cap)) < 0) \ var = def; \ - } while (0) -#define ELM_MALLOC(p) \ + } while (/*CONSTCOND*/0) + +#define ELM_MALLOC(p) \ do {\ p = calloc(1, sizeof(*p));\ if (p == NULL) { \ - logit(LOG_ERR, "<%s> calloc failed: %m", \ + logit(LOG_ERR, "%s: calloc failed: %m", \ __func__); \ goto errexit; \ } \ } while(/*CONSTCOND*/0) if (if_nametoindex(intface) == 0) { - logit(LOG_INFO, "<%s> interface %s not found, ignoring", + logit(LOG_INFO, "%s: interface %s not found, ignoring", __func__, intface); return; } - logit(LOG_DEBUG, "<%s> loading configuration for interface %s", + logit(LOG_DEBUG, "%s: loading configuration for interface %s", __func__, intface); if ((stat = agetent(tbuf, intface)) <= 0) { memset(tbuf, 0, sizeof(tbuf)); logit(LOG_INFO, - "<%s> %s isn't defined in the configuration file" + "%s: %s isn't defined in the configuration file" " or the configuration file doesn't exist." " Treat it as default", __func__, intface); @@ -222,7 +224,7 @@ getconfig(const char *intface, int exith /* check if we are allowed to forward packets (if not determined) */ if (forwarding < 0) { if ((forwarding = getinet6sysctl(IPV6CTL_FORWARDING)) < 0) - exit(1); + exit(EXIT_FAILURE); } /* get interface information */ @@ -233,7 +235,7 @@ getconfig(const char *intface, int exith if (tmp->advlinkopt) { if ((tmp->sdl = if_nametosdl(intface)) == NULL) { logit(LOG_ERR, - "<%s> can't get information of %s", + "%s: can't get information of %s", __func__, intface); goto errexit; } @@ -242,7 +244,7 @@ getconfig(const char *intface, int exith tmp->ifindex = if_nametoindex(intface); if (tmp->ifindex == 0) { logit(LOG_ERR, - "<%s> can't get information of %s", + "%s: can't get information of %s", __func__, intface); goto errexit; } @@ -252,7 +254,7 @@ getconfig(const char *intface, int exith if ((tmp->phymtu = if_getmtu(intface)) == 0) { tmp->phymtu = IPV6_MMTU; logit(LOG_WARNING, - "<%s> can't get interface mtu of %s. Treat as %d", + "%s: can't get interface mtu of %s. Treat as %d", __func__, intface, IPV6_MMTU); } @@ -262,7 +264,7 @@ getconfig(const char *intface, int exith MAYHAVE(val, "maxinterval", DEF_MAXRTRADVINTERVAL); if (val < MIN_MAXINTERVAL || val > MAX_MAXINTERVAL) {
CVS commit: src/usr.sbin/rtadvd
Module Name:src Committed By: christos Date: Tue Mar 23 18:16:21 UTC 2021 Modified Files: src/usr.sbin/rtadvd: if.c if.h Log Message: interface indexes are unsigned To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/rtadvd/if.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/rtadvd/if.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rtadvd/if.c diff -u src/usr.sbin/rtadvd/if.c:1.27 src/usr.sbin/rtadvd/if.c:1.28 --- src/usr.sbin/rtadvd/if.c:1.27 Mon Mar 22 14:41:11 2021 +++ src/usr.sbin/rtadvd/if.c Tue Mar 23 14:16:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.27 2021/03/22 18:41:11 christos Exp $ */ +/* $NetBSD: if.c,v 1.28 2021/03/23 18:16:21 christos Exp $ */ /* $KAME: if.c,v 1.36 2004/11/30 22:32:01 suz Exp $ */ /* @@ -132,7 +132,7 @@ if_getmtu(const char *name) /* give interface index and its old flags, then new flags returned */ int -if_getflags(int ifindex, int oifflags) +if_getflags(unsigned int ifindex, int oifflags) { struct ifreq ifr; int s; @@ -194,7 +194,8 @@ lladdropt_fill(struct sockaddr_dl *sdl, #define SIN6(s) ((const struct sockaddr_in6 *)(s)) #define SDL(s) ((const struct sockaddr_dl *)(s)) char * -get_next_msg(char *buf, char *lim, int ifindex, size_t *lenp, int filter) +get_next_msg(char *buf, char *lim, unsigned int ifindex, size_t *lenp, +int filter) { struct rt_msghdr *rtm; struct ifa_msghdr *ifam; @@ -294,7 +295,7 @@ get_addr(const void *buf) return (rti_info[RTAX_DST])->sin6_addr; } -int +unsigned int get_rtm_ifindex(const void *buf) { const struct rt_msghdr *rtm = buf; @@ -306,20 +307,20 @@ get_rtm_ifindex(const void *buf) return SDL(rti_info[RTAX_GATEWAY])->sdl_index; } -int +unsigned int get_ifm_ifindex(const void *buf) { const struct if_msghdr *ifm = buf; - return (int)ifm->ifm_index; + return ifm->ifm_index; } -int +unsigned int get_ifam_ifindex(const void *buf) { const struct ifa_msghdr *ifam = buf; - return (int)ifam->ifam_index; + return ifam->ifam_index; } int @@ -331,12 +332,12 @@ get_ifm_flags(const void *buf) } #ifdef RTM_IFANNOUNCE -int +unsigned int get_ifan_ifindex(const void *buf) { const struct if_announcemsghdr *ifan = buf; - return (int)ifan->ifan_index; + return ifan->ifan_index; } int Index: src/usr.sbin/rtadvd/if.h diff -u src/usr.sbin/rtadvd/if.h:1.12 src/usr.sbin/rtadvd/if.h:1.13 --- src/usr.sbin/rtadvd/if.h:1.12 Mon Mar 22 14:41:11 2021 +++ src/usr.sbin/rtadvd/if.h Tue Mar 23 14:16:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: if.h,v 1.12 2021/03/22 18:41:11 christos Exp $ */ +/* $NetBSD: if.h,v 1.13 2021/03/23 18:16:21 christos Exp $ */ /* $KAME: if.h,v 1.12 2003/09/21 07:17:03 itojun Exp $ */ /* @@ -35,17 +35,17 @@ struct nd_opt_hdr; struct sockaddr_dl *if_nametosdl(const char *); int if_getmtu(const char *); -int if_getflags(int, int); +int if_getflags(unsigned int, int); int lladdropt_length(struct sockaddr_dl *); void lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *); -char *get_next_msg(char *, char *, int, size_t *, int); +char *get_next_msg(char *, char *, unsigned int, size_t *, int); const struct in6_addr *get_addr(const void *); -int get_rtm_ifindex(const void *); -int get_ifm_ifindex(const void *); -int get_ifam_ifindex(const void *); +unsigned int get_rtm_ifindex(const void *); +unsigned int get_ifm_ifindex(const void *); +unsigned int get_ifam_ifindex(const void *); int get_ifm_flags(const void *); #ifdef RTM_IFANNOUNCE -int get_ifan_ifindex(const void *); +unsigned int get_ifan_ifindex(const void *); int get_ifan_what(const void *); #endif int get_prefixlen(const void *);
CVS commit: src/usr.sbin/rtadvd
Module Name:src Committed By: christos Date: Tue Mar 23 18:13:07 UTC 2021 Modified Files: src/usr.sbin/rtadvd: rtadvd.c Log Message: call tzset() before chroot so we initialize our timezone data To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/usr.sbin/rtadvd/rtadvd.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.sbin/rtadvd/rtadvd.c diff -u src/usr.sbin/rtadvd/rtadvd.c:1.81 src/usr.sbin/rtadvd/rtadvd.c:1.82 --- src/usr.sbin/rtadvd/rtadvd.c:1.81 Tue Mar 23 14:06:19 2021 +++ src/usr.sbin/rtadvd/rtadvd.c Tue Mar 23 14:13:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rtadvd.c,v 1.81 2021/03/23 18:06:19 christos Exp $ */ +/* $NetBSD: rtadvd.c,v 1.82 2021/03/23 18:13:07 christos Exp $ */ /* $KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $ */ /* @@ -283,6 +283,7 @@ main(int argc, char *argv[]) set[1].fd = -1; logit(LOG_INFO, "dropping privileges to %s", RTADVD_USER); + tzset(); if (prog_chroot(pw->pw_dir) == -1) { logit(LOG_ERR, "chroot: %s: %m", pw->pw_dir); return EXIT_FAILURE;
CVS commit: src/usr.sbin/rtadvd
Module Name:src Committed By: christos Date: Tue Mar 23 18:06:19 UTC 2021 Modified Files: src/usr.sbin/rtadvd: rtadvd.c Log Message: fix misplaced paren, add missing va_end() To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/usr.sbin/rtadvd/rtadvd.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.sbin/rtadvd/rtadvd.c diff -u src/usr.sbin/rtadvd/rtadvd.c:1.80 src/usr.sbin/rtadvd/rtadvd.c:1.81 --- src/usr.sbin/rtadvd/rtadvd.c:1.80 Mon Mar 22 14:41:11 2021 +++ src/usr.sbin/rtadvd/rtadvd.c Tue Mar 23 14:06:19 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rtadvd.c,v 1.80 2021/03/22 18:41:11 christos Exp $ */ +/* $NetBSD: rtadvd.c,v 1.81 2021/03/23 18:06:19 christos Exp $ */ /* $KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $ */ /* @@ -1615,7 +1615,7 @@ rtsock_open(void) } #ifdef RO_MSGFILTER if (prog_setsockopt(rtsock, PF_ROUTE, RO_MSGFILTER, - , sizeof(msgfilter) == -1)) + , sizeof(msgfilter)) == -1) logit(LOG_ERR, "%s: RO_MSGFILTER: %m", __func__); #endif } @@ -1804,13 +1804,14 @@ logit(int level, const char *fmt, ...) va_start(ap, fmt); if (!Dflag && after_daemon) { vsyslog(level, fmt, ap); - va_end(ap); - return; + goto out; + } + if (level >= LOG_INFO && !dflag) { + goto out; } - if (level >= LOG_INFO && !dflag) - return; vwarnx(expandm(fmt, "", ), ap); free(buf); +out: va_end(ap); }
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Mar 23 17:36:56 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: cgram.y decl.c externs1.h init.c Log Message: lint: add indirection for accessing the current initialization This indirection will be needed to handle nested initializations, which are a new feature of C99. These are currently not handled correctly, see msg_171.c. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.196 -r1.197 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.157 -r1.158 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.82 -r1.83 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.109 -r1.110 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.196 src/usr.bin/xlint/lint1/cgram.y:1.197 --- src/usr.bin/xlint/lint1/cgram.y:1.196 Sun Mar 21 14:49:21 2021 +++ src/usr.bin/xlint/lint1/cgram.y Tue Mar 23 17:36:55 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.196 2021/03/21 14:49:21 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.197 2021/03/23 17:36:55 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.196 2021/03/21 14:49:21 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.197 2021/03/23 17:36:55 rillig Exp $"); #endif #include @@ -1885,24 +1885,24 @@ term: expr_statement_list { block_level--; mem_block_level--; - initsym = mktempsym(duptyp($4->tn_type)); + *current_initsym() = mktempsym(duptyp($4->tn_type)); mem_block_level++; block_level++; /* ({ }) is a GCC extension */ gnuism(320); } compound_statement_rbrace T_RPAREN { - $$ = new_name_node(initsym, 0); + $$ = new_name_node(*current_initsym(), 0); } | T_LPAREN compound_statement_lbrace expr_statement_list { block_level--; mem_block_level--; - initsym = mktempsym($3->tn_type); + *current_initsym() = mktempsym($3->tn_type); mem_block_level++; block_level++; /* ({ }) is a GCC extension */ gnuism(320); } compound_statement_rbrace T_RPAREN { - $$ = new_name_node(initsym, 0); + $$ = new_name_node(*current_initsym(), 0); } | term T_INCDEC { $$ = build($2 == INC ? INCAFT : DECAFT, $1, NULL); @@ -1995,7 +1995,7 @@ term: if (!Sflag) /* compound literals are a C9X/GCC extension */ gnuism(319); - $$ = new_name_node(initsym, 0); + $$ = new_name_node(*current_initsym(), 0); } ; Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.157 src/usr.bin/xlint/lint1/decl.c:1.158 --- src/usr.bin/xlint/lint1/decl.c:1.157 Sun Mar 21 20:18:45 2021 +++ src/usr.bin/xlint/lint1/decl.c Tue Mar 23 17:36:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.157 2021/03/21 20:18:45 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.158 2021/03/23 17:36:56 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.157 2021/03/21 20:18:45 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.158 2021/03/23 17:36:56 rillig Exp $"); #endif #include @@ -1896,8 +1896,8 @@ declare(sym_t *decl, bool initflg, sbuf_ { char *s; - initerr = false; - initsym = decl; + *current_initerr() = false; + *current_initsym() = decl; switch (dcs->d_ctx) { case EXTERN: @@ -1929,7 +1929,7 @@ declare(sym_t *decl, bool initflg, sbuf_ break; } - if (initflg && !initerr) + if (initflg && !*current_initerr()) initstack_init(); } @@ -1946,7 +1946,7 @@ decl1ext(sym_t *dsym, bool initflg) check_type(dsym); - if (initflg && !(initerr = check_init(dsym))) + if (initflg && !(*current_initerr() = check_init(dsym))) dsym->s_def = DEF; /* @@ -2424,7 +2424,7 @@ declare_argument(sym_t *sym, bool initfl if (initflg) { /* cannot initialize parameter: %s */ error(52, sym->s_name); - initerr = true; + *current_initerr() = true; } if ((t = sym->s_type->t_tspec) == ARRAY) { @@ -2759,7 +2759,7 @@ declare_local(sym_t *dsym, bool initflg) } - if (initflg && !(initerr = check_init(dsym))) { + if (initflg && !(*current_initerr() = check_init(dsym))) { dsym->s_def = DEF; mark_as_set(dsym); } Index: src/usr.bin/xlint/lint1/externs1.h diff -u src/usr.bin/xlint/lint1/externs1.h:1.82 src/usr.bin/xlint/lint1/externs1.h:1.83 --- src/usr.bin/xlint/lint1/externs1.h:1.82 Sun Mar 21 19:08:10 2021 +++ src/usr.bin/xlint/lint1/externs1.h Tue Mar 23 17:36:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.82 2021/03/21 19:08:10 rillig Exp $ */ +/* $NetBSD: externs1.h,v 1.83 2021/03/23 17:36:56 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -292,8 +292,8 @@ extern void bitfieldtype(int); /* * init.c */ -extern bool initerr; -extern
CVS commit: src
Module Name:src Committed By: simonb Date: Tue Mar 23 13:22:40 UTC 2021 Modified Files: src/share/mk: bsd.kmodule.mk src/sys/arch/mips/conf: files.mips src/sys/arch/mips/mips: mips_machdep.c Added Files: src/sys/arch/mips/mips: kobj_machdep.c Log Message: Work in progress for MIPS modules. Only tested on mipseb64, not yet enabled anywhere. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/share/mk/bsd.kmodule.mk cvs rdiff -u -r1.82 -r1.83 src/sys/arch/mips/conf/files.mips cvs rdiff -u -r0 -r1.1 src/sys/arch/mips/mips/kobj_machdep.c cvs rdiff -u -r1.300 -r1.301 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/share/mk/bsd.kmodule.mk diff -u src/share/mk/bsd.kmodule.mk:1.74 src/share/mk/bsd.kmodule.mk:1.75 --- src/share/mk/bsd.kmodule.mk:1.74 Sun Mar 7 07:37:35 2021 +++ src/share/mk/bsd.kmodule.mk Tue Mar 23 13:22:40 2021 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.kmodule.mk,v 1.74 2021/03/07 07:37:35 rin Exp $ +# $NetBSD: bsd.kmodule.mk,v 1.75 2021/03/23 13:22:40 simonb Exp $ # We are not building this with PIE MKPIE=no @@ -63,6 +63,12 @@ CFLAGS+= -mabi=64 LDFLAGS+= -Wl,-m,elf64ltsmip .endif +.if ${MACHINE_CPU} == "mips" +# We can't use -msym32 with -mlong-calls as -msym32 forces all addresses +# to be 32-bit which defeats the whole purpose of long calls. +CFLAGS+= -mlong-calls +.endif + .if ${MACHINE_CPU} == "sparc64" # force same memory model as rest of the kernel CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mcmodel=medlow :} Index: src/sys/arch/mips/conf/files.mips diff -u src/sys/arch/mips/conf/files.mips:1.82 src/sys/arch/mips/conf/files.mips:1.83 --- src/sys/arch/mips/conf/files.mips:1.82 Tue Mar 23 11:41:53 2021 +++ src/sys/arch/mips/conf/files.mips Tue Mar 23 13:22:40 2021 @@ -1,4 +1,4 @@ -# $NetBSD: files.mips,v 1.82 2021/03/23 11:41:53 simonb Exp $ +# $NetBSD: files.mips,v 1.83 2021/03/23 13:22:40 simonb Exp $ # defflag opt_cputype.h NOFPU FPEMUL @@ -45,6 +45,7 @@ file arch/mips/mips/db_interface.c ddb file arch/mips/mips/db_trace.c ddb file arch/mips/mips/ipifuncs.c multiprocessor file arch/mips/mips/kgdb_machdep.c kgdb +file arch/mips/mips/kobj_machdep.c modular file arch/mips/mips/pmap_machdep.c file arch/mips/mips/mips_stacktrace.c file uvm/pmap/pmap.c Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.300 src/sys/arch/mips/mips/mips_machdep.c:1.301 --- src/sys/arch/mips/mips/mips_machdep.c:1.300 Wed Sep 2 01:33:27 2020 +++ src/sys/arch/mips/mips/mips_machdep.c Tue Mar 23 13:22:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.300 2020/09/02 01:33:27 simonb Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.301 2021/03/23 13:22:40 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.300 2020/09/02 01:33:27 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.301 2021/03/23 13:22:40 simonb Exp $"); #define __INTR_PRIVATE #include "opt_cputype.h" @@ -124,6 +124,7 @@ __KERNEL_RCSID(0, "$NetBSD: mips_machdep #include #include #include +#include #include /* fsid_t for syscallargs */ #include #include @@ -2455,6 +2456,18 @@ std_splsw_test(void) #endif /* PARANOIA */ +#ifdef MODULAR +/* + * Push any modules loaded by the boot loader. + */ +void +module_init_md(void) +{ + + /* XXX Do something board/machine specific here one day... */ +} +#endif /* MODULAR */ + bool mm_md_direct_mapped_phys(paddr_t pa, vaddr_t *vap) { Added files: Index: src/sys/arch/mips/mips/kobj_machdep.c diff -u /dev/null src/sys/arch/mips/mips/kobj_machdep.c:1.1 --- /dev/null Tue Mar 23 13:22:40 2021 +++ src/sys/arch/mips/mips/kobj_machdep.c Tue Mar 23 13:22:40 2021 @@ -0,0 +1,257 @@ +/* $NetBSD: kobj_machdep.c,v 1.1 2021/03/23 13:22:40 simonb Exp $ */ + +/*- + * Copyright (c) 2021 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Simon Burge. + * + * 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
CVS commit: src/sys/modules/examples/sysctl
Module Name:src Committed By: simonb Date: Tue Mar 23 13:19:09 UTC 2021 Modified Files: src/sys/modules/examples/sysctl: sysctl.c Log Message: Add some \n's to the end of some printf()s. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/modules/examples/sysctl/sysctl.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/modules/examples/sysctl/sysctl.c diff -u src/sys/modules/examples/sysctl/sysctl.c:1.1 src/sys/modules/examples/sysctl/sysctl.c:1.2 --- src/sys/modules/examples/sysctl/sysctl.c:1.1 Fri Apr 13 01:20:28 2018 +++ src/sys/modules/examples/sysctl/sysctl.c Tue Mar 23 13:19:09 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sysctl.c,v 1.1 2018/04/13 01:20:28 kamil Exp $ */ +/* $NetBSD: sysctl.c,v 1.2 2021/03/23 13:19:09 simonb Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sysctl.c,v 1.1 2018/04/13 01:20:28 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysctl.c,v 1.2 2021/03/23 13:19:09 simonb Exp $"); #include #include @@ -104,11 +104,11 @@ sysctl_modcmd(modcmd_t cmd, void *arg) { switch(cmd) { case MODULE_CMD_INIT: - printf("sysctl module inserted"); + printf("sysctl module inserted\n"); sysctl_example_setup(_sysctl_log); break; case MODULE_CMD_FINI: - printf("sysctl module unloaded"); + printf("sysctl module unloaded\n"); sysctl_teardown(_sysctl_log); break; default:
CVS commit: src/sys/arch/mips/include
Module Name:src Committed By: simonb Date: Tue Mar 23 11:56:55 UTC 2021 Modified Files: src/sys/arch/mips/include: Makefile.inc Log Message: Remove addition of -msym32 to CFLAGS. Hinders rather than helps build MIPS modules. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/include/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/Makefile.inc diff -u src/sys/arch/mips/include/Makefile.inc:1.10 src/sys/arch/mips/include/Makefile.inc:1.11 --- src/sys/arch/mips/include/Makefile.inc:1.10 Thu Jun 9 05:43:51 2016 +++ src/sys/arch/mips/include/Makefile.inc Tue Mar 23 11:56:55 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.10 2016/06/09 05:43:51 martin Exp $ +# $NetBSD: Makefile.inc,v 1.11 2021/03/23 11:56:55 simonb Exp $ CFLAGS+= -G 0 -ffixed-24 @@ -8,8 +8,4 @@ CFLAGS+= -mno-abicalls AFLAGS+= -mno-abicalls .endif -.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" -CFLAGS+= -msym32 -.endif - AFLAGS+= -x assembler-with-cpp ${AOPTS}
CVS commit: src/sys/arch/mips/conf
Module Name:src Committed By: simonb Date: Tue Mar 23 11:41:53 UTC 2021 Modified Files: src/sys/arch/mips/conf: files.mips Log Message: Remove duplicate out-of-place comment. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/arch/mips/conf/files.mips 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/conf/files.mips diff -u src/sys/arch/mips/conf/files.mips:1.81 src/sys/arch/mips/conf/files.mips:1.82 --- src/sys/arch/mips/conf/files.mips:1.81 Wed Oct 21 13:31:51 2020 +++ src/sys/arch/mips/conf/files.mips Tue Mar 23 11:41:53 2021 @@ -1,4 +1,4 @@ -# $NetBSD: files.mips,v 1.81 2020/10/21 13:31:51 christos Exp $ +# $NetBSD: files.mips,v 1.82 2021/03/23 11:41:53 simonb Exp $ # defflag opt_cputype.h NOFPU FPEMUL @@ -106,8 +106,6 @@ file arch/mips/mips/netbsd32_machdep_13. file arch/mips/mips/netbsd32_machdep_16.c compat_netbsd32 & compat_16 include "compat/netbsd32/files.netbsd32" -# Binary compatibility with previous NetBSD releases (COMPAT_XX) - # Ultrix Binary Compatibility (COMPAT_ULTRIX) include "compat/ultrix/files.ultrix"
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: skrll Date: Tue Mar 23 10:21:49 UTC 2021 Modified Files: src/sys/arch/arm/arm32: pmap.c Log Message: Another missing kpreempt_enable To generate a diff of this commit: cvs rdiff -u -r1.427 -r1.428 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.427 src/sys/arch/arm/arm32/pmap.c:1.428 --- src/sys/arch/arm/arm32/pmap.c:1.427 Tue Mar 23 06:35:24 2021 +++ src/sys/arch/arm/arm32/pmap.c Tue Mar 23 10:21:49 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.427 2021/03/23 06:35:24 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.428 2021/03/23 10:21:49 skrll Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -192,7 +192,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.427 2021/03/23 06:35:24 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.428 2021/03/23 10:21:49 skrll Exp $"); #include #include @@ -3985,6 +3985,8 @@ pmap_extract_coherency(pmap_t pm, vaddr_ */ KDASSERT(pm == pmap_kernel()); pmap_release_pmap_lock(pm); + kpreempt_enable(); + #if (ARM_MMU_V6 + ARM_MMU_V7) > 0 if (l1pte_supersection_p(pde)) { pa = (pde & L1_SS_FRAME) | (va & L1_SS_OFFSET);
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: skrll Date: Tue Mar 23 08:07:23 UTC 2021 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/pic/intr.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/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.32 src/sys/arch/powerpc/pic/intr.c:1.33 --- src/sys/arch/powerpc/pic/intr.c:1.32 Mon Mar 22 01:36:10 2021 +++ src/sys/arch/powerpc/pic/intr.c Tue Mar 23 08:07:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.32 2021/03/22 01:36:10 rin Exp $ */ +/* $NetBSD: intr.c,v 1.33 2021/03/23 08:07:23 skrll Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -29,7 +29,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.32 2021/03/22 01:36:10 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.33 2021/03/23 08:07:23 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_interrupt.h" @@ -619,7 +619,8 @@ splraise(int ncpl) struct cpu_info *ci = curcpu(); int ocpl; - if (ncpl == ci->ci_cpl) return ncpl; + if (ncpl == ci->ci_cpl) + return ncpl; REORDER_PROTECT(); ocpl = ci->ci_cpl; KASSERT(ncpl < NIPL);
CVS commit: src/sys/arch/sandpoint/stand/altboot
Module Name:src Committed By: rin Date: Tue Mar 23 07:21:41 UTC 2021 Modified Files: src/sys/arch/sandpoint/stand/altboot: main.c Log Message: Make this compile with -DDEBUG. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/sandpoint/stand/altboot/main.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/sandpoint/stand/altboot/main.c diff -u src/sys/arch/sandpoint/stand/altboot/main.c:1.32 src/sys/arch/sandpoint/stand/altboot/main.c:1.33 --- src/sys/arch/sandpoint/stand/altboot/main.c:1.32 Tue Mar 23 07:21:15 2021 +++ src/sys/arch/sandpoint/stand/altboot/main.c Tue Mar 23 07:21:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.32 2021/03/23 07:21:15 rin Exp $ */ +/* $NetBSD: main.c,v 1.33 2021/03/23 07:21:40 rin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -40,6 +40,10 @@ #include "globals.h" +#ifdef DEBUG +int debug = 1; +#endif + static const struct bootarg { const char *name; int value;
CVS commit: src/sys/arch/sandpoint/stand/altboot
Module Name:src Committed By: rin Date: Tue Mar 23 07:21:16 UTC 2021 Modified Files: src/sys/arch/sandpoint/stand/altboot: main.c Log Message: Make sure not to run kernel if fdloadfile() fails; it returns *non-zero* value on error. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sandpoint/stand/altboot/main.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/sandpoint/stand/altboot/main.c diff -u src/sys/arch/sandpoint/stand/altboot/main.c:1.31 src/sys/arch/sandpoint/stand/altboot/main.c:1.32 --- src/sys/arch/sandpoint/stand/altboot/main.c:1.31 Wed Jun 26 22:04:12 2019 +++ src/sys/arch/sandpoint/stand/altboot/main.c Tue Mar 23 07:21:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.31 2019/06/26 22:04:12 christos Exp $ */ +/* $NetBSD: main.c,v 1.32 2021/03/23 07:21:15 rin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -345,7 +345,7 @@ main(int argc, char *argv[], char *boota err = fdloadfile(fd, marks, LOAD_KERNEL); close(fd); - if (err < 0) + if (err != 0) continue; printf("entry=%p, ssym=%p, esym=%p\n",
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: skrll Date: Tue Mar 23 06:35:24 UTC 2021 Modified Files: src/sys/arch/arm/arm32: pmap.c Log Message: Re-enable kpreemption in an error path. Spotted by nat@ To generate a diff of this commit: cvs rdiff -u -r1.426 -r1.427 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.426 src/sys/arch/arm/arm32/pmap.c:1.427 --- src/sys/arch/arm/arm32/pmap.c:1.426 Sun Mar 14 10:36:46 2021 +++ src/sys/arch/arm/arm32/pmap.c Tue Mar 23 06:35:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.426 2021/03/14 10:36:46 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.427 2021/03/23 06:35:24 skrll Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -192,7 +192,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.426 2021/03/14 10:36:46 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.427 2021/03/23 06:35:24 skrll Exp $"); #include #include @@ -3281,6 +3281,8 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_ pmap_free_l2_bucket(pm, l2b, 0); UVMHIST_LOG(maphist, " <-- done (ENOMEM)", 0, 0, 0, 0); + kpreempt_enable(); + return ENOMEM; } }
CVS commit: [thorpej-cfargs] src/sys/arch/hpcmips/dev
Module Name:src Committed By: thorpej Date: Tue Mar 23 06:18:23 UTC 2021 Modified Files: src/sys/arch/hpcmips/dev [thorpej-cfargs]: plumpcmcia.c Log Message: plumpcmcia has only a single interface attribute, so no need to use config_found_ia(). While here, also fix an apparent bug left over from when device_t and driver softcs were fully split ... config_found() takes a device_t, not the associated softc. (Issue was masked by a case to "void *".) To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.28.32.1 src/sys/arch/hpcmips/dev/plumpcmcia.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/hpcmips/dev/plumpcmcia.c diff -u src/sys/arch/hpcmips/dev/plumpcmcia.c:1.28 src/sys/arch/hpcmips/dev/plumpcmcia.c:1.28.32.1 --- src/sys/arch/hpcmips/dev/plumpcmcia.c:1.28 Thu Jun 30 08:51:06 2016 +++ src/sys/arch/hpcmips/dev/plumpcmcia.c Tue Mar 23 06:18:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: plumpcmcia.c,v 1.28 2016/06/30 08:51:06 skrll Exp $ */ +/* $NetBSD: plumpcmcia.c,v 1.28.32.1 2021/03/23 06:18:23 thorpej Exp $ */ /* * Copyright (c) 1999, 2000 UCHIYAMA Yasushi. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plumpcmcia.c,v 1.28 2016/06/30 08:51:06 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plumpcmcia.c,v 1.28.32.1 2021/03/23 06:18:23 thorpej Exp $"); #include #include @@ -303,14 +303,13 @@ static void plumpcmcia_attach_socket(struct plumpcmcia_handle *ph) { struct pcmciabus_attach_args paa; - struct plumpcmcia_softc *sc = device_private(ph->ph_parent); paa.paa_busname = "pcmcia"; paa.pct = (pcmcia_chipset_tag_t)_functions; paa.pch = (pcmcia_chipset_handle_t)ph; - if ((ph->ph_pcmcia = config_found_ia((void*)sc, "pcmciabus", , - plumpcmcia_print))) { + if ((ph->ph_pcmcia = config_found(ph->ph_parent, , plumpcmcia_print, + CFARG_EOL))) { /* Enable slot */ plum_conf_write(ph->ph_regt, ph->ph_regh, PLUM_PCMCIA_SLOTCTRL,