CVS commit: src/sys/dev/fdt
Module Name:src Committed By: ryo Date: Sat Jan 16 09:09:37 UTC 2021 Modified Files: src/sys/dev/fdt: fdtvar.h Log Message: oops, fix mistake in previous commit. removed unwanted member that had been added. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/dev/fdt/fdtvar.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/dev/fdt/fdtvar.h diff -u src/sys/dev/fdt/fdtvar.h:1.67 src/sys/dev/fdt/fdtvar.h:1.68 --- src/sys/dev/fdt/fdtvar.h:1.67 Fri Jan 15 22:59:49 2021 +++ src/sys/dev/fdt/fdtvar.h Sat Jan 16 09:09:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: fdtvar.h,v 1.67 2021/01/15 22:59:49 jmcneill Exp $ */ +/* $NetBSD: fdtvar.h,v 1.68 2021/01/16 09:09:37 ryo Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -77,8 +77,6 @@ struct fdtbus_interrupt_controller_func bool (*intrstr)(device_t, u_int *, char *, size_t); void (*mask)(device_t, void *); void (*unmask)(device_t, void *); - void * (*establish_xname)(device_t, u_int *, int, int, - int (*)(void *), void *, const char *); }; struct fdtbus_spi_controller_func {
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sat Jan 16 12:57:37 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_c99_anon_struct.c d_c99_recursive_init.c d_c99_struct_init.c d_c99_union_init1.c d_c99_union_init2.c d_c99_union_init3.c d_c99_union_init4.c d_cast_init.c d_typefun.c msg_330.c Log Message: lint: normalize whitespace in tests To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c \ src/tests/usr.bin/xlint/lint1/d_c99_recursive_init.c \ src/tests/usr.bin/xlint/lint1/d_c99_struct_init.c \ src/tests/usr.bin/xlint/lint1/d_c99_union_init1.c \ src/tests/usr.bin/xlint/lint1/d_c99_union_init2.c \ src/tests/usr.bin/xlint/lint1/d_c99_union_init3.c \ src/tests/usr.bin/xlint/lint1/d_c99_union_init4.c \ src/tests/usr.bin/xlint/lint1/d_cast_init.c \ src/tests/usr.bin/xlint/lint1/d_typefun.c \ src/tests/usr.bin/xlint/lint1/msg_330.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_c99_anon_struct.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c:1.1 src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c:1.1 Wed Oct 14 16:32:55 2015 +++ src/tests/usr.bin/xlint/lint1/d_c99_anon_struct.c Sat Jan 16 12:57:37 2021 @@ -23,4 +23,3 @@ main(void) b.top_left.x = 1; return 0; } - Index: src/tests/usr.bin/xlint/lint1/d_c99_recursive_init.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_recursive_init.c:1.1 src/tests/usr.bin/xlint/lint1/d_c99_recursive_init.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_c99_recursive_init.c:1.1 Sat Mar 17 16:33:15 2012 +++ src/tests/usr.bin/xlint/lint1/d_c99_recursive_init.c Sat Jan 16 12:57:37 2021 @@ -7,7 +7,7 @@ struct top { char uc; } u; char *s; -} c[] = { +} c[] = { { .s = "foo", .c = 'b', .u = { .uc = 'c' } }, { .i = 1, .c = 'a', .u = { .us = 2 } }, }; Index: src/tests/usr.bin/xlint/lint1/d_c99_struct_init.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_struct_init.c:1.1 src/tests/usr.bin/xlint/lint1/d_c99_struct_init.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_c99_struct_init.c:1.1 Sat Mar 17 16:33:15 2012 +++ src/tests/usr.bin/xlint/lint1/d_c99_struct_init.c Sat Jan 16 12:57:37 2021 @@ -2,7 +2,7 @@ struct { int i; char *s; -} c[] = { +} c[] = { { .i = 2, }, { .s = "foo" }, { .i = 1, .s = "bar" }, Index: src/tests/usr.bin/xlint/lint1/d_c99_union_init1.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_union_init1.c:1.1 src/tests/usr.bin/xlint/lint1/d_c99_union_init1.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_c99_union_init1.c:1.1 Sat Mar 17 16:33:15 2012 +++ src/tests/usr.bin/xlint/lint1/d_c99_union_init1.c Sat Jan 16 12:57:37 2021 @@ -2,7 +2,7 @@ union { int i; char *s; -} c[] = { +} c[] = { { i: 1 }, { s: "foo" } }; Index: src/tests/usr.bin/xlint/lint1/d_c99_union_init2.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_union_init2.c:1.1 src/tests/usr.bin/xlint/lint1/d_c99_union_init2.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_c99_union_init2.c:1.1 Sat Mar 17 16:33:15 2012 +++ src/tests/usr.bin/xlint/lint1/d_c99_union_init2.c Sat Jan 16 12:57:37 2021 @@ -2,7 +2,7 @@ union { int i[10]; short s; -} c[] = { +} c[] = { { s: 2 }, { i: { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } }, }; Index: src/tests/usr.bin/xlint/lint1/d_c99_union_init3.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_union_init3.c:1.1 src/tests/usr.bin/xlint/lint1/d_c99_union_init3.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_c99_union_init3.c:1.1 Sat Mar 17 16:33:15 2012 +++ src/tests/usr.bin/xlint/lint1/d_c99_union_init3.c Sat Jan 16 12:57:37 2021 @@ -2,7 +2,7 @@ struct { int i[10]; char *s; -} c[] = { +} c[] = { { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, "foo" }, }; Index: src/tests/usr.bin/xlint/lint1/d_c99_union_init4.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_union_init4.c:1.1 src/tests/usr.bin/xlint/lint1/d_c99_union_init4.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_c99_union_init4.c:1.1 Tue Jul 28 18:05:19 2015 +++ src/tests/usr.bin/xlint/lint1/d_c99_union_init4.c Sat Jan 16 12:57:37 2021 @@ -1,15 +1,15 @@ /* test .data.l[x] */ typedef struct { -int type; -union { -char b[20]; -short s[10]; -long l[5]; + int type; + union { + char b[20]; + short s[10]; + long l[5]; } data; } foo; foo bar = { -.type = 3, -.data.l[0] = 4 + .type = 3, + .data.l[0] = 4 }; Index: src/tests/usr.bin/xlint/lint1/d_cast_init.c diff -u src/tests/usr.bin/xlint/lint1/d_cast_init.c:1.1 src/tests/usr.bin/xlint/lint1/d_cast_init.c:1.2 --- src/tests/usr.bin/xlint/lint1/d_cast_init.c:1.1 Sat Mar 17 16:33:15 2012 +++ src/tests/usr.bin/xlint/lint1/d_cast_init.c Sat Jan 16 12:57:37 2021 @@ -1,27 +1,16 @@ /* cast initialization */ + typedef unsigned char u_char; -typedef unsigned int
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Jan 16 15:02:12 UTC 2021 Modified Files: src/tests/usr.bin/xlint: check-expect.lua src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c d_c99_bool_strict.exp src/usr.bin/xlint/lint1: tree.c Log Message: lint: prepare to make strict bool mode even stricter Currently, strict bool mode still allows integer constant expressions to be converted implicitly to bool. This is something that other languages such as Go, Java, C#, Pascal don't allow. By providing a custom implementation of that defines false and true to custom bool constant identifiers, lint will cover these cases as well. To prepare for this, reword the rules and restructure the tests in d_c99_bool_strict.c. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/check-expect.lua cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp cvs rdiff -u -r1.154 -r1.155 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/check-expect.lua diff -u src/tests/usr.bin/xlint/check-expect.lua:1.1 src/tests/usr.bin/xlint/check-expect.lua:1.2 --- src/tests/usr.bin/xlint/check-expect.lua:1.1 Tue Jan 12 20:42:01 2021 +++ src/tests/usr.bin/xlint/check-expect.lua Sat Jan 16 15:02:11 2021 @@ -1,5 +1,5 @@ #! /usr/bin/lua --- $NetBSD: check-expect.lua,v 1.1 2021/01/12 20:42:01 rillig Exp $ +-- $NetBSD: check-expect.lua,v 1.2 2021/01/16 15:02:11 rillig Exp $ --[[ @@ -99,8 +99,8 @@ local function check_test(c_fname, error end if not found then - errors:add("error: %s:%d: message \"%s\" is not declared in %s:%d", -exp_fname, act.exp_lineno, act.msg, c_fname, act.c_lineno) + errors:add("error: %s:%d: must expect \"%s\"", +c_fname, act.c_lineno, act.msg) end end 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.7 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.8 --- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.7 Fri Jan 15 23:15:28 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c Sat Jan 16 15:02:11 2021 @@ -1,45 +1,106 @@ -/* $NetBSD: d_c99_bool_strict.c,v 1.7 2021/01/15 23:15:28 rillig Exp $ */ +/* $NetBSD: d_c99_bool_strict.c,v 1.8 2021/01/16 15:02:11 rillig Exp $ */ # 3 "d_c99_bool_strict.c" /* * The option -T treats _Bool as incompatible with all other scalar types. - * This means: + * This is implemented by the following rules: * - * SB001: Controlling expressions in 'if', 'while', 'for', '?:' must be of - * type _Bool instead of scalar. + * strict-bool-typedef: + * The type _Bool is compatible with any typedef of _Bool. * - * SB002: The operators '!', '==', '!=', '<', '<=', '>=', '>', '&&', '||' - * return _Bool instead of int. + * Note: Since defines bool as textual alias of _Bool, + * having another typedef for bool is unusual. * - * SB003: The operators '!', '&&', '||' take _Bool instead of scalar. + * strict-bool-constant: + * There are 2 bool constants named false and true. + * No other constants are compatible with type _Bool. * - * SB004: The only operators that take _Bool are '!', '==', '!=', - * '&', '^', '|', '&&', '||', '?', ':', '=', '&=', '^=', '|='. + * Note: Internally these constants are named __lint_false and + * __lint_true. * - * SB005: There is no implicit conversion from _Bool to any other type. + * strict-bool-bit-field: + * A struct or union member that is a bit field with underlying type + * bool is compatible with plain bool. * - * SB006: An expression is compatible with type _Bool if its main operator - * returns type _Bool, or if the expression is an integer constant expression - * with value 0 or 1. + * strict-bool-conversion: + * There is no implicit conversion between _Bool and any other type. * - * SB007: Expressions like "flags & FLAG" are compatible with _Bool if - * they appear in a context where they are immediately compared to zero. - * Assigning to a _Bool variable does not count as such a context, to - * allow programs to be compiled without silent changes on a compiler that - * is lacking the special _Bool type. + * strict-bool-controlling-expression: + * Controlling expressions in 'if', 'while', 'for', '?:' must be of + * type bool. * - * SB008: Bit fields in struct may be based on _Bool. These bit fields - * typically have type _Bool:1 and can be converted to _Bool and back. + * strict-bool-operand-unary: + * Operator bool? scalar? + * ! yes no + * The other binary operators do not accept bool operands. + * + * strict-bool-operand-binary: + * Operator left: bool? other? right: bool? other? + * . - yes yes yes + * -> - yes yes yes + * <=, <, >=, > yes yes yes yes + * ==, != yes yes yes yes +
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: jmcneill Date: Sat Jan 16 15:26:23 UTC 2021 Modified Files: src/sys/arch/x86/x86: identcpu_subr.c Log Message: trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/x86/identcpu_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/identcpu_subr.c diff -u src/sys/arch/x86/x86/identcpu_subr.c:1.7 src/sys/arch/x86/x86/identcpu_subr.c:1.8 --- src/sys/arch/x86/x86/identcpu_subr.c:1.7 Fri Jul 10 06:15:23 2020 +++ src/sys/arch/x86/x86/identcpu_subr.c Sat Jan 16 15:26:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu_subr.c,v 1.7 2020/07/10 06:15:23 msaitoh Exp $ */ +/* $NetBSD: identcpu_subr.c,v 1.8 2021/01/16 15:26:23 jmcneill Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ * See src/usr.sbin/cpuctl/{Makefile, arch/i386.c}). */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu_subr.c,v 1.7 2020/07/10 06:15:23 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu_subr.c,v 1.8 2021/01/16 15:26:23 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "lapic.h" @@ -69,7 +69,7 @@ cpu_tsc_freq_cpuid(struct cpu_info *ci) if (!((ci->ci_max_cpuid >= 0x15) && (cpu_vendor == CPUVENDOR_INTEL))) return 0; - + x86_cpuid(0x15, descs); denominator = descs[0]; numerator = descs[1];
CVS commit: src/usr.sbin/cpuctl/arch
Module Name:src Committed By: jmcneill Date: Sat Jan 16 15:34:37 UTC 2021 Modified Files: src/usr.sbin/cpuctl/arch: aarch64.c Log Message: ID_AA64PFR0_EL1.GIC=0 means that the CPU interface system registers are not implemented. This does not necessarily mean that there is no GIC in the system, as GICv2 uses MMIO instead of system registers for the CPU interface. While here, add description for GIC=3, which means that the v4.1 system register interface is supported. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/cpuctl/arch/aarch64.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/cpuctl/arch/aarch64.c diff -u src/usr.sbin/cpuctl/arch/aarch64.c:1.13 src/usr.sbin/cpuctl/arch/aarch64.c:1.14 --- src/usr.sbin/cpuctl/arch/aarch64.c:1.13 Mon Jan 4 05:35:14 2021 +++ src/usr.sbin/cpuctl/arch/aarch64.c Sat Jan 16 15:34:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: aarch64.c,v 1.13 2021/01/04 05:35:14 ryo Exp $ */ +/* $NetBSD: aarch64.c,v 1.14 2021/01/16 15:34:37 jmcneill Exp $ */ /* * Copyright (c) 2018 Ryo Shimizu @@ -29,7 +29,7 @@ #include #ifndef lint -__RCSID("$NetBSD: aarch64.c,v 1.13 2021/01/04 05:35:14 ryo Exp $"); +__RCSID("$NetBSD: aarch64.c,v 1.14 2021/01/16 15:34:37 jmcneill Exp $"); #endif /* no lint */ #include @@ -164,8 +164,9 @@ struct fieldinfo id_aa64pfr0_fieldinfo[] { .bitpos = 24, .bitwidth = 4, .name = "GIC", .info = (const char *[16]) { /* 16=4bit */ - [0] = "No GIC", - [1] = "GICv3" + [0] = "GIC CPU interface sysregs not implemented", + [1] = "GIC CPU interface sysregs v3.0/4.0 supported", + [3] = "GIC CPU interface sysregs v4.1 supported" } }, { .bitwidth = 0 } /* end of table */
CVS commit: src/usr.sbin/cpuctl/arch
Module Name:src Committed By: jmcneill Date: Sat Jan 16 15:35:28 UTC 2021 Modified Files: src/usr.sbin/cpuctl/arch: arm.c Log Message: trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/cpuctl/arch/arm.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/cpuctl/arch/arm.c diff -u src/usr.sbin/cpuctl/arch/arm.c:1.3 src/usr.sbin/cpuctl/arch/arm.c:1.4 --- src/usr.sbin/cpuctl/arch/arm.c:1.3 Sun Feb 3 10:48:47 2019 +++ src/usr.sbin/cpuctl/arch/arm.c Sat Jan 16 15:35:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: arm.c,v 1.3 2019/02/03 10:48:47 mrg Exp $ */ +/* $NetBSD: arm.c,v 1.4 2021/01/16 15:35:28 jmcneill Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: arm.c,v 1.3 2019/02/03 10:48:47 mrg Exp $"); +__RCSID("$NetBSD: arm.c,v 1.4 2021/01/16 15:35:28 jmcneill Exp $"); #endif /* not lint */ #include @@ -81,32 +81,32 @@ static const char * const id_mmfr_fieldn "FCSE-Support", "Innermost-Shareability" }, { - "L1-Harvard-Cache-VA", - "L1-Unified-Cache-VA", - "L1-Harvard-Cache-Set/Way", - "L1-Unified-Cache-Set/Way", - "L1-Harvard-Cache", - "L1-Unified-Cache", - "L1-Cache-Test-and-Clean", - "Branch-Predictor", + "L1-Harvard-Cache-VA", + "L1-Unified-Cache-VA", + "L1-Harvard-Cache-Set/Way", + "L1-Unified-Cache-Set/Way", + "L1-Harvard-Cache", + "L1-Unified-Cache", + "L1-Cache-Test-and-Clean", + "Branch-Predictor", }, { - "L1-Harvard-Foreground-Fetch", - "L1-Unified-Background-Fetch", - "L1-Harvard-Range", + "L1-Harvard-Foreground-Fetch", + "L1-Unified-Background-Fetch", + "L1-Harvard-Range", "Harvard-TLB", - "Unified-TLB", - "Mem-Barrier", - "WFI-Stall", - "HW-Access", + "Unified-TLB", + "Mem-Barrier", + "WFI-Stall", + "HW-Access", }, { - "Cache-Maintenance-MVA", - "Cache-Maintenance-Set/Way", - "BP-Maintenance", + "Cache-Maintenance-MVA", + "Cache-Maintenance-Set/Way", + "BP-Maintenance", "Maintenance-Broadcast", NULL, - "Coherent-Tablewalk", - "Cached-Memory-Size", - "Supersection-Support", + "Coherent-Tablewalk", + "Cached-Memory-Size", + "Supersection-Support", }, }; @@ -194,7 +194,7 @@ print_features(const char *cpuname, cons "=%u", isar & 0x0f); } size_t tmplen = snprintf(tmpbuf, sizeof(tmpbuf), - "%s%s%s", sep, name, value); + "%s%s%s", sep, name, value); if (len + tmplen > 78) { printf("%s\n", buf); len = snprintf(buf, sizeof(buf),
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Jan 16 16:03:47 UTC 2021 Modified Files: src/distrib/sets/lists/comp: mi src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c d_c99_bool_strict.exp msg_330.c msg_330.exp msg_331.c msg_331.exp msg_332.c msg_332.exp msg_333.c msg_333.exp msg_336.c msg_336.exp msg_337.c msg_337.exp src/usr.bin/xlint/lint1: cgram.y decl.c lint1.h tree.c src/usr.bin/xlint/xlint: Makefile pathnames.h xlint.c Added Files: src/usr.bin/xlint/xlint: strict-bool-stdbool.h Log Message: lint: in strict bool mode, integer constants do not have type bool Previously, lint1 allowed integer constants such as 0 and 1 to be used as bool constants. This was only half-baked since after fixing all error messages from that strict mode, there may still be integer literals in the code that should be replaced with true or false. This would stop a migration from int to bool in the middle, leaving inconsistent code around. To find the remaining type inconsistencies, treat integers and bool as completely incompatible, even for compile time constants. To generate a diff of this commit: cvs rdiff -u -r1.2368 -r1.2369 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_330.c cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_330.exp \ src/tests/usr.bin/xlint/lint1/msg_331.c \ src/tests/usr.bin/xlint/lint1/msg_331.exp \ src/tests/usr.bin/xlint/lint1/msg_332.c \ src/tests/usr.bin/xlint/lint1/msg_332.exp \ src/tests/usr.bin/xlint/lint1/msg_333.c \ src/tests/usr.bin/xlint/lint1/msg_333.exp \ src/tests/usr.bin/xlint/lint1/msg_336.c \ src/tests/usr.bin/xlint/lint1/msg_336.exp \ src/tests/usr.bin/xlint/lint1/msg_337.c \ src/tests/usr.bin/xlint/lint1/msg_337.exp cvs rdiff -u -r1.140 -r1.141 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.122 -r1.123 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.155 -r1.156 src/usr.bin/xlint/lint1/tree.c cvs rdiff -u -r1.16 -r1.17 src/usr.bin/xlint/xlint/Makefile cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/xlint/pathnames.h cvs rdiff -u -r0 -r1.1 src/usr.bin/xlint/xlint/strict-bool-stdbool.h cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/xlint/xlint.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2368 src/distrib/sets/lists/comp/mi:1.2369 --- src/distrib/sets/lists/comp/mi:1.2368 Fri Jan 8 09:41:24 2021 +++ src/distrib/sets/lists/comp/mi Sat Jan 16 16:03:46 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2368 2021/01/08 09:41:24 uki Exp $ +# $NetBSD: mi,v 1.2369 2021/01/16 16:03:46 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -4011,6 +4011,8 @@ ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_shatest.debug comp-obsolete openssl=11,obsolete ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_x509v3test.debug comp-obsolete openssl=11,obsolete ./usr/libdata/ldscripts/kmodule comp-util-share binutils,kmod +./usr/libdata/lint/strict-bool comp-c-bin lint +./usr/libdata/lint/strict-bool/stdbool.h comp-c-bin lint ./usr/libdata/lint/llib-larchive.ln comp-c-lintlib lint ./usr/libdata/lint/llib-lasn1.ln comp-krb5-lintlib lint,kerberos ./usr/libdata/lint/llib-lbind9.ln comp-bind-lintlib lint 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.8 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.9 --- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.8 Sat Jan 16 15:02:11 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c Sat Jan 16 16:03:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_bool_strict.c,v 1.8 2021/01/16 15:02:11 rillig Exp $ */ +/* $NetBSD: d_c99_bool_strict.c,v 1.9 2021/01/16 16:03:47 rillig Exp $ */ # 3 "d_c99_bool_strict.c" /* @@ -123,8 +123,8 @@ strict_bool_constant(void) { accept_bool(__lint_false); accept_bool(__lint_true); - accept_bool(0); /* TODO: expect: 334 */ - accept_bool(1); /* TODO: expect: 334 */ + accept_bool(0); /* expect: 334 */ + accept_bool(1); /* expect: 334 */ accept_bool(2); /* expect: 334 */ } @@ -136,16 +136,16 @@ enum strict_bool_constant_expressions { TRUE = __lint_true ? 100 : 101, /* Not ok: an integer is not a boolean constant expression. */ - INT0 = 0 ? 100 : 101, /* TODO: expect: 331 */ + INT0 = 0 ? 100 : 101, /* expect: 331 */ /* Not ok: an integer is not a boolean constant expression. */ - INT1 = 1 ? 100 : 101, /* TODO: expect: 331 */ + INT1 = 1 ? 100 : 101, /* expect: 331 */ /* Not ok: 2 is not a boolean c
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Jan 16 16:53:24 UTC 2021 Modified Files: src/usr.bin/xlint/common: tyname.c src/usr.bin/xlint/lint1: decl.c emit1.c func.c init.c lint1.h main1.c tree.c src/usr.bin/xlint/lint2: chk.c read.c src/usr.bin/xlint/xlint: xlint.c Log Message: lint: replace integer constant expressions with true and false LINTFLAGS=-gST make lint, with manual review. The error messages from lint are all correct, they are not complete though. The return value of a function returning bool may still be compared to the integer 0. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/common/tyname.c cvs rdiff -u -r1.123 -r1.124 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.37 -r1.38 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.59 -r1.60 src/usr.bin/xlint/lint1/func.c cvs rdiff -u -r1.62 -r1.63 src/usr.bin/xlint/lint1/init.c cvs rdiff -u -r1.56 -r1.57 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.36 -r1.37 src/usr.bin/xlint/lint1/main1.c cvs rdiff -u -r1.156 -r1.157 src/usr.bin/xlint/lint1/tree.c cvs rdiff -u -r1.34 -r1.35 src/usr.bin/xlint/lint2/chk.c cvs rdiff -u -r1.37 -r1.38 src/usr.bin/xlint/lint2/read.c cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/xlint/xlint.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/common/tyname.c diff -u src/usr.bin/xlint/common/tyname.c:1.23 src/usr.bin/xlint/common/tyname.c:1.24 --- src/usr.bin/xlint/common/tyname.c:1.23 Sat Jan 16 02:40:02 2021 +++ src/usr.bin/xlint/common/tyname.c Sat Jan 16 16:53:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tyname.c,v 1.23 2021/01/16 02:40:02 rillig Exp $ */ +/* $NetBSD: tyname.c,v 1.24 2021/01/16 16:53:23 rillig Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tyname.c,v 1.23 2021/01/16 02:40:02 rillig Exp $"); +__RCSID("$NetBSD: tyname.c,v 1.24 2021/01/16 16:53:23 rillig Exp $"); #endif #include @@ -50,7 +50,7 @@ __RCSID("$NetBSD: tyname.c,v 1.23 2021/0 do { \ (void)warnx("%s, %d: " fmt, __FILE__, __LINE__, ##args); \ abort(); \ - } while (/*CONSTCOND*/0) + } while (/*CONSTCOND*/false) #endif /* A tree of strings. */ @@ -228,7 +228,7 @@ sametype(const type_t *t1, const type_t case FCOMPLEX: case DCOMPLEX: case LCOMPLEX: - return 1; + return true; case ARRAY: if (t1->t_dim != t2->t_dim) return false; Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.123 src/usr.bin/xlint/lint1/decl.c:1.124 --- src/usr.bin/xlint/lint1/decl.c:1.123 Sat Jan 16 16:03:46 2021 +++ src/usr.bin/xlint/lint1/decl.c Sat Jan 16 16:53:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.123 2021/01/16 16:03:46 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.124 2021/01/16 16:53:23 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.123 2021/01/16 16:03:46 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.124 2021/01/16 16:53:23 rillig Exp $"); #endif #include @@ -177,7 +177,7 @@ incompl(const type_t *tp) tspec_t t; if ((t = tp->t_tspec) == VOID) { - return 1; + return true; } else if (t == ARRAY) { return tp->t_aincompl; } else if (t == STRUCT || t == UNION) { @@ -185,7 +185,7 @@ incompl(const type_t *tp) } else if (t == ENUM) { return tp->t_enum->eincompl; } - return 0; + return false; } /* @@ -661,7 +661,7 @@ popdecl(void) /* there is nothing after external declarations */ /* FALLTHROUGH */ default: - lint_assert(/*CONSTCOND*/0); + lint_assert(/*CONSTCOND*/false); } free(di); } @@ -1190,7 +1190,7 @@ declarator_1_struct_union(sym_t *dsym) dcs->d_offset = o; } - check_function_definition(dsym, 0); + check_function_definition(dsym, false); /* * Clear the BITFIELDTYPE indicator after processing each @@ -1344,7 +1344,7 @@ add_array(sym_t *decl, bool dim, int n) /* zero sized array is a C99 extension */ c99ism(322); } else if (n == 0 && !dim) { - setcomplete(tp, 0); + setcomplete(tp, false); } return decl; @@ -1568,7 +1568,7 @@ declarator_name(sym_t *sym) } break; default: - lint_assert(/*CONSTCOND*/0); + lint_assert(/*CONSTCOND*/false); } sym->s_scl = sc; @@ -1668,7 +1668,7 @@ mktag(sym_t *tag, tspec_t kind, bool dec tp->t_enum = getblk(sizeof(*tp->t_enum)); tp->t_enum->etag = tag; } - setcomplete(tp, 0); + setcomplete(tp, false); } return tp; } @@ -1751,7 +1751,7 @@ storage_class_name(scl_t sc) case STRTAG: s = "struct"; break; case UNIONTAG: s = "union"; break; case ENUMTAG: s = "enum"; break; - default: lint_assert(/*CONSTCOND*/0); + default: lint_assert(/*CONSTCOND*/false); } return s; } @@ -1767,7 +1767,7 @@ complete_tag_struct_or_unio
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sat Jan 16 16:58:39 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c Log Message: lint: add test for missing check in strict bool mode To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.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_c99_bool_strict.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.9 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.10 --- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.9 Sat Jan 16 16:03:47 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c Sat Jan 16 16:58:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_bool_strict.c,v 1.9 2021/01/16 16:03:47 rillig Exp $ */ +/* $NetBSD: d_c99_bool_strict.c,v 1.10 2021/01/16 16:58:39 rillig Exp $ */ # 3 "d_c99_bool_strict.c" /* @@ -708,3 +708,10 @@ query_flag_from_enum_bit_set(enum Flags if (flags & FLAG28) println("FLAG28 is set"); } + + +bool +strict_bool_operator_eq_bool_int(void) +{ + return strict_bool_conversion_return_false() == 0; /* TODO: expect */ +}
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Jan 16 17:54:22 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c src/usr.bin/xlint/lint1: tree.c Log Message: lint: remove redundant calls to before_conversion To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c cvs rdiff -u -r1.157 -r1.158 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.10 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.11 --- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.10 Sat Jan 16 16:58:39 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c Sat Jan 16 17:54:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_bool_strict.c,v 1.10 2021/01/16 16:58:39 rillig Exp $ */ +/* $NetBSD: d_c99_bool_strict.c,v 1.11 2021/01/16 17:54:22 rillig Exp $ */ # 3 "d_c99_bool_strict.c" /* @@ -38,7 +38,7 @@ * Operator left: bool? other? right: bool? other? * . - yes yes yes * -> - yes yes yes - * <=, <, >=, > yes yes yes yes + * <=, <, >=, > - yes - yes * ==, != yes yes yes yes * & yes yes yes yes * ^ yes yes yes yes @@ -443,7 +443,7 @@ strict_bool_operand_unary_address(void) * Operator left: bool? other? right: bool? other? * . - yes yes yes * -> - yes yes yes - * <=, <, >=, > yes yes yes yes + * <=, <, >=, > - yes - yes * ==, != yes yes yes yes * & yes yes yes yes * ^ yes yes yes yes Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.157 src/usr.bin/xlint/lint1/tree.c:1.158 --- src/usr.bin/xlint/lint1/tree.c:1.157 Sat Jan 16 16:53:23 2021 +++ src/usr.bin/xlint/lint1/tree.c Sat Jan 16 17:54:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.157 2021/01/16 16:53:23 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.158 2021/01/16 17:54:22 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.157 2021/01/16 16:53:23 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.158 2021/01/16 17:54:22 rillig Exp $"); #endif #include @@ -1171,7 +1171,7 @@ typeok_scalar_strict_bool(op_t op, const if (!mp->m_takes_bool) { bool binary = mp->m_binary; - bool lbool = before_conversion(ln)->tn_type->t_tspec == BOOL; + bool lbool = ln->tn_type->t_tspec == BOOL; bool ok = true; if (!binary && lbool) { @@ -1184,7 +1184,7 @@ typeok_scalar_strict_bool(op_t op, const error(336, getopname(op)); ok = false; } - if (binary && before_conversion(rn)->tn_type->t_tspec == BOOL) { + if (binary && rn->tn_type->t_tspec == BOOL) { /* right operand of '%s' must not be bool */ error(337, getopname(op)); ok = false;
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sat Jan 16 18:46:59 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: lint: simplify typeok_strict_bool_assign When that function is called, the nodes are already before_conversion. To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.158 src/usr.bin/xlint/lint1/tree.c:1.159 --- src/usr.bin/xlint/lint1/tree.c:1.158 Sat Jan 16 17:54:22 2021 +++ src/usr.bin/xlint/lint1/tree.c Sat Jan 16 18:46:59 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.158 2021/01/16 17:54:22 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.159 2021/01/16 18:46:59 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.158 2021/01/16 17:54:22 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.159 2021/01/16 18:46:59 rillig Exp $"); #endif #include @@ -1095,27 +1095,16 @@ typeok_strict_bool_assign(op_t op, int a if ((lt == BOOL) == (rt == BOOL)) return true; - if (lt == BOOL && before_conversion(rn)->tn_type->t_tspec == BOOL) - return true; - if (op == FARG) { /* argument #%d expects '%s', gets passed '%s' */ - error(334, - arg, - tspec_name(ln->tn_type->t_tspec), - tspec_name(rn->tn_type->t_tspec)); + error(334, arg, tspec_name(lt), tspec_name(rt)); } else if (op == RETURN) { /* return value type mismatch (%s) and (%s) */ - error(211, - type_name(ln->tn_type), - type_name(rn->tn_type)); + error(211, type_name(ln->tn_type), type_name(rn->tn_type)); return false; } else { /* operands of '%s' have incompatible types (%s != %s) */ - error(107, - getopname(op), - tspec_name(ln->tn_type->t_tspec), - tspec_name(rn->tn_type->t_tspec)); + error(107, getopname(op), tspec_name(lt), tspec_name(rt)); } return false;
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Jan 16 18:48:52 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c d_c99_bool_strict.exp src/usr.bin/xlint/lint1: tree.c Log Message: lint: add missing warning for bool() == int To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp cvs rdiff -u -r1.159 -r1.160 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.11 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.12 --- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.11 Sat Jan 16 17:54:22 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c Sat Jan 16 18:48:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_bool_strict.c,v 1.11 2021/01/16 17:54:22 rillig Exp $ */ +/* $NetBSD: d_c99_bool_strict.c,v 1.12 2021/01/16 18:48:52 rillig Exp $ */ # 3 "d_c99_bool_strict.c" /* @@ -710,8 +710,8 @@ query_flag_from_enum_bit_set(enum Flags } -bool +void strict_bool_operator_eq_bool_int(void) { - return strict_bool_conversion_return_false() == 0; /* TODO: expect */ + (void)(strict_bool_conversion_return_false() == 0); /* expect: 107 */ } Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.8 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.9 --- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.8 Sat Jan 16 16:03:47 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp Sat Jan 16 18:48:52 2021 @@ -141,3 +141,4 @@ d_c99_bool_strict.c(662): operands of '= d_c99_bool_strict.c(670): operands of '=' have incompatible types (_Bool != int) [107] d_c99_bool_strict.c(677): operands of '=' have incompatible types (_Bool != int) [107] d_c99_bool_strict.c(652): warning: argument flags unused in function strict_bool_bitwise_and_enum [231] +d_c99_bool_strict.c(716): operands of '==' have incompatible types (_Bool != int) [107] Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.159 src/usr.bin/xlint/lint1/tree.c:1.160 --- src/usr.bin/xlint/lint1/tree.c:1.159 Sat Jan 16 18:46:59 2021 +++ src/usr.bin/xlint/lint1/tree.c Sat Jan 16 18:48:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.159 2021/01/16 18:46:59 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.160 2021/01/16 18:48:52 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.159 2021/01/16 18:46:59 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.160 2021/01/16 18:48:52 rillig Exp $"); #endif #include @@ -,6 +,21 @@ typeok_strict_bool_assign(op_t op, int a } /* + * Whether the operator can handle (bool, bool) as well as (scalar, scalar), + * but not mixtures between the two type classes. + */ +static bool +needs_compatible_types(op_t op) +{ + return op == EQ || op == NE || + op == AND || op == XOR || op == OR || + op == COLON || + op == ASSIGN || op == ANDASS || op == XORASS || op == ORASS || + op == RETURN || + op == FARG; +} + +/* * In strict bool mode, check whether the types of the operands match the * operator. */ @@ -1132,7 +1147,7 @@ typeok_scalar_strict_bool(op_t op, const rt = NOTSPEC; } - if (op == ASSIGN || op == FARG || op == RETURN || op == COLON) + if (needs_compatible_types(op)) return typeok_strict_bool_assign(op, arg, ln, lt, rn, rt); if (mp->m_takes_only_bool || op == QUEST) {
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Jan 16 18:58:22 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.exp src/usr.bin/xlint/lint1: tree.c Log Message: lint: simplify typeok_strict_bool_compatible To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp cvs rdiff -u -r1.160 -r1.161 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.9 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.10 --- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.9 Sat Jan 16 18:48:52 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp Sat Jan 16 18:58:21 2021 @@ -20,7 +20,7 @@ d_c99_bool_strict.c(224): operands of '= d_c99_bool_strict.c(252): return value type mismatch (_Bool) and (int) [211] d_c99_bool_strict.c(258): return value type mismatch (_Bool) and (int) [211] d_c99_bool_strict.c(264): return value type mismatch (_Bool) and (int) [211] -d_c99_bool_strict.c(270): return value type mismatch (_Bool) and (pointer to const void) [211] +d_c99_bool_strict.c(270): return value type mismatch (_Bool) and (pointer) [211] d_c99_bool_strict.c(268): warning: argument p unused in function strict_bool_conversion_return_pointer [231] d_c99_bool_strict.c(276): return value type mismatch (char) and (_Bool) [211] d_c99_bool_strict.c(282): return value type mismatch (char) and (_Bool) [211] Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.160 src/usr.bin/xlint/lint1/tree.c:1.161 --- src/usr.bin/xlint/lint1/tree.c:1.160 Sat Jan 16 18:48:52 2021 +++ src/usr.bin/xlint/lint1/tree.c Sat Jan 16 18:58:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.160 2021/01/16 18:48:52 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.161 2021/01/16 18:58:21 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.160 2021/01/16 18:48:52 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.161 2021/01/16 18:58:21 rillig Exp $"); #endif #include @@ -1088,9 +1088,7 @@ typeok_assign(const mod_t *mp, const tno * special rule C99 6.3.1.2, without silent change in behavior. */ static bool -typeok_strict_bool_assign(op_t op, int arg, - const tnode_t *ln, tspec_t lt, - const tnode_t *rn, tspec_t rt) +typeok_strict_bool_compatible(op_t op, int arg, tspec_t lt, tspec_t rt) { if ((lt == BOOL) == (rt == BOOL)) return true; @@ -1100,8 +1098,7 @@ typeok_strict_bool_assign(op_t op, int a error(334, arg, tspec_name(lt), tspec_name(rt)); } else if (op == RETURN) { /* return value type mismatch (%s) and (%s) */ - error(211, type_name(ln->tn_type), type_name(rn->tn_type)); - return false; + error(211, tspec_name(lt), tspec_name(rt)); } else { /* operands of '%s' have incompatible types (%s != %s) */ error(107, getopname(op), tspec_name(lt), tspec_name(rt)); @@ -1148,7 +1145,7 @@ typeok_scalar_strict_bool(op_t op, const } if (needs_compatible_types(op)) - return typeok_strict_bool_assign(op, arg, ln, lt, rn, rt); + return typeok_strict_bool_compatible(op, arg, lt, rt); if (mp->m_takes_only_bool || op == QUEST) { bool binary = mp->m_binary;
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sat Jan 16 19:03:47 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: ops.def tree.c Log Message: lint: in strict bool mode, perform the normal checks as well To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.bin/xlint/lint1/ops.def cvs rdiff -u -r1.161 -r1.162 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/ops.def diff -u src/usr.bin/xlint/lint1/ops.def:1.11 src/usr.bin/xlint/lint1/ops.def:1.12 --- src/usr.bin/xlint/lint1/ops.def:1.11 Fri Jan 15 22:07:54 2021 +++ src/usr.bin/xlint/lint1/ops.def Sat Jan 16 19:03:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ops.def,v 1.11 2021/01/15 22:07:54 rillig Exp $ */ +/* $NetBSD: ops.def,v 1.12 2021/01/16 19:03:47 rillig Exp $ */ begin_ops() @@ -71,7 +71,7 @@ op( CVT, "convert", , , , , , , , , ,1, op( ICALL, "icall", 1, , , , , , , , , , , ,1, , , , , , , ,1) op( LOAD, "load", , , , , , , , , , , , , , , , , , , , ,1) op( PUSH, "push", , , , , , , , , ,1, , , , , , , , , , ,1) -op( RETURN, "return", 1, , , , , , , , , , , ,1, , , , ,1, , ,1) +op( RETURN, "return", 1, ,1, , , , , , , , , ,1, , , , ,1, , ,1) op( REAL, "real", , , , , , , , , , , , , , , , , , , , ,0) op( IMAG, "imag", , , , , , , , , , , , , , , , , , , , ,0) @@ -79,7 +79,7 @@ op( IMAG, "imag", , , , , , , , , , , /* name repr b l b o i c a s f v t b s l r p c e e = act */ op( INIT, "init", 1, ,1, , , , , , , , , , , , , , ,1, , ,1) op( CASE, "case", , , , , , , , , , , , , , , , , , , , ,0) -op( FARG, "farg", 1, , , , , , , , , , , , , , , , ,1, , ,1) +op( FARG, "farg", 1, ,1, , , , , , , , , , , , , , ,1, , ,1) end_ops() Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.161 src/usr.bin/xlint/lint1/tree.c:1.162 --- src/usr.bin/xlint/lint1/tree.c:1.161 Sat Jan 16 18:58:21 2021 +++ src/usr.bin/xlint/lint1/tree.c Sat Jan 16 19:03:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.161 2021/01/16 18:58:21 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.162 2021/01/16 19:03:47 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.161 2021/01/16 18:58:21 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.162 2021/01/16 19:03:47 rillig Exp $"); #endif #include @@ -1144,8 +1144,9 @@ typeok_scalar_strict_bool(op_t op, const rt = NOTSPEC; } - if (needs_compatible_types(op)) - return typeok_strict_bool_compatible(op, arg, lt, rt); + if (needs_compatible_types(op) && + !typeok_strict_bool_compatible(op, arg, lt, rt)) + return false; if (mp->m_takes_only_bool || op == QUEST) { bool binary = mp->m_binary;
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sat Jan 16 19:11:36 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: lint: refactor strict bool mode and improve comments The previous comment above typeok_strict_bool_compatible was too hard to understand. To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.162 src/usr.bin/xlint/lint1/tree.c:1.163 --- src/usr.bin/xlint/lint1/tree.c:1.162 Sat Jan 16 19:03:47 2021 +++ src/usr.bin/xlint/lint1/tree.c Sat Jan 16 19:11:36 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.162 2021/01/16 19:03:47 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.163 2021/01/16 19:11:36 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.162 2021/01/16 19:03:47 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.163 2021/01/16 19:11:36 rillig Exp $"); #endif #include @@ -1082,14 +1082,33 @@ typeok_assign(const mod_t *mp, const tno } /* - * For assignment operators in strict bool mode, the type check is stricter - * than for operators that compare to 0. Code that passes this strict check - * can be compiled in a pre-C99 environment that doesn't implement the - * special rule C99 6.3.1.2, without silent change in behavior. + * Whether the operator can handle (bool, bool) as well as (scalar, scalar), + * but not mixtures between the two type classes. + */ +static bool +needs_compatible_types(op_t op) +{ + return op == EQ || op == NE || + op == AND || op == XOR || op == OR || + op == COLON || + op == ASSIGN || op == ANDASS || op == XORASS || op == ORASS || + op == RETURN || + op == FARG; +} + +/* + * Some operators require that either both operands are bool or both are + * scalar. + * + * Code that passes this check can be compiled in a pre-C99 environment that + * doesn't implement the special rule C99 6.3.1.2, without silent change in + * behavior. */ static bool typeok_strict_bool_compatible(op_t op, int arg, tspec_t lt, tspec_t rt) { + if (!needs_compatible_types(op)) + return true; if ((lt == BOOL) == (rt == BOOL)) return true; @@ -1108,21 +1127,6 @@ typeok_strict_bool_compatible(op_t op, i } /* - * Whether the operator can handle (bool, bool) as well as (scalar, scalar), - * but not mixtures between the two type classes. - */ -static bool -needs_compatible_types(op_t op) -{ - return op == EQ || op == NE || - op == AND || op == XOR || op == OR || - op == COLON || - op == ASSIGN || op == ANDASS || op == XORASS || op == ORASS || - op == RETURN || - op == FARG; -} - -/* * In strict bool mode, check whether the types of the operands match the * operator. */ @@ -1144,8 +1148,7 @@ typeok_scalar_strict_bool(op_t op, const rt = NOTSPEC; } - if (needs_compatible_types(op) && - !typeok_strict_bool_compatible(op, arg, lt, rt)) + if (!typeok_strict_bool_compatible(op, arg, lt, rt)) return false; if (mp->m_takes_only_bool || op == QUEST) {
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jan 16 20:26:25 UTC 2021 Modified Files: src/sys/arch/evbarm/conf: GENERIC.common Log Message: Add COMPAT_OSSAUDIO To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/arch/evbarm/conf/GENERIC.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/GENERIC.common diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.40 src/sys/arch/evbarm/conf/GENERIC.common:1.41 --- src/sys/arch/evbarm/conf/GENERIC.common:1.40 Tue Dec 22 23:26:42 2020 +++ src/sys/arch/evbarm/conf/GENERIC.common Sat Jan 16 20:26:25 2021 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC.common,v 1.40 2020/12/22 23:26:42 uwe Exp $ +# $NetBSD: GENERIC.common,v 1.41 2021/01/16 20:26:25 jmcneill Exp $ # # GENERIC evbarm kernel config (template) # @@ -67,8 +67,9 @@ options NFS_BOOT_RWSIZE=1024 # Compatibility options include "conf/compat_netbsd60.config" -options COMPAT_NETBSD32 # allow running arm (e.g. non-earm) binaries on arm -# or arm binaries on arm64 +options COMPAT_OSSAUDIO # OSS audio emulation +options COMPAT_NETBSD32 # allow running arm (e.g. non-earm) binaries +# on arm or arm binaries on arm64 # Shared memory options
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jan 16 20:27:29 UTC 2021 Modified Files: src/sys/arch/evbarm/conf: GENERIC.common Log Message: Add QUOTA and QUOTA2 options To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/conf/GENERIC.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/GENERIC.common diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.41 src/sys/arch/evbarm/conf/GENERIC.common:1.42 --- src/sys/arch/evbarm/conf/GENERIC.common:1.41 Sat Jan 16 20:26:25 2021 +++ src/sys/arch/evbarm/conf/GENERIC.common Sat Jan 16 20:27:29 2021 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC.common,v 1.41 2021/01/16 20:26:25 jmcneill Exp $ +# $NetBSD: GENERIC.common,v 1.42 2021/01/16 20:27:29 jmcneill Exp $ # # GENERIC evbarm kernel config (template) # @@ -26,8 +26,8 @@ no file-system CODA no pseudo-device vcoda # File system options -#options QUOTA # legacy UFS quotas -#options QUOTA2 # new, in-filesystem UFS quotas +options QUOTA # legacy UFS quotas +options QUOTA2 # new, in-filesystem UFS quotas options DISKLABEL_EI # disklabel Endian Independent support options FFS_EI # FFS Endian Independent support options NFSSERVER
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jan 16 20:29:16 UTC 2021 Modified Files: src/sys/arch/evbarm/conf: GENERIC.common Log Message: Add UFS_ACL and UFS_EXTATTR options To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/evbarm/conf/GENERIC.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/GENERIC.common diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.42 src/sys/arch/evbarm/conf/GENERIC.common:1.43 --- src/sys/arch/evbarm/conf/GENERIC.common:1.42 Sat Jan 16 20:27:29 2021 +++ src/sys/arch/evbarm/conf/GENERIC.common Sat Jan 16 20:29:16 2021 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC.common,v 1.42 2021/01/16 20:27:29 jmcneill Exp $ +# $NetBSD: GENERIC.common,v 1.43 2021/01/16 20:29:16 jmcneill Exp $ # # GENERIC evbarm kernel config (template) # @@ -33,6 +33,8 @@ options FFS_EI # FFS Endian Independen options NFSSERVER options WAPBL # File system journaling support #options FFS_NO_SNAPSHOT # No FFS snapshot support +options UFS_ACL # UFS Access Control Lists +options UFS_EXTATTR # Extended attribute support for UFS1 # Networking options
CVS commit: src/etc/mtree
Module Name:src Committed By: rillig Date: Sat Jan 16 20:30:05 UTC 2021 Modified Files: src/etc/mtree: NetBSD.dist.base Log Message: add directory /usr/libdata/lint/strict-bool This is needed for usr.bin/xlint/xlint. To generate a diff of this commit: cvs rdiff -u -r1.230 -r1.231 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.230 src/etc/mtree/NetBSD.dist.base:1.231 --- src/etc/mtree/NetBSD.dist.base:1.230 Mon Nov 23 12:41:47 2020 +++ src/etc/mtree/NetBSD.dist.base Sat Jan 16 20:30:05 2021 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.230 2020/11/23 12:41:47 martin Exp $ +# $NetBSD: NetBSD.dist.base,v 1.231 2021/01/16 20:30:05 rillig Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -297,6 +297,7 @@ ./usr/libdata/firmware/bcm43xx ./usr/libdata/ldscripts ./usr/libdata/lint +./usr/libdata/lint/strict-bool ./usr/libexec ./usr/libexec/ching ./usr/libexec/lpr
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jan 16 20:30:37 UTC 2021 Modified Files: src/sys/arch/evbarm/conf: GENERIC.common Log Message: Add PPP_BSDCOMP, PPP_DEFLATE, PPP_FILTER options To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/conf/GENERIC.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/GENERIC.common diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.43 src/sys/arch/evbarm/conf/GENERIC.common:1.44 --- src/sys/arch/evbarm/conf/GENERIC.common:1.43 Sat Jan 16 20:29:16 2021 +++ src/sys/arch/evbarm/conf/GENERIC.common Sat Jan 16 20:30:37 2021 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC.common,v 1.43 2021/01/16 20:29:16 jmcneill Exp $ +# $NetBSD: GENERIC.common,v 1.44 2021/01/16 20:30:37 jmcneill Exp $ # # GENERIC evbarm kernel config (template) # @@ -46,9 +46,9 @@ options IPSEC # IP security #options MROUTING # IP multicast routing #options PIM # Protocol Independent Multicast #options NETATALK # AppleTalk networking -#options PPP_BSDCOMP # BSD-Compress compression support for PPP -#options PPP_DEFLATE # Deflate compression support for PPP -#options PPP_FILTER # Active filter support for PPP (requires bpf) +options PPP_BSDCOMP # BSD-Compress compression support for PPP +options PPP_DEFLATE # Deflate compression support for PPP +options PPP_FILTER # Active filter support for PPP (requires bpf) #options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG # JIT compiler for bpfilter
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jan 16 20:33:32 UTC 2021 Modified Files: src/sys/arch/evbarm/conf: GENERIC.common Log Message: Add VND_COMPRESSION option To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/evbarm/conf/GENERIC.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/GENERIC.common diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.44 src/sys/arch/evbarm/conf/GENERIC.common:1.45 --- src/sys/arch/evbarm/conf/GENERIC.common:1.44 Sat Jan 16 20:30:37 2021 +++ src/sys/arch/evbarm/conf/GENERIC.common Sat Jan 16 20:33:32 2021 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC.common,v 1.44 2021/01/16 20:30:37 jmcneill Exp $ +# $NetBSD: GENERIC.common,v 1.45 2021/01/16 20:33:32 jmcneill Exp $ # # GENERIC evbarm kernel config (template) # @@ -131,6 +131,7 @@ pseudo-device swcrypto # software crypt # disk/mass storage pseudo-devices #pseudo-device md # memory disk device (ramdisk) pseudo-device vnd # disk-like interface to files +options VND_COMPRESSION # compressed vnd(4) pseudo-device fss # file system snapshot device pseudo-device drvctl # driver control pseudo-device cgd # cryptographic disk devices
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Jan 16 20:49:31 UTC 2021 Modified Files: src/usr.bin/make: main.c make.c make.h meta.c metachar.h var.c Log Message: make(1): fix a few inconsistencies for lint's strict bool mode To generate a diff of this commit: cvs rdiff -u -r1.512 -r1.513 src/usr.bin/make/main.c cvs rdiff -u -r1.234 -r1.235 src/usr.bin/make/make.c cvs rdiff -u -r1.242 -r1.243 src/usr.bin/make/make.h cvs rdiff -u -r1.168 -r1.169 src/usr.bin/make/meta.c cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/metachar.h cvs rdiff -u -r1.781 -r1.782 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.512 src/usr.bin/make/main.c:1.513 --- src/usr.bin/make/main.c:1.512 Sun Jan 10 23:59:53 2021 +++ src/usr.bin/make/main.c Sat Jan 16 20:49:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.512 2021/01/10 23:59:53 rillig Exp $ */ +/* $NetBSD: main.c,v 1.513 2021/01/16 20:49:31 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -110,7 +110,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.512 2021/01/10 23:59:53 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.513 2021/01/16 20:49:31 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -2095,7 +2095,7 @@ shouldDieQuietly(GNode *gn, int bf) else quietly = (gn != NULL && (gn->type & OP_MAKE)) ? 1 : 0; } - return quietly; + return quietly != 0; } static void Index: src/usr.bin/make/make.c diff -u src/usr.bin/make/make.c:1.234 src/usr.bin/make/make.c:1.235 --- src/usr.bin/make/make.c:1.234 Sun Jan 10 21:20:46 2021 +++ src/usr.bin/make/make.c Sat Jan 16 20:49:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.234 2021/01/10 21:20:46 rillig Exp $ */ +/* $NetBSD: make.c,v 1.235 2021/01/16 20:49:31 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -103,7 +103,7 @@ #include "job.h" /* "@(#)make.c 8.1 (Berkeley) 6/6/93" */ -MAKE_RCSID("$NetBSD: make.c,v 1.234 2021/01/10 21:20:46 rillig Exp $"); +MAKE_RCSID("$NetBSD: make.c,v 1.235 2021/01/16 20:49:31 rillig Exp $"); /* Sequence # to detect recursion. */ static unsigned int checked_seqno = 1; @@ -893,7 +893,7 @@ Make_DoAllVar(GNode *gn) gn->flags |= DONE_ALLSRC; } -static int +static Boolean MakeBuildChild(GNode *cn, GNodeListNode *toBeMadeNext) { @@ -903,13 +903,13 @@ MakeBuildChild(GNode *cn, GNodeListNode GNode_FprintDetails(opts.debug_file, "", cn, "\n"); } if (GNode_IsReady(cn)) - return 0; + return FALSE; /* If this node is on the RHS of a .ORDER, check LHSs. */ if (IsWaitingForOrder(cn)) { /* Can't build this (or anything else in this child list) yet */ cn->made = DEFERRED; - return 0; /* but keep looking */ + return FALSE; /* but keep looking */ } DEBUG2(MAKE, "MakeBuildChild: schedule %s%s\n", @@ -925,7 +925,7 @@ MakeBuildChild(GNode *cn, GNodeListNode ListNode *ln; for (ln = cn->cohorts.first; ln != NULL; ln = ln->next) - if (MakeBuildChild(ln->datum, toBeMadeNext) != 0) + if (MakeBuildChild(ln->datum, toBeMadeNext)) break; } @@ -943,7 +943,7 @@ MakeBuildParent(GNode *pn, GNodeListNode if (pn->made != DEFERRED) return 0; - if (MakeBuildChild(pn, toBeMadeNext) == 0) { + if (!MakeBuildChild(pn, toBeMadeNext)) { /* When this node is built, reschedule its parents. */ pn->flags |= DONE_ORDER; } @@ -958,7 +958,7 @@ MakeChildren(GNode *gn) GNodeListNode *ln; for (ln = gn->children.first; ln != NULL; ln = ln->next) - if (MakeBuildChild(ln->datum, toBeMadeNext) != 0) + if (MakeBuildChild(ln->datum, toBeMadeNext)) break; } Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.242 src/usr.bin/make/make.h:1.243 --- src/usr.bin/make/make.h:1.242 Sun Jan 10 21:20:46 2021 +++ src/usr.bin/make/make.h Sat Jan 16 20:49:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.242 2021/01/10 21:20:46 rillig Exp $ */ +/* $NetBSD: make.h,v 1.243 2021/01/16 20:49:31 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -590,7 +590,7 @@ void debug_printf(const char *, ...) MAK do { \ if (DEBUG(module)) \ debug_printf args; \ - } while (/*CONSTCOND*/ 0) + } while (/*CONSTCOND*/FALSE) #define DEBUG0(module, text) \ DEBUG_IMPL(module, ("%s", text)) Index: src/usr.bin/make/meta.c diff -u src/usr.bin/make/meta.c:1.168 src/usr.bin/make/meta.c:1.169 --- src/usr.bin/make/meta.c:1.168 Sun Jan 10 21:20:46 2021 +++ src/usr.bin/make/meta.c Sat Jan 16 20:49:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.168 2021/01/10 21:20:46 rillig Exp $ */ +/* $NetBSD: meta.c,v 1.169 2021/01/16 20:49:31 rillig Exp $ */ /* * Implement 'meta' mode. @@ -403,7 +403,7 @@ printCMDs(GNode *gn, FILE *fp) } \ return FALSE;
CVS commit: src/sys/arch/arm/cortex
Module Name:src Committed By: jmcneill Date: Sat Jan 16 21:05:15 UTC 2021 Modified Files: src/sys/arch/arm/cortex: gicv3.c gicv3.h gicv3_its.c gicv3_its.h Log Message: Remove MAXCPUS dependency. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/cortex/gicv3.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/cortex/gicv3.h cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/cortex/gicv3_its.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/gicv3_its.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/cortex/gicv3.c diff -u src/sys/arch/arm/cortex/gicv3.c:1.38 src/sys/arch/arm/cortex/gicv3.c:1.39 --- src/sys/arch/arm/cortex/gicv3.c:1.38 Tue Dec 22 10:46:51 2020 +++ src/sys/arch/arm/cortex/gicv3.c Sat Jan 16 21:05:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gicv3.c,v 1.38 2020/12/22 10:46:51 jmcneill Exp $ */ +/* $NetBSD: gicv3.c,v 1.39 2021/01/16 21:05:15 jmcneill Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -31,7 +31,7 @@ #define _INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.38 2020/12/22 10:46:51 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.39 2021/01/16 21:05:15 jmcneill Exp $"); #include #include @@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1. #include #include #include +#include #include #include @@ -838,7 +839,8 @@ gicv3_init(struct gicv3_softc *sc) LIST_INIT(&sc->sc_lpi_callbacks); - for (n = 0; n < MAXCPUS; n++) + sc->sc_irouter = kmem_zalloc(sizeof(*sc->sc_irouter) * ncpu, KM_SLEEP); + for (n = 0; n < ncpu; n++) sc->sc_irouter[n] = UINT64_MAX; sc->sc_gicd_typer = gicd_read_4(sc, GICD_TYPER); @@ -876,6 +878,9 @@ gicv3_init(struct gicv3_softc *sc) pic_add(&sc->sc_pic, 0); if ((sc->sc_gicd_typer & GICD_TYPER_LPIS) != 0) { + sc->sc_lpipend = kmem_zalloc(sizeof(*sc->sc_lpipend) * ncpu, KM_SLEEP); + sc->sc_processor_id = kmem_zalloc(sizeof(*sc->sc_processor_id) * ncpu, KM_SLEEP); + sc->sc_lpi.pic_ops = &gicv3_lpiops; sc->sc_lpi.pic_maxsources = 8192; /* Min. required by GICv3 spec */ snprintf(sc->sc_lpi.pic_name, sizeof(sc->sc_lpi.pic_name), "gicv3-lpi"); Index: src/sys/arch/arm/cortex/gicv3.h diff -u src/sys/arch/arm/cortex/gicv3.h:1.10 src/sys/arch/arm/cortex/gicv3.h:1.11 --- src/sys/arch/arm/cortex/gicv3.h:1.10 Fri Dec 4 21:39:26 2020 +++ src/sys/arch/arm/cortex/gicv3.h Sat Jan 16 21:05:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gicv3.h,v 1.10 2020/12/04 21:39:26 jmcneill Exp $ */ +/* $NetBSD: gicv3.h,v 1.11 2021/01/16 21:05:15 jmcneill Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -70,20 +70,20 @@ struct gicv3_softc { u_int sc_pmr_shift; uint32_t sc_enabled_sgippi; - uint64_t sc_irouter[MAXCPUS]; + uint64_t *sc_irouter; /* LPI configuration table */ struct gicv3_dma sc_lpiconf; bool sc_lpiconf_flush; /* LPI pending tables */ - struct gicv3_dma sc_lpipend[MAXCPUS]; + struct gicv3_dma *sc_lpipend; /* LPI IDs */ vmem_t *sc_lpi_pool; /* Unique identifier for PEs */ - u_int sc_processor_id[MAXCPUS]; + u_int *sc_processor_id; /* Callbacks */ LIST_HEAD(, gicv3_lpi_callback) sc_lpi_callbacks; Index: src/sys/arch/arm/cortex/gicv3_its.c diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.31 src/sys/arch/arm/cortex/gicv3_its.c:1.32 --- src/sys/arch/arm/cortex/gicv3_its.c:1.31 Thu Dec 24 14:44:49 2020 +++ src/sys/arch/arm/cortex/gicv3_its.c Sat Jan 16 21:05:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gicv3_its.c,v 1.31 2020/12/24 14:44:49 jmcneill Exp $ */ +/* $NetBSD: gicv3_its.c,v 1.32 2021/01/16 21:05:15 jmcneill Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #define _INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.31 2020/12/24 14:44:49 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.32 2021/01/16 21:05:15 jmcneill Exp $"); #include #include @@ -712,7 +712,7 @@ gicv3_its_table_init(struct gicv3_softc /* * Allocate space for one interrupt collection per CPU. */ - table_size = roundup(entry_size * MAXCPUS, page_size); + table_size = roundup(entry_size * ncpu, page_size); table_type = "Collections"; break; default: @@ -866,6 +866,8 @@ gicv3_its_init(struct gicv3_softc *sc, b its->its_pa = kmem_zalloc(sizeof(struct pci_attach_args *) * its->its_pic->pic_maxsources, KM_SLEEP); its->its_targets = kmem_zalloc(sizeof(struct cpu_info *) * its->its_pic->pic_maxsources, KM_SLEEP); its->its_gic = sc; + its->its_rdbase = kmem_zalloc(sizeof(*its->its_rdbase) * ncpu, KM_SLEEP); + its->its_cpuonline = kmem_zalloc(sizeof(*its->its_cpuonline) * ncpu, KM_SLEEP); its->its_cb.cpu_init = gicv3_its_cpu_init; its->its_cb.get_affinity = gicv3_its_get_affinity; its->its_cb.set_affinity = gicv3_its_set_affinity; Index: src/sys/arch/arm/cortex/gicv3_its.h diff -u src/sys/arch/arm/cortex/gicv3_its.h:1.6 src/sys/arch/arm/cortex
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Jan 16 22:18:14 UTC 2021 Modified Files: src/distrib/sets/lists/comp: mi src/etc/mtree: NetBSD.dist.base src/usr.bin/xlint/xlint: Makefile Log Message: lint: remove custom stdbool.h for strict bool mode again Adding it broke the official builds. To generate a diff of this commit: cvs rdiff -u -r1.2369 -r1.2370 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.231 -r1.232 src/etc/mtree/NetBSD.dist.base cvs rdiff -u -r1.17 -r1.18 src/usr.bin/xlint/xlint/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2369 src/distrib/sets/lists/comp/mi:1.2370 --- src/distrib/sets/lists/comp/mi:1.2369 Sat Jan 16 16:03:46 2021 +++ src/distrib/sets/lists/comp/mi Sat Jan 16 22:18:14 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2369 2021/01/16 16:03:46 rillig Exp $ +# $NetBSD: mi,v 1.2370 2021/01/16 22:18:14 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -4011,8 +4011,6 @@ ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_shatest.debug comp-obsolete openssl=11,obsolete ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_x509v3test.debug comp-obsolete openssl=11,obsolete ./usr/libdata/ldscripts/kmodule comp-util-share binutils,kmod -./usr/libdata/lint/strict-bool comp-c-bin lint -./usr/libdata/lint/strict-bool/stdbool.h comp-c-bin lint ./usr/libdata/lint/llib-larchive.ln comp-c-lintlib lint ./usr/libdata/lint/llib-lasn1.ln comp-krb5-lintlib lint,kerberos ./usr/libdata/lint/llib-lbind9.ln comp-bind-lintlib lint Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.231 src/etc/mtree/NetBSD.dist.base:1.232 --- src/etc/mtree/NetBSD.dist.base:1.231 Sat Jan 16 20:30:05 2021 +++ src/etc/mtree/NetBSD.dist.base Sat Jan 16 22:18:14 2021 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.231 2021/01/16 20:30:05 rillig Exp $ +# $NetBSD: NetBSD.dist.base,v 1.232 2021/01/16 22:18:14 rillig Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -297,7 +297,6 @@ ./usr/libdata/firmware/bcm43xx ./usr/libdata/ldscripts ./usr/libdata/lint -./usr/libdata/lint/strict-bool ./usr/libexec ./usr/libexec/ching ./usr/libexec/lpr Index: src/usr.bin/xlint/xlint/Makefile diff -u src/usr.bin/xlint/xlint/Makefile:1.17 src/usr.bin/xlint/xlint/Makefile:1.18 --- src/usr.bin/xlint/xlint/Makefile:1.17 Sat Jan 16 16:03:46 2021 +++ src/usr.bin/xlint/xlint/Makefile Sat Jan 16 22:18:14 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 2021/01/16 16:03:46 rillig Exp $ +# $NetBSD: Makefile,v 1.18 2021/01/16 22:18:14 rillig Exp $ .PATH: ${.CURDIR}/../lint1 .PATH: ${.CURDIR}/../../mkdep @@ -16,8 +16,8 @@ DPADD+= ${LIBUTIL} LDADD+= -lutil .endif -FILES+= strict-bool-stdbool.h -FILESDIR= /usr/libdata/lint/strict-bool -FILESNAME_strict-bool-stdbool.h= stdbool.h +#FILES+= strict-bool-stdbool.h +#FILESDIR= /usr/libdata/lint/strict-bool +#FILESNAME_strict-bool-stdbool.h= stdbool.h .include
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Sat Jan 16 23:19:50 UTC 2021 Modified Files: src/sys/dev/wscons: wsdisplay_vconsvar.h Log Message: Instead of defining VCONS_DONT_READ as the raw value of 0x30, instead define it as (VCONS_NO_COPYCOLS|VCONS_NO_COPYROWS) for clarify. NFC. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/wscons/wsdisplay_vconsvar.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/dev/wscons/wsdisplay_vconsvar.h diff -u src/sys/dev/wscons/wsdisplay_vconsvar.h:1.27 src/sys/dev/wscons/wsdisplay_vconsvar.h:1.28 --- src/sys/dev/wscons/wsdisplay_vconsvar.h:1.27 Fri Nov 30 05:20:34 2018 +++ src/sys/dev/wscons/wsdisplay_vconsvar.h Sat Jan 16 23:19:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vconsvar.h,v 1.27 2018/11/30 05:20:34 msaitoh Exp $ */ +/* $NetBSD: wsdisplay_vconsvar.h,v 1.28 2021/01/16 23:19:50 jmcneill Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -63,7 +63,8 @@ struct vcons_screen { */ #define VCONS_NO_COPYCOLS 0x10 /* use putchar() based copycols() */ #define VCONS_NO_COPYROWS 0x20 /* use putchar() based copyrows() */ -#define VCONS_DONT_READ 0x30 /* avoid framebuffer reads */ +#define VCONS_DONT_READ (VCONS_NO_COPYCOLS|VCONS_NO_COPYROWS) + /* avoid framebuffer reads */ #define VCONS_LOADFONT 0x40 /* driver can load_font() */ /* status flags used by vcons */ uint32_t scr_status;
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: chs Date: Sat Jan 16 23:50:49 UTC 2021 Modified Files: src/sys/rump/librump/rumpkern: rump.c Log Message: remove a const to allow building with QUEUEDEBUG. To generate a diff of this commit: cvs rdiff -u -r1.351 -r1.352 src/sys/rump/librump/rumpkern/rump.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/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.351 src/sys/rump/librump/rumpkern/rump.c:1.352 --- src/sys/rump/librump/rumpkern/rump.c:1.351 Sun Dec 6 09:03:29 2020 +++ src/sys/rump/librump/rumpkern/rump.c Sat Jan 16 23:50:49 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.351 2020/12/06 09:03:29 skrll Exp $ */ +/* $NetBSD: rump.c,v 1.352 2021/01/16 23:50:49 chs Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.351 2020/12/06 09:03:29 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.352 2021/01/16 23:50:49 chs Exp $"); #include #define ELFSIZE ARCH_ELFSIZE @@ -605,7 +605,7 @@ rump_component_count(enum rump_component void rump_component_init(enum rump_component_type type) { - const struct rump_component *rc, *rc_safe; + struct rump_component *rc, *rc_safe; KASSERT(curlwp == bootlwp); KASSERT(!compinited[type]);
CVS commit: src/sys
Module Name:src Committed By: chs Date: Sat Jan 16 23:51:51 UTC 2021 Modified Files: src/sys/arch/arm/arm: psci.c src/sys/conf: files src/sys/lib/libkern: libkern.h src/sys/lib/libkern/arch/hppa: bcopy.S src/sys/sys: cdefs.h queue.h Log Message: remove unused "_DIAGNOSTIC" option and opt_diagnostic.h. note that this is unrelated to the widely used "DIAGNOSTIC" option. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/arm/psci.c cvs rdiff -u -r1.1277 -r1.1278 src/sys/conf/files cvs rdiff -u -r1.140 -r1.141 src/sys/lib/libkern/libkern.h cvs rdiff -u -r1.15 -r1.16 src/sys/lib/libkern/arch/hppa/bcopy.S cvs rdiff -u -r1.155 -r1.156 src/sys/sys/cdefs.h cvs rdiff -u -r1.75 -r1.76 src/sys/sys/queue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm/psci.c diff -u src/sys/arch/arm/arm/psci.c:1.4 src/sys/arch/arm/arm/psci.c:1.5 --- src/sys/arch/arm/arm/psci.c:1.4 Fri Dec 4 08:00:53 2020 +++ src/sys/arch/arm/arm/psci.c Sat Jan 16 23:51:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: psci.c,v 1.4 2020/12/04 08:00:53 skrll Exp $ */ +/* $NetBSD: psci.c,v 1.5 2021/01/16 23:51:50 chs Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -26,10 +26,8 @@ * SUCH DAMAGE. */ -#include "opt_diagnostic.h" - #include -__KERNEL_RCSID(0, "$NetBSD: psci.c,v 1.4 2020/12/04 08:00:53 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: psci.c,v 1.5 2021/01/16 23:51:50 chs Exp $"); #include #include Index: src/sys/conf/files diff -u src/sys/conf/files:1.1277 src/sys/conf/files:1.1278 --- src/sys/conf/files:1.1277 Tue Oct 27 08:57:11 2020 +++ src/sys/conf/files Sat Jan 16 23:51:50 2021 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1277 2020/10/27 08:57:11 ryo Exp $ +# $NetBSD: files,v 1.1278 2021/01/16 23:51:50 chs Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20171118 @@ -27,7 +27,6 @@ defflag opt_modular.h MODULAR defflag opt_modular.h MODULAR_DEFAULT_AUTOLOAD defflagKEYLOCK defparam opt_syslimits.h CHILD_MAX OPEN_MAX -defflag opt_diagnostic.h _DIAGNOSTIC defflagGPROF defflagKASAN defflag opt_kasan.h KASAN_PANIC Index: src/sys/lib/libkern/libkern.h diff -u src/sys/lib/libkern/libkern.h:1.140 src/sys/lib/libkern/libkern.h:1.141 --- src/sys/lib/libkern/libkern.h:1.140 Fri Apr 17 17:24:46 2020 +++ src/sys/lib/libkern/libkern.h Sat Jan 16 23:51:51 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: libkern.h,v 1.140 2020/04/17 17:24:46 maxv Exp $ */ +/* $NetBSD: libkern.h,v 1.141 2021/01/16 23:51:51 chs Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -35,7 +35,6 @@ #define _LIB_LIBKERN_LIBKERN_H_ #ifdef _KERNEL_OPT -#include "opt_diagnostic.h" #include "opt_kasan.h" #include "opt_kcsan.h" #include "opt_kmsan.h" Index: src/sys/lib/libkern/arch/hppa/bcopy.S diff -u src/sys/lib/libkern/arch/hppa/bcopy.S:1.15 src/sys/lib/libkern/arch/hppa/bcopy.S:1.16 --- src/sys/lib/libkern/arch/hppa/bcopy.S:1.15 Sun Aug 30 07:55:45 2015 +++ src/sys/lib/libkern/arch/hppa/bcopy.S Sat Jan 16 23:51:51 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bcopy.S,v 1.15 2015/08/30 07:55:45 uebayasi Exp $ */ +/* $NetBSD: bcopy.S,v 1.16 2021/01/16 23:51:51 chs Exp $ */ /* * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -38,7 +38,6 @@ #if defined(SPCOPY) && !defined(_STANDALONE) -#include "opt_diagnostic.h" #include "opt_multiprocessor.h" #include @@ -50,7 +49,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -RCSID("$NetBSD: bcopy.S,v 1.15 2015/08/30 07:55:45 uebayasi Exp $") +RCSID("$NetBSD: bcopy.S,v 1.16 2021/01/16 23:51:51 chs Exp $") #endif /* LIBC_SCCS and not lint */ /* Index: src/sys/sys/cdefs.h diff -u src/sys/sys/cdefs.h:1.155 src/sys/sys/cdefs.h:1.156 --- src/sys/sys/cdefs.h:1.155 Fri Dec 4 20:38:44 2020 +++ src/sys/sys/cdefs.h Sat Jan 16 23:51:51 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.155 2020/12/04 20:38:44 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.156 2021/01/16 23:51:51 chs Exp $ */ /* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -36,10 +36,6 @@ #ifndef _SYS_CDEFS_H_ #define _SYS_CDEFS_H_ -#ifdef _KERNEL_OPT -#include "opt_diagnostic.h" -#endif - /* * Macro to test if we're using a GNU C compiler of a specific vintage * or later, for e.g. features that appeared in a particular version Index: src/sys/sys/queue.h diff -u src/sys/sys/queue.h:1.75 src/sys/sys/queue.h:1.76 --- src/sys/sys/queue.h:1.75 Tue Oct 20 23:27:58 2020 +++ src/sys/sys/queue.h Sat Jan 16 23:51:51 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: queue.h,v 1.75 2020/10/20 23:27:58 kamil Exp $ */ +/* $NetBSD: queue.h,v 1.76 2021/01/16 23:51:51 chs Exp $ */ /* * Copyright (c) 1991, 1993 @@ -83,12 +83,9 @@ #include #endif -#if defined(_KERNEL) && defined(_KERNEL_OPT) -#include "opt_diagnostic.h" -#ifdef DIAGNOSTIC +#if defined(_KERNEL) && defined(DIAGNOSTIC) #define QUEUEDEBUG 1 #endif -#e
CVS commit: src/external/bsd/iscsi/dist/src/lib
Module Name:src Committed By: mrg Date: Sun Jan 17 00:13:49 UTC 2021 Modified Files: src/external/bsd/iscsi/dist/src/lib: initiator.c Log Message: remove unset (and always printed as "(null)") gfilename variable. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/external/bsd/iscsi/dist/src/lib/initiator.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/iscsi/dist/src/lib/initiator.c diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.11 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.12 --- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.11 Sun Sep 6 17:06:20 2020 +++ src/external/bsd/iscsi/dist/src/lib/initiator.c Sun Jan 17 00:13:49 2021 @@ -92,7 +92,6 @@ static iscsi_worker_t g_enqueue_worker; static iscsi_queue_t g_enqueue_q; static iscsi_queue_t g_session_q; static int g_initiator_state; -static char *gfilename; /* Testing of initiator_abort */ @@ -905,9 +904,6 @@ iscsi_initiator_start(iscsi_initiator_t set_debug(dbg); } iscsi_trace(TRACE_ISCSI_DEBUG, "initializing initiator\n"); - iscsi_trace(TRACE_ISCSI_DEBUG, - "target config filename to read from: %s\n", gfilename - ? gfilename : "(null)"); port = atoi(iscsi_initiator_getvar(ini, "target port")); if (get_target_config(iscsi_initiator_getvar(ini, "target hostname"), port) != 0) { @@ -3715,9 +3711,6 @@ ii_initiator_init(const char *hostname, USE_ARG(address_family); iscsi_trace(TRACE_ISCSI_DEBUG, "initializing initiator\n"); - iscsi_trace(TRACE_ISCSI_DEBUG, - "target config filename to read from: %s\n", gfilename ? - gfilename : "(null)"); if (get_target_config(hostname, port) != 0) { iscsi_err(__FILE__, __LINE__, "Error getting target configuration from config file\n"); return -1;
CVS commit: src/libexec/httpd
Module Name:src Committed By: mrg Date: Sun Jan 17 00:15:14 UTC 2021 Modified Files: src/libexec/httpd: Makefile.boot Log Message: also set -D_DEFAULT_SOURCE to open up more headers. allow passing $(EXTRALIBS). To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/libexec/httpd/Makefile.boot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/httpd/Makefile.boot diff -u src/libexec/httpd/Makefile.boot:1.8 src/libexec/httpd/Makefile.boot:1.9 --- src/libexec/httpd/Makefile.boot:1.8 Mon Jul 13 09:38:57 2020 +++ src/libexec/httpd/Makefile.boot Sun Jan 17 00:15:14 2021 @@ -6,18 +6,20 @@ CC= cc OPT= -O LARGE_CFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -LOCAL_CFLAGS= -DNO_LUA_SUPPORT -DNO_BLOCKLIST_SUPPORT -D_GNU_SOURCE +LOCAL_CFLAGS= -DNO_LUA_SUPPORT -DNO_BLOCKLIST_SUPPORT -D_GNU_SOURCE -D_DEFAULT_SOURCE CFLAGS= $(OPT) $(LARGE_CFLAGS) $(LOCAL_CFLAGS) GROFF= groff -Tascii CRYPTOLIBDIR= # -L/usr/local/lib CRYPTOLIBS= $(CRYPTOLIBDIR) -lcrypto -lssl +LIBS= $(CRYPTOLIBS) $(EXTRALIBS) + FILES= bozohttpd.c auth-bozo.c cgi-bozo.c content-bozo.c daemon-bozo.c \ dir-index-bozo.c lua-bozo.c ssl-bozo.c tilde-luzah-bozo.c main.c all: - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o bozohttpd $(FILES) $(CRYPTOLIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o bozohttpd $(FILES) $(LIBS) man: $(GROFF) -mandoc bozohttpd.8 > bozohttpd.cat8
CVS commit: src/sbin/modload
Module Name:src Committed By: mrg Date: Sun Jan 17 00:17:40 UTC 2021 Modified Files: src/sbin/modload: modload.8 Log Message: call it "kernel object linker module framework" not just "module framework". the latter is generic enough to also mean the old ld(1) linked loadable kernel modules. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.48 src/sbin/modload/modload.8:1.49 --- src/sbin/modload/modload.8:1.48 Mon Jun 1 03:18:36 2020 +++ src/sbin/modload/modload.8 Sun Jan 17 00:17:40 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.48 2020/06/01 03:18:36 uwe Exp $ +.\" $NetBSD: modload.8,v 1.49 2021/01/17 00:17:40 mrg Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd July 18, 2017 +.Dd November 13, 2020 .Dt MODLOAD 8 .Os .Sh NAME @@ -145,13 +145,15 @@ command was designed to be similar in fu to the corresponding command in .Tn "SunOS 4.1.3" . .Nm -was switched to the module framework for -.Nx 5.0 . +was switched to the kernel object linker module framework for +.Nx 5.0 , +derived from the same framework in +.Fx . .Sh AUTHORS .An -nosplit The original .Nx implementation was written by .An Terrence R. Lambert Aq Mt te...@cs.weber.edu . -The switch to the module framework was by +The switch to the kernel object linker module framework was by .An Andrew Doran Aq Mt a...@netbsd.org .
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: mrg Date: Sun Jan 17 00:18:28 UTC 2021 Modified Files: src/sys/arch/sparc64/dev: psycho.c pyro.c schizo.c Log Message: reduce the scope of 'ci' variable. To generate a diff of this commit: cvs rdiff -u -r1.131 -r1.132 src/sys/arch/sparc64/dev/psycho.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sparc64/dev/pyro.c cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sparc64/dev/schizo.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/sparc64/dev/psycho.c diff -u src/sys/arch/sparc64/dev/psycho.c:1.131 src/sys/arch/sparc64/dev/psycho.c:1.132 --- src/sys/arch/sparc64/dev/psycho.c:1.131 Thu Jan 7 07:40:39 2021 +++ src/sys/arch/sparc64/dev/psycho.c Sun Jan 17 00:18:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: psycho.c,v 1.131 2021/01/07 07:40:39 nakayama Exp $ */ +/* $NetBSD: psycho.c,v 1.132 2021/01/17 00:18:28 mrg Exp $ */ /* * Copyright (c) 1999, 2000 Matthew R. Green @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.131 2021/01/07 07:40:39 nakayama Exp $"); +__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.132 2021/01/17 00:18:28 mrg Exp $"); #include "opt_ddb.h" @@ -1382,7 +1382,6 @@ psycho_pci_conf_read(pci_chipset_tag_t p { struct psycho_pbm *pp = pc->cookie; struct psycho_softc *sc = pp->pp_sc; - struct cpu_info *ci = curcpu(); pcireg_t val = (pcireg_t)~0; int s; @@ -1397,6 +1396,7 @@ psycho_pci_conf_read(pci_chipset_tag_t p (int)PCITAG_OFFSET(tag) + reg)); s = splhigh(); + struct cpu_info *ci = curcpu(); ci->ci_pci_probe = true; membar_Sync(); val = bus_space_read_4(sc->sc_configtag, sc->sc_configaddr, Index: src/sys/arch/sparc64/dev/pyro.c diff -u src/sys/arch/sparc64/dev/pyro.c:1.21 src/sys/arch/sparc64/dev/pyro.c:1.22 --- src/sys/arch/sparc64/dev/pyro.c:1.21 Mon Jan 4 14:48:51 2021 +++ src/sys/arch/sparc64/dev/pyro.c Sun Jan 17 00:18:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pyro.c,v 1.21 2021/01/04 14:48:51 thorpej Exp $ */ +/* $NetBSD: pyro.c,v 1.22 2021/01/17 00:18:28 mrg Exp $ */ /* from: $OpenBSD: pyro.c,v 1.20 2010/12/05 15:15:14 kettenis Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pyro.c,v 1.21 2021/01/04 14:48:51 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pyro.c,v 1.22 2021/01/17 00:18:28 mrg Exp $"); #include #include @@ -283,13 +283,13 @@ pcireg_t pyro_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { struct pyro_pbm *pp = pc->cookie; - struct cpu_info *ci = curcpu(); pcireg_t val = (pcireg_t)~0; int s; DPRINTF(PDB_CONF, ("%s: tag %lx reg %x ", __func__, (long)tag, reg)); if (PCITAG_NODE(tag) != -1 && (unsigned int)reg < PCI_CONF_SIZE) { s = splhigh(); + struct cpu_info *ci = curcpu(); ci->ci_pci_probe = true; membar_Sync(); val = bus_space_read_4(pp->pp_cfgt, pp->pp_cfgh, Index: src/sys/arch/sparc64/dev/schizo.c diff -u src/sys/arch/sparc64/dev/schizo.c:1.42 src/sys/arch/sparc64/dev/schizo.c:1.43 --- src/sys/arch/sparc64/dev/schizo.c:1.42 Tue Oct 1 18:00:07 2019 +++ src/sys/arch/sparc64/dev/schizo.c Sun Jan 17 00:18:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: schizo.c,v 1.42 2019/10/01 18:00:07 chs Exp $ */ +/* $NetBSD: schizo.c,v 1.43 2021/01/17 00:18:28 mrg Exp $ */ /* $OpenBSD: schizo.c,v 1.55 2008/08/18 20:29:37 brad Exp $ */ /* @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: schizo.c,v 1.42 2019/10/01 18:00:07 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: schizo.c,v 1.43 2021/01/17 00:18:28 mrg Exp $"); #include #include @@ -526,13 +526,13 @@ pcireg_t schizo_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) { struct schizo_pbm *sp = pc->cookie; - struct cpu_info *ci = curcpu(); pcireg_t val = (pcireg_t)~0; int s; DPRINTF(SDB_CONF, ("%s: tag %lx reg %x ", __func__, (long)tag, reg)); if (PCITAG_NODE(tag) != -1 && (unsigned int)reg < PCI_CONF_SIZE) { s = splhigh(); + struct cpu_info *ci = curcpu(); ci->ci_pci_probe = true; membar_Sync(); val = bus_space_read_4(sp->sp_cfgt, sp->sp_cfgh,
CVS commit: src/sys/dev/wsfb
Module Name:src Committed By: jmcneill Date: Sun Jan 17 00:23:38 UTC 2021 Modified Files: src/sys/dev/wsfb: genfb.c Log Message: Prefer printing the framebuffer's PA instead of VA. It's much more useful.. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/dev/wsfb/genfb.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/wsfb/genfb.c diff -u src/sys/dev/wsfb/genfb.c:1.78 src/sys/dev/wsfb/genfb.c:1.79 --- src/sys/dev/wsfb/genfb.c:1.78 Mon Oct 19 01:08:06 2020 +++ src/sys/dev/wsfb/genfb.c Sun Jan 17 00:23:38 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: genfb.c,v 1.78 2020/10/19 01:08:06 rin Exp $ */ +/* $NetBSD: genfb.c,v 1.79 2021/01/17 00:23:38 jmcneill Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.78 2020/10/19 01:08:06 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.79 2021/01/17 00:23:38 jmcneill Exp $"); #include #include @@ -41,6 +41,8 @@ __KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1. #include #include +#include + #include #include #include @@ -214,6 +216,7 @@ genfb_attach(struct genfb_softc *sc, str struct wsemuldisplaydev_attach_args aa; prop_dictionary_t dict; struct rasops_info *ri; + paddr_t fb_phys; uint16_t crow; long defattr; bool console; @@ -231,9 +234,16 @@ genfb_attach(struct genfb_softc *sc, str == false) sc->sc_want_clear = true; + fb_phys = (paddr_t)sc->sc_fboffset; + if (fb_phys == 0) { + KASSERT(sc->sc_fbaddr != NULL); + (void)pmap_extract(pmap_kernel(), (vaddr_t)sc->sc_fbaddr, + &fb_phys); + } + aprint_verbose_dev(sc->sc_dev, "framebuffer at %p, size %dx%d, depth %d, " "stride %d\n", - sc->sc_fboffset ? (void *)(intptr_t)sc->sc_fboffset : sc->sc_fbaddr, + fb_phys ? (void *)(intptr_t)fb_phys : sc->sc_fbaddr, sc->sc_width, sc->sc_height, sc->sc_depth, sc->sc_stride); sc->sc_defaultscreen_descr = (struct wsscreen_descr){
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: mrg Date: Sun Jan 17 00:23:59 UTC 2021 Modified Files: src/sys/arch/aarch64/aarch64: db_machdep.c Log Message: add a command to dump the bootconfig passed meminfo. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/aarch64/aarch64/db_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/db_machdep.c diff -u src/sys/arch/aarch64/aarch64/db_machdep.c:1.30 src/sys/arch/aarch64/aarch64/db_machdep.c:1.31 --- src/sys/arch/aarch64/aarch64/db_machdep.c:1.30 Fri Dec 11 18:03:33 2020 +++ src/sys/arch/aarch64/aarch64/db_machdep.c Sun Jan 17 00:23:59 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: db_machdep.c,v 1.30 2020/12/11 18:03:33 skrll Exp $ */ +/* $NetBSD: db_machdep.c,v 1.31 2021/01/17 00:23:59 mrg Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.30 2020/12/11 18:03:33 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.31 2021/01/17 00:23:59 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd32.h" @@ -79,6 +79,7 @@ void db_md_watch_cmd(db_expr_t, bool, db #if defined(_KERNEL) && defined(MULTIPROCESSOR) void db_md_switch_cpu_cmd(db_expr_t, bool, db_expr_t, const char *); #endif +static void db_md_meminfo_cmd(db_expr_t, bool, db_expr_t, const char *); const struct db_command db_machine_command_table[] = { #if defined(_KERNEL) && defined(MULTIPROCESSOR) @@ -152,6 +153,12 @@ const struct db_command db_machine_comma "\t#: watchpoint number to remove" "\t/1..8: size of data\n") }, + { + DDB_ADD_CMD( + "meminfo", db_md_meminfo_cmd, 0, + "Dump info about memory ranges", + NULL, NULL) + }, #endif { DDB_ADD_CMD(NULL, NULL, 0, @@ -1075,3 +1082,18 @@ kdb_trap(int type, struct trapframe *tf) return 1; } #endif + +static void +db_md_meminfo_cmd(db_expr_t addr, bool have_addr, db_expr_t count, +const char *modif) +{ + unsigned blk; + + for (blk = 0; blk < bootconfig.dramblocks; blk++) { + db_printf("blk[%u]: start %lx end %lx (pages %x)\n", + blk, bootconfig.dram[blk].address, + bootconfig.dram[blk].address + + (uint64_t)bootconfig.dram[blk].pages * PAGE_SIZE, + bootconfig.dram[blk].pages); + } +}
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Sun Jan 17 00:35:46 UTC 2021 Modified Files: src/sys/dev/wscons: wsdisplay_vcons_util.c Log Message: trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/wscons/wsdisplay_vcons_util.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/wscons/wsdisplay_vcons_util.c diff -u src/sys/dev/wscons/wsdisplay_vcons_util.c:1.3 src/sys/dev/wscons/wsdisplay_vcons_util.c:1.4 --- src/sys/dev/wscons/wsdisplay_vcons_util.c:1.3 Wed Jan 30 11:24:48 2019 +++ src/sys/dev/wscons/wsdisplay_vcons_util.c Sun Jan 17 00:35:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons_util.c,v 1.3 2019/01/30 11:24:48 jmcneill Exp $ */ +/* $NetBSD: wsdisplay_vcons_util.c,v 1.4 2021/01/17 00:35:46 jmcneill Exp $ */ /*- * Copyright (c) 2009 Michael Lorenz @@ -46,7 +46,7 @@ #include -void +void vcons_replay_msgbuf(struct vcons_screen *scr) { int status = scr->scr_status;
CVS commit: src/sys/arch/sparc
Module Name:src Committed By: mrg Date: Sun Jan 17 01:02:28 UTC 2021 Modified Files: src/sys/arch/sparc/include: autoconf.h src/sys/arch/sparc/sparc: autoconf.c cpu.c Log Message: set machine_model[] earlier, so that bootstrap can use it. also, avoid "extern " in .c files, and add idempotency to autoconf.h. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/arch/sparc/include/autoconf.h cvs rdiff -u -r1.261 -r1.262 src/sys/arch/sparc/sparc/autoconf.c cvs rdiff -u -r1.257 -r1.258 src/sys/arch/sparc/sparc/cpu.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/sparc/include/autoconf.h diff -u src/sys/arch/sparc/include/autoconf.h:1.48 src/sys/arch/sparc/include/autoconf.h:1.49 --- src/sys/arch/sparc/include/autoconf.h:1.48 Sat Oct 27 17:18:11 2012 +++ src/sys/arch/sparc/include/autoconf.h Sun Jan 17 01:02:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.48 2012/10/27 17:18:11 chs Exp $ */ +/* $NetBSD: autoconf.h,v 1.49 2021/01/17 01:02:28 mrg Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -69,6 +69,9 @@ * @(#)autoconf.h 8.2 (Berkeley) 9/30/93 */ +#ifndef _MACHINE_AUTOCONF_H_ +#define _MACHINE_AUTOCONF_H_ + /* * Autoconfiguration information. */ @@ -173,3 +176,8 @@ void mountroot_hook_establish(void (*)(d void bootstrap(void); int romgetcursoraddr(int **, int **); + +/* Exported from autoconf.c for other consumers. */ +extern char machine_model[100]; + +#endif /* !_MACHINE_AUTOCONF_H_ */ Index: src/sys/arch/sparc/sparc/autoconf.c diff -u src/sys/arch/sparc/sparc/autoconf.c:1.261 src/sys/arch/sparc/sparc/autoconf.c:1.262 --- src/sys/arch/sparc/sparc/autoconf.c:1.261 Fri Aug 14 10:34:22 2020 +++ src/sys/arch/sparc/sparc/autoconf.c Sun Jan 17 01:02:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.261 2020/08/14 10:34:22 martin Exp $ */ +/* $NetBSD: autoconf.c,v 1.262 2021/01/17 01:02:28 mrg Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.261 2020/08/14 10:34:22 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.262 2021/01/17 01:02:28 mrg Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -169,6 +169,33 @@ matchbyname(device_t parent, cfdata_t cf } /* + * Set machine_model[] to something useful. If late is set, then + * have now probed the sun4 class and can finish it. Other systems + * are complete with the first call with late=false out of bootstrap. + */ +static void +set_machine_model(bool late) +{ + char namebuf[32]; + + if (!CPU_ISSUN4) { + if (late) { + KASSERT(machine_model[0] != '\0'); + } else { + snprintf(machine_model, sizeof machine_model, "%s", + prom_getpropstringA(findroot(), "name", namebuf, + sizeof(namebuf))); + } + return; + } + if (late) + snprintf(machine_model, sizeof machine_model, "SUN-4/%d series", + cpuinfo.classlvl); + else + snprintf(machine_model, sizeof machine_model, "SUN-4 series"); +} + +/* * Get the number of CPUs in the system and the CPUs' SPARC architecture * version. We need this information early in the boot process. */ @@ -188,6 +215,9 @@ find_cpus(void) */ cpu_arch = 7; + /* Initialise machine_model, early phase. */ + set_machine_model(false); + /* On sun4 and sun4c we support only one CPU */ if (!CPU_ISSUN4M && !CPU_ISSUN4D) return (1); @@ -1181,14 +1211,7 @@ extern struct sparc_bus_space_tag mainbu #define openboot_special4d ((void *)0) #endif - - if (CPU_ISSUN4) - snprintf(machine_model, sizeof machine_model, "SUN-4/%d series", - cpuinfo.classlvl); - else - snprintf(machine_model, sizeof machine_model, "%s", - prom_getpropstringA(findroot(), "name", namebuf, - sizeof(namebuf))); + set_machine_model(true); prom_getidprom(); printf(": %s: hostid %lx\n", machine_model, hostid); Index: src/sys/arch/sparc/sparc/cpu.c diff -u src/sys/arch/sparc/sparc/cpu.c:1.257 src/sys/arch/sparc/sparc/cpu.c:1.258 --- src/sys/arch/sparc/sparc/cpu.c:1.257 Sat Dec 5 08:04:51 2020 +++ src/sys/arch/sparc/sparc/cpu.c Sun Jan 17 01:02:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.257 2020/12/05 08:04:51 mrg Exp $ */ +/* $NetBSD: cpu.c,v 1.258 2021/01/17 01:02:28 mrg Exp $ */ /* * Copyright (c) 1996 @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.257 2020/12/05 08:04:51 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.258 2021/01/17 01:02:28 mrg Exp $"); #include "opt_multiprocessor.h" #include "opt_lockdebug.h" @@ -115,7 +115,6 @@ struct cpu_softc { char machine[] = MACHINE; /* from */ char machine_arch[] = MACHINE_ARCH; /* from */ int cpu_arch; /* sparc architecture version */ -extern char machine_model[]; int sparc_ncpus; /* # of CPUs detected by PROM */ struct cpu_info *cpus[_MAXNCPU+1]; /* we only support 4 CPUs. */
CVS commit: src/sys/arch/sparc/sparc
Module Name:src Committed By: mrg Date: Sun Jan 17 01:04:58 UTC 2021 Modified Files: src/sys/arch/sparc/sparc: autoconf.c Log Message: note that find_cpus() also sets cpu_arch. To generate a diff of this commit: cvs rdiff -u -r1.262 -r1.263 src/sys/arch/sparc/sparc/autoconf.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/sparc/sparc/autoconf.c diff -u src/sys/arch/sparc/sparc/autoconf.c:1.262 src/sys/arch/sparc/sparc/autoconf.c:1.263 --- src/sys/arch/sparc/sparc/autoconf.c:1.262 Sun Jan 17 01:02:28 2021 +++ src/sys/arch/sparc/sparc/autoconf.c Sun Jan 17 01:04:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.262 2021/01/17 01:02:28 mrg Exp $ */ +/* $NetBSD: autoconf.c,v 1.263 2021/01/17 01:04:58 mrg Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.262 2021/01/17 01:02:28 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.263 2021/01/17 01:04:58 mrg Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -198,6 +198,8 @@ set_machine_model(bool late) /* * Get the number of CPUs in the system and the CPUs' SPARC architecture * version. We need this information early in the boot process. + * + * This also sets cpu_arch to 8 on sun4m and sun4d. */ static int find_cpus(void)
CVS commit: src/sys/arch/sparc/sparc
Module Name:src Committed By: mrg Date: Sun Jan 17 01:54:37 UTC 2021 Modified Files: src/sys/arch/sparc/sparc: pmap.c Log Message: convert most uses of pmapdebug to use the new DPRINTF() macro. add PMAP_INITLOUD debug option, that shows how pmap_bootstrap() eats up the space provided by /boot as spare space. To generate a diff of this commit: cvs rdiff -u -r1.371 -r1.372 src/sys/arch/sparc/sparc/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/sparc/sparc/pmap.c diff -u src/sys/arch/sparc/sparc/pmap.c:1.371 src/sys/arch/sparc/sparc/pmap.c:1.372 --- src/sys/arch/sparc/sparc/pmap.c:1.371 Wed Jan 13 16:42:17 2021 +++ src/sys/arch/sparc/sparc/pmap.c Sun Jan 17 01:54:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.371 2021/01/13 16:42:17 chs Exp $ */ +/* $NetBSD: pmap.c,v 1.372 2021/01/17 01:54:37 mrg Exp $ */ /* * Copyright (c) 1996 @@ -56,7 +56,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.371 2021/01/13 16:42:17 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.372 2021/01/17 01:54:37 mrg Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -155,6 +155,7 @@ EVCNT_ATTACH_STATIC(mmu_pagein_evcnt); #define PDB_CHANGEPROT 0x0008 #define PDB_ENTER 0x0010 #define PDB_FOLLOW 0x0020 +#define PDB_INITLOUD 0x0040 #define PDB_MMU_ALLOC 0x0100 #define PDB_MMU_STEAL 0x0200 @@ -166,6 +167,12 @@ EVCNT_ATTACH_STATIC(mmu_pagein_evcnt); #define PDB_SWITCHMAP 0x8000 #define PDB_SANITYCHK 0x1 int pmapdebug = 0; +#define DPRINTF(level, fmt, ...) do { \ + if (pmapdebug & (level)) \ + printf("%s:%d: " fmt "\n", __func__, __LINE__, ##__VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(level, fmt, ...) /* nothing */ #endif /* @@ -1619,8 +1626,8 @@ me_alloc(struct mmuentry *mh, struct pma #ifdef DEBUG if (me->me_pmap != NULL) panic("me_alloc: freelist entry has pmap"); - if (pmapdebug & PDB_MMU_ALLOC) - printf("me_alloc: got pmeg %d\n", me->me_cookie); + DPRINTF(PDB_MMU_ALLOC, + "me_alloc: got pmeg %d", me->me_cookie); #endif mmuq_insert_tail(mh, me); @@ -1651,11 +1658,8 @@ me_alloc(struct mmuentry *mh, struct pma me = mmuq_first(&segm_lru); pm = me->me_pmap; -#ifdef DEBUG - if (pmapdebug & (PDB_MMU_ALLOC | PDB_MMU_STEAL)) - printf("me_alloc: stealing pmeg 0x%x from pmap %p\n", - me->me_cookie, pm); -#endif + DPRINTF(PDB_MMU_ALLOC | PDB_MMU_STEAL, + "me_alloc: stealing pmeg 0x%x from pmap %p", me->me_cookie, pm); mmu_stolenpmegs_evcnt.ev_count++; @@ -1801,9 +1805,8 @@ me_free(struct pmap *pm, u_int pmeg) #ifdef DEBUG rp = &pm->pm_regmap[me->me_vreg]; - if (pmapdebug & PDB_MMU_ALLOC) - printf("me_free: freeing pmeg %d from pmap %p\n", - me->me_cookie, pm); + DPRINTF(PDB_MMU_ALLOC, + "me_free: freeing pmeg %d from pmap %p", me->me_cookie, pm); if (me->me_cookie != pmeg) panic("me_free: wrong mmuentry"); if (pm != me->me_pmap) @@ -1869,8 +1872,8 @@ region_alloc(struct mmuentry *mh, struct #ifdef DEBUG if (me->me_pmap != NULL) panic("region_alloc: freelist entry has pmap"); - if (pmapdebug & PDB_MMUREG_ALLOC) - printf("region_alloc: got smeg 0x%x\n", me->me_cookie); + DPRINTF(PDB_MMUREG_ALLOC, + "region_alloc: got smeg 0x%x", me->me_cookie); #endif mmuq_insert_tail(mh, me); @@ -1895,11 +1898,10 @@ region_alloc(struct mmuentry *mh, struct panic("region_alloc: LRU entry has no pmap"); if (pm == pmap_kernel()) panic("region_alloc: stealing from kernel"); -#ifdef DEBUG - if (pmapdebug & (PDB_MMUREG_ALLOC | PDB_MMUREG_STEAL)) - printf("region_alloc: stealing smeg 0x%x from pmap %p\n", - me->me_cookie, pm); -#endif + DPRINTF(PDB_MMUREG_ALLOC | PDB_MMUREG_STEAL, + "region_alloc: stealing smeg 0x%x from pmap %p", + me->me_cookie, pm); + /* * Remove from LRU list, and insert at end of new list * (probably the LRU list again, but so what?). @@ -1946,10 +1948,9 @@ region_free(struct pmap *pm, u_int smeg) { struct mmuentry *me = &mmuregions[smeg]; + DPRINTF(PDB_MMUREG_ALLOC, + "region_free: freeing smeg 0x%x from pmap %p", me->me_cookie, pm); #ifdef DEBUG - if (pmapdebug & PDB_MMUREG_ALLOC) - printf("region_free: freeing smeg 0x%x from pmap %p\n", - me->me_cookie, pm); if (me->me_cookie != smeg) panic("region_free: wrong mmuentry"); if (pm != me->me_pmap) @@ -2145,9 +2146,10 @@ ctx_alloc(struct pmap *pm) #ifdef DEBUG if (pm->pm_ctx) panic("ctx_alloc pm_ctx"); - if (pmapdebug & PDB_CTX_ALLOC) - printf("ctx_alloc[%d](%p)\n", cpu_number(), pm); #endif + DPRINTF(PDB_CTX_ALLOC, + "ctx_alloc[%d](%p)", cpu_number(), pm); + if (CPU_HAS_SUNMMU) { gap_start = pm->pm_gap_start; gap_end = pm->pm_gap_end; @@ -2169,10 +2171,11 @@ ctx_alloc(struct pmap *pm) #ifdef DEBUG if (c->c_pmap == NULL) panic("ctx_alloc cu_pmap"); - if (pmapdebug & (PDB_CTX_ALLOC | PDB_CTX_STEAL)) - printf("ctx_alloc[%d]: steal context %