Re: CVS commit: src/external/historical/nawk/bin
04.07.2022 01:54:16 Valery Ushakov : > On Mon, Jul 04, 2022 at 00:07:23 +0200, Roland Illig wrote: > >> Am 03.07.2022 um 21:55 schrieb Valery Ushakov: >>> On Sun, Jul 03, 2022 at 10:56:22 +, Roland Illig wrote: >>> Module Name: src Committed By: rillig Date: Sun Jul 3 10:56:22 UTC 2022 Modified Files: src/external/historical/nawk/bin: awk.1 Log Message: awk.1: remove trailing space in output of 'echo' example program >>> >>> This is cure worse than the desease. Please revert. >> >> Why is it worse? > > It's ugly Why is it ugly? > and complicated (for an example), Why is it complicated? It's still only 3 lines of code. > it obscures the point this example tries to make. What is this (single?) point this example tries to make? To me, it was how to write a BEGIN program that uses ARGV, and my rewritten code still illustrates this. > The point is not to write a perfect echo(1) clone in awk. If that had been my goal, I would have implemented the -n option as well, at which point the code would have grown large enough to be extracted into a separate file. I didn't do that though. Roland
Re: CVS commit: src/external/historical/nawk/bin
On Mon, Jul 04, 2022 at 00:07:23 +0200, Roland Illig wrote: > Am 03.07.2022 um 21:55 schrieb Valery Ushakov: > > On Sun, Jul 03, 2022 at 10:56:22 +, Roland Illig wrote: > > > > > Module Name: src > > > Committed By: rillig > > > Date: Sun Jul 3 10:56:22 UTC 2022 > > > > > > Modified Files: > > > src/external/historical/nawk/bin: awk.1 > > > > > > Log Message: > > > awk.1: remove trailing space in output of 'echo' example program > > > > This is cure worse than the desease. Please revert. > > Why is it worse? It's ugly, and complicated (for an example), and it obscures the point this example tries to make. The point is not to write a perfect echo(1) clone in awk. -uwe
Re: CVS commit: src/external/historical/nawk/bin
Am 03.07.2022 um 21:55 schrieb Valery Ushakov: On Sun, Jul 03, 2022 at 10:56:22 +, Roland Illig wrote: Module Name:src Committed By: rillig Date: Sun Jul 3 10:56:22 UTC 2022 Modified Files: src/external/historical/nawk/bin: awk.1 Log Message: awk.1: remove trailing space in output of 'echo' example program This is cure worse than the desease. Please revert. Why is it worse?
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 21:17:24 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: check-msgs.lua Log Message: lint: do not treat message IDs as arithmetic numbers No functional change. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/lint1/check-msgs.lua 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/check-msgs.lua diff -u src/usr.bin/xlint/lint1/check-msgs.lua:1.15 src/usr.bin/xlint/lint1/check-msgs.lua:1.16 --- src/usr.bin/xlint/lint1/check-msgs.lua:1.15 Sun Jul 3 20:05:46 2022 +++ src/usr.bin/xlint/lint1/check-msgs.lua Sun Jul 3 21:17:24 2022 @@ -1,5 +1,5 @@ #! /usr/bin/lua --- $NetBSD: check-msgs.lua,v 1.15 2022/07/03 20:05:46 rillig Exp $ +-- $NetBSD: check-msgs.lua,v 1.16 2022/07/03 21:17:24 rillig Exp $ --[[ @@ -11,14 +11,14 @@ actual user-visible message text in err. ]] -local function load_messages(fname) - local msgs = {} ---@type tablestring +local function load_messages() + local msgs = {} ---@type tablestring - local f = assert(io.open(fname, "r")) + local f = assert(io.open("err.c")) for line in f:lines() do local msg, id = line:match("%s*\"(.+)\",%s*/%*%s*(%d+)%s*%*/$") if msg ~= nil then - msgs[tonumber(id)] = msg + msgs[id] = msg end end @@ -40,7 +40,7 @@ local function check_message(fname, line local msg = msgs[id] if msg == nil then -print_error("%s:%d: id=%d not found", fname, lineno, id) +print_error("%s:%d: id=%s not found", fname, lineno, id) return end @@ -57,7 +57,7 @@ local function check_message(fname, line return end - print_error("%s:%d: id=%-3d msg=%-40s comment=%s", + print_error("%s:%d: id=%-3s msg=%-40s comment=%s", fname, lineno, id, msg, comment) end @@ -80,12 +80,11 @@ local function check_file(fname, msgs) local func, id = line:match("^%s+([%w_]+)%((%d+)[),]") if is_message_function[func] then - id = tonumber(id) local comment = prev:match("^%s+/%* (.+) %*/$") if comment ~= nil then check_message(fname, lineno, id, comment, msgs) else -print_error("%s:%d: missing comment for %d: /* %s */", +print_error("%s:%d: missing comment for %s: /* %s */", fname, lineno, id, msgs[id]) end end @@ -112,10 +111,10 @@ local function check_test_files(msgs) local cmd = ("cd '%s' && printf '%%s\\n' msg_[0-9][0-9][0-9]*.c"):format(testdir) local filenames = assert(io.popen(cmd)) for filename in filenames:lines() do -local msgid = tonumber(filename:match("^msg_(%d%d%d)")) +local msgid = filename:match("^msg_(%d%d%d)") if msgs[msgid] then local unescaped_msg = msgs[msgid]:gsub("\\(.)", "%1") - local expected_text = ("%s [%d]"):format(unescaped_msg, msgid) + local expected_text = ("%s [%s]"):format(unescaped_msg, msgid) local fullname = ("%s/%s"):format(testdir, filename) if not file_contains(fullname, expected_text) then print_error("%s must contain: %s", fullname, expected_text) @@ -126,7 +125,7 @@ local function check_test_files(msgs) end local function main(arg) - local msgs = load_messages("err.c") + local msgs = load_messages() for _, fname in ipairs(arg) do check_file(fname, msgs) end
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 21:17:24 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: check-msgs.lua Log Message: lint: do not treat message IDs as arithmetic numbers No functional change. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/lint1/check-msgs.lua Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 20:05:46 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: check-msgs.lua Log Message: lint: remove unused code in consistency checker To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/lint1/check-msgs.lua 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/check-msgs.lua diff -u src/usr.bin/xlint/lint1/check-msgs.lua:1.14 src/usr.bin/xlint/lint1/check-msgs.lua:1.15 --- src/usr.bin/xlint/lint1/check-msgs.lua:1.14 Sun Jul 3 07:33:08 2022 +++ src/usr.bin/xlint/lint1/check-msgs.lua Sun Jul 3 20:05:46 2022 @@ -1,5 +1,5 @@ #! /usr/bin/lua --- $NetBSD: check-msgs.lua,v 1.14 2022/07/03 07:33:08 rillig Exp $ +-- $NetBSD: check-msgs.lua,v 1.15 2022/07/03 20:05:46 rillig Exp $ --[[ @@ -108,13 +108,6 @@ end -- Ensure that each test file for a particular message mentions the full text -- of that message and the message ID. local function check_test_files(msgs) - - local msgids = {} - for msgid, _ in pairs(msgs) do -table.insert(msgids, msgid) - end - table.sort(msgids) - local testdir = "../../../tests/usr.bin/xlint/lint1" local cmd = ("cd '%s' && printf '%%s\\n' msg_[0-9][0-9][0-9]*.c"):format(testdir) local filenames = assert(io.popen(cmd))
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 20:05:46 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: check-msgs.lua Log Message: lint: remove unused code in consistency checker To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/lint1/check-msgs.lua Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: andvar Date: Sun Jul 3 19:58:42 UTC 2022 Modified Files: src/sys/arch/evbarm/armadillo: armadillo9_machdep.c src/sys/arch/evbarm/g42xxeb: g42xxeb_machdep.c src/sys/arch/evbarm/tsarm: tsarm_machdep.c src/sys/arch/zaurus/zaurus: machdep.c src/sys/dev/ieee1394: fwohci.c Log Message: s/bounaries/boundaries/ in comments. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbarm/tsarm/tsarm_machdep.c cvs rdiff -u -r1.49 -r1.50 src/sys/arch/zaurus/zaurus/machdep.c cvs rdiff -u -r1.150 -r1.151 src/sys/dev/ieee1394/fwohci.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/evbarm/armadillo/armadillo9_machdep.c diff -u src/sys/arch/evbarm/armadillo/armadillo9_machdep.c:1.37 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c:1.38 --- src/sys/arch/evbarm/armadillo/armadillo9_machdep.c:1.37 Tue Aug 17 22:00:28 2021 +++ src/sys/arch/evbarm/armadillo/armadillo9_machdep.c Sun Jul 3 19:58:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: armadillo9_machdep.c,v 1.37 2021/08/17 22:00:28 andvar Exp $ */ +/* $NetBSD: armadillo9_machdep.c,v 1.38 2022/07/03 19:58:42 andvar Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -110,7 +110,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: armadillo9_machdep.c,v 1.37 2021/08/17 22:00:28 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: armadillo9_machdep.c,v 1.38 2022/07/03 19:58:42 andvar Exp $"); #include "opt_arm_debug.h" #include "opt_console.h" @@ -559,7 +559,7 @@ initarm(void *arg) * array. * * The kernel page directory must be on a 16K boundary. The page - * tables must be on 4K bounaries. What we do is allocate the + * tables must be on 4K boundaries. What we do is allocate the * page directory on the first 16K boundary that we encounter, and * the page tables on 4K boundaries otherwise. Since we allocate * at least 3 L2 page tables, we are guaranteed to encounter at Index: src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c diff -u src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c:1.38 src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c:1.39 --- src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c:1.38 Tue Aug 17 22:00:28 2021 +++ src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c Sun Jul 3 19:58:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: g42xxeb_machdep.c,v 1.38 2021/08/17 22:00:28 andvar Exp $ */ +/* $NetBSD: g42xxeb_machdep.c,v 1.39 2022/07/03 19:58:42 andvar Exp $ */ /* * Copyright (c) 2002, 2003, 2004, 2005 Genetec Corporation. @@ -548,7 +548,7 @@ initarm(void *arg) * array. * * The kernel page directory must be on a 16K boundary. The page - * tables must be on 4K bounaries. What we do is allocate the + * tables must be on 4K boundaries. What we do is allocate the * page directory on the first 16K boundary that we encounter, and * the page tables on 4K boundaries otherwise. Since we allocate * at least 3 L2 page tables, we are guaranteed to encounter at Index: src/sys/arch/evbarm/tsarm/tsarm_machdep.c diff -u src/sys/arch/evbarm/tsarm/tsarm_machdep.c:1.33 src/sys/arch/evbarm/tsarm/tsarm_machdep.c:1.34 --- src/sys/arch/evbarm/tsarm/tsarm_machdep.c:1.33 Sun Nov 21 08:44:28 2021 +++ src/sys/arch/evbarm/tsarm/tsarm_machdep.c Sun Jul 3 19:58:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tsarm_machdep.c,v 1.33 2021/11/21 08:44:28 skrll Exp $ */ +/* $NetBSD: tsarm_machdep.c,v 1.34 2022/07/03 19:58:42 andvar Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tsarm_machdep.c,v 1.33 2021/11/21 08:44:28 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tsarm_machdep.c,v 1.34 2022/07/03 19:58:42 andvar Exp $"); #include "opt_arm_debug.h" #include "opt_console.h" @@ -472,7 +472,7 @@ initarm(void *arg) * array. * * The kernel page directory must be on a 16K boundary. The page - * tables must be on 4K bounaries. What we do is allocate the + * tables must be on 4K boundaries. What we do is allocate the * page directory on the first 16K boundary that we encounter, and * the page tables on 4K boundaries otherwise. Since we allocate * at least 3 L2 page tables, we are guaranteed to encounter at Index: src/sys/arch/zaurus/zaurus/machdep.c diff -u src/sys/arch/zaurus/zaurus/machdep.c:1.49 src/sys/arch/zaurus/zaurus/machdep.c:1.50 --- src/sys/arch/zaurus/zaurus/machdep.c:1.49 Sun Jan 2 16:40:46 2022 +++ src/sys/arch/zaurus/zaurus/machdep.c Sun Jul 3 19:58:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.49 2022/01/02 16:40:46 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.50 2022/07/03 19:58:42 andvar Exp $ */ /* $OpenBSD: zaurus_machdep.c,v 1.25 2006/06/20 18:24:04 todd Exp $ */ /* @@ -107,7 +10
CVS commit: src/sys
Module Name:src Committed By: andvar Date: Sun Jul 3 19:58:42 UTC 2022 Modified Files: src/sys/arch/evbarm/armadillo: armadillo9_machdep.c src/sys/arch/evbarm/g42xxeb: g42xxeb_machdep.c src/sys/arch/evbarm/tsarm: tsarm_machdep.c src/sys/arch/zaurus/zaurus: machdep.c src/sys/dev/ieee1394: fwohci.c Log Message: s/bounaries/boundaries/ in comments. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbarm/tsarm/tsarm_machdep.c cvs rdiff -u -r1.49 -r1.50 src/sys/arch/zaurus/zaurus/machdep.c cvs rdiff -u -r1.150 -r1.151 src/sys/dev/ieee1394/fwohci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/external/historical/nawk/bin
On Sun, Jul 03, 2022 at 10:56:22 +, Roland Illig wrote: > Module Name: src > Committed By: rillig > Date: Sun Jul 3 10:56:22 UTC 2022 > > Modified Files: > src/external/historical/nawk/bin: awk.1 > > Log Message: > awk.1: remove trailing space in output of 'echo' example program This is cure worse than the desease. Please revert. -uwe
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 19:47:34 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: README.md Log Message: lint: extend implementation documentation To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/lint1/README.md Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 19:47:34 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: README.md Log Message: lint: extend implementation documentation To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/lint1/README.md 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/README.md diff -u src/usr.bin/xlint/lint1/README.md:1.6 src/usr.bin/xlint/lint1/README.md:1.7 --- src/usr.bin/xlint/lint1/README.md:1.6 Fri Jun 17 18:54:53 2022 +++ src/usr.bin/xlint/lint1/README.md Sun Jul 3 19:47:34 2022 @@ -1,10 +1,10 @@ -[//]: # ($NetBSD: README.md,v 1.6 2022/06/17 18:54:53 rillig Exp $) +[//]: # ($NetBSD: README.md,v 1.7 2022/07/03 19:47:34 rillig Exp $) # Introduction Lint1 analyzes a single translation unit of C code. -* It reads the output of the C preprocessor, comments are retained. +* It reads the output of the C preprocessor, retaining the comments. * The lexer in `scan.l` and `lex.c` splits the input into tokens. * The parser in `cgram.y` creates types and expressions from the tokens. * It checks declarations in `decl.c`. @@ -19,8 +19,13 @@ test in `tests/usr.bin/xlint/lint1/msg_? ## Type checking Lint has stricter type checking than most C compilers. -It warns about type conversions that may result in alignment problems, -see the test `msg_135.c` for examples. + +In _strict bool mode_, lint treats `bool` as a type that is incompatible with +other scalar types, like in C#, Go, Java. +See the test `d_c99_bool_strict.c` for details. + +Lint warns about type conversions that may result in alignment problems. +See the test `msg_135.c` for examples. ## Control flow analysis @@ -36,6 +41,27 @@ This part of lint is not robust though, as variables may not be properly initialized or be null pointers. The cleanup after handling a parse error is often incomplete. +## Configurable diagnostic messages + +Whether lint prints a message and whether each message is an error or a +warning depends on several things: + +* The language level, with its possible values: +* traditional C (`-t`) +* migration from traditional C and C90 (default) +* C90 (`-s`) +* C99 (`-S`) +* C11 (`-Ac11`) +* In GCC mode (`-g`), lint allows several GNU extensions, + reducing the amount of printed messages. +* In strict bool mode (`-T`), lint issues errors when `bool` is mixed with + other scalar types, reusing the existing messages 107 and 211, while also + defining new messages that are specific to strict bool mode. +* The option `-a` performs the check for lossy conversions from large integer + types, the option `-aa` extends this check to small integer types as well, + reusing the same message ID. +* The option `-X` suppresses arbitrary messages by their message ID. + # Fundamental types Lint mainly analyzes expressions (`tnode_t`), which are formed from operators @@ -133,15 +159,15 @@ See `expr_free_all`. Useful breakpoints are: -| Location | Remarks | -|---|--| -| build_binary in tree.c| Creates an expression for a unary or binary operator | -| initialization_expr in init.c | Checks a single initializer | -| expr in tree.c| Checks a full expression | -| typeok in tree.c | Checks two types for compatibility | -| vwarning_at in err.c | Prints a warning | -| verror_at in err.c| Prints an error | -| assert_failed in err.c| Prints the location of a failed assertion| +| Function| File | Remarks | +|-||--| +| build_binary| tree.c | Creates an expression for a unary or binary operator | +| initialization_expr | init.c | Checks a single initializer | +| expr| tree.c | Checks a full expression | +| typeok | tree.c | Checks two types for compatibility | +| vwarning_at | err.c | Prints a warning | +| verror_at | err.c | Prints an error | +| assert_failed | err.c | Prints the location of a failed assertion| # Tests @@ -171,7 +197,9 @@ Most other tests focus on a single featu ## Adding a new test 1. Run `make add-test NAME=test_name`. -2. Sort the `FILES` lines in `../../tests/usr.bin/xlint/lint1/Makefile`. -3. Make the test generate the desired diagnostics. -4. Run `cd ../../tests/usr.bin/xlin
CVS commit: src/sys/arch/atari/atari
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:48:03 UTC 2022 Modified Files: src/sys/arch/atari/atari: bus.c Log Message: Use __func__ to print function names. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/arch/atari/atari/bus.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/atari/atari/bus.c diff -u src/sys/arch/atari/atari/bus.c:1.65 src/sys/arch/atari/atari/bus.c:1.66 --- src/sys/arch/atari/atari/bus.c:1.65 Sun Jul 3 16:40:29 2022 +++ src/sys/arch/atari/atari/bus.c Sun Jul 3 16:48:03 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.65 2022/07/03 16:40:29 tsutsui Exp $ */ +/* $NetBSD: bus.c,v 1.66 2022/07/03 16:48:03 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "opt_m68k_arch.h" #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.65 2022/07/03 16:40:29 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.66 2022/07/03 16:48:03 tsutsui Exp $"); #include #include @@ -203,9 +203,9 @@ bus_space_map(bus_space_tag_t t, bus_add if (error != 0) { if (extent_free(iomem_ex, bpa + t->base, size, EX_NOWAIT | iomem_malloc_safe)) { - printf("bus_space_map: pa 0x%lx, size 0x%lx\n", - bpa, size); - printf("bus_space_map: can't free region\n"); + printf("%s: pa 0x%lx, size 0x%lx\n", + __func__, bpa, size); + printf("%s: can't free region\n", __func__); } } return error; @@ -227,7 +227,7 @@ bus_space_alloc(bus_space_tag_t t, bus_a */ if ((rstart + t->base) < iomem_ex->ex_start || (rend + t->base) > iomem_ex->ex_end) - panic("bus_space_alloc: bad region start/end"); + panic("%s: bad region start/end", __func__); #endif /* DIAGNOSTIC */ /* @@ -247,9 +247,9 @@ bus_space_alloc(bus_space_tag_t t, bus_a if (error != 0) { if (extent_free(iomem_ex, bpa, size, EX_NOWAIT | iomem_malloc_safe) != 0) { - printf("bus_space_alloc: pa 0x%lx, size 0x%lx\n", - bpa, size); - printf("bus_space_alloc: can't free region\n"); + printf("%s: pa 0x%lx, size 0x%lx\n", + __func__, bpa, size); + printf("%s: can't free region\n", __func__); } } @@ -270,7 +270,7 @@ bus_mem_add_mapping(bus_space_tag_t t, b #ifdef DIAGNOSTIC if (endpa <= pa) - panic("bus_mem_add_mapping: overflow"); + panic("%s: overflow", __func__); #endif if (kernel_map == NULL) { @@ -323,7 +323,7 @@ bus_space_unmap(bus_space_tag_t t, bus_s endva = m68k_round_page(((char *)bsh + size) - 1); #ifdef DIAGNOSTIC if (endva < va) - panic("unmap_iospace: overflow"); + panic("%s: overflow", __func__); #endif (void)pmap_extract(pmap_kernel(), va, &bpa); @@ -343,8 +343,8 @@ bus_space_unmap(bus_space_tag_t t, bus_s */ if (extent_free(iomem_ex, bpa, size, EX_NOWAIT | iomem_malloc_safe) != 0) { - printf("bus_space_unmap: pa 0x%lx, size 0x%lx\n", bpa, size); - printf("bus_space_unmap: can't free region\n"); + printf("%s: pa 0x%lx, size 0x%lx\n", __func__, bpa, size); + printf("%s: can't free region\n", __func__); } } @@ -494,7 +494,7 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b #ifdef DIAGNOSTIC if ((m0->m_flags & M_PKTHDR) == 0) - panic("_bus_dmamap_load_mbuf: no packet header"); + panic("%s: no packet header", __func__); #endif if (m0->m_pkthdr.len > map->_dm_size) @@ -573,7 +573,7 @@ _bus_dmamap_load_raw(bus_dma_tag_t t, bu bus_dma_segment_t *segs, int nsegs, bus_size_t size, int flags) { - panic("bus_dmamap_load_raw: not implemented"); + panic("%s: not implemented", __func__); } /* @@ -871,7 +871,7 @@ bus_dmamem_map(bus_dma_tag_t t, bus_dma_ addr < (segs[curseg].ds_addr + segs[curseg].ds_len); addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) { if (size == 0) -panic("_bus_dmamem_map: size botch"); +panic("%s: size botch", __func__); pmap_enter(pmap_kernel(), va, addr - offset, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE); @@ -892,7 +892,7 @@ bus_dmamem_unmap(bus_dma_tag_t t, void * #ifdef DIAGNOSTIC if ((vaddr_t)kva & PGOFSET) - panic("_bus_dmamem_unmap"); + panic("%s", __func__); #endif size = round_page(size); @@ -917,12 +917,12 @@ bus_dmamem_mmap(bus_dma_tag_t t, bus_dma for (i = 0; i < nsegs; i++) { #ifdef DIAGNOSTIC if ((off & PGOFSET) != 0) - panic("_bus_dmamem_mmap: offset unaligned"); + panic("%s: offset unaligned", __func__); if ((segs[i].ds_addr & PGOFSET) != 0) - panic("_bus_dmamem_mmap: segment unaligned"); + panic("%s: segment unaligned", __func__); if ((segs[i].ds_len & PGOFSET) != 0) - panic("_bus_dmamem_mmap: segment size not multiple" - " of page size"); + panic("%s: segment size not multiple of page size", + __func__); #endif if (off >= segs[i].ds_len) { off -= segs[i].ds_len; @@ -1071,7 +1071,7 @@ bus_dmamem_alloc_range(bus_dma_tag_t t, if (curaddr < low || curaddr >
CVS commit: src/sys/arch/atari/atari
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:48:03 UTC 2022 Modified Files: src/sys/arch/atari/atari: bus.c Log Message: Use __func__ to print function names. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/arch/atari/atari/bus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/atari/atari
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:40:29 UTC 2022 Modified Files: src/sys/arch/atari/atari: bus.c Log Message: Use proper TAILQ(3) macro as other bus_dma(9) implementation. No binary change. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/arch/atari/atari/bus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/atari/atari
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:40:29 UTC 2022 Modified Files: src/sys/arch/atari/atari: bus.c Log Message: Use proper TAILQ(3) macro as other bus_dma(9) implementation. No binary change. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/arch/atari/atari/bus.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/atari/atari/bus.c diff -u src/sys/arch/atari/atari/bus.c:1.64 src/sys/arch/atari/atari/bus.c:1.65 --- src/sys/arch/atari/atari/bus.c:1.64 Sun Jul 3 16:33:31 2022 +++ src/sys/arch/atari/atari/bus.c Sun Jul 3 16:40:29 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.64 2022/07/03 16:33:31 tsutsui Exp $ */ +/* $NetBSD: bus.c,v 1.65 2022/07/03 16:40:29 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "opt_m68k_arch.h" #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.64 2022/07/03 16:33:31 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.65 2022/07/03 16:40:29 tsutsui Exp $"); #include #include @@ -1058,14 +1058,14 @@ bus_dmamem_alloc_range(bus_dma_tag_t t, * Compute the location, size, and number of segments actually * returned by the VM code. */ - m = mlist.tqh_first; + m = TAILQ_FIRST(&mlist); curseg = 0; lastaddr = VM_PAGE_TO_PHYS(m); segs[curseg].ds_addr = lastaddr + offset; segs[curseg].ds_len = PAGE_SIZE; - m = m->pageq.queue.tqe_next; + m = TAILQ_NEXT(m, pageq.queue); - for (; m != NULL; m = m->pageq.queue.tqe_next) { + for (; m != NULL; m = TAILQ_NEXT(m, pageq.queue)) { curaddr = VM_PAGE_TO_PHYS(m); #ifdef DIAGNOSTIC if (curaddr < low || curaddr >= high) {
CVS commit: src/sys/arch/atari/atari
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:33:31 UTC 2022 Modified Files: src/sys/arch/atari/atari: bus.c Log Message: Misc KNF. No binary change. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/arch/atari/atari/bus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/atari/atari
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:33:31 UTC 2022 Modified Files: src/sys/arch/atari/atari: bus.c Log Message: Misc KNF. No binary change. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/arch/atari/atari/bus.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/atari/atari/bus.c diff -u src/sys/arch/atari/atari/bus.c:1.63 src/sys/arch/atari/atari/bus.c:1.64 --- src/sys/arch/atari/atari/bus.c:1.63 Sun Jul 3 16:03:08 2022 +++ src/sys/arch/atari/atari/bus.c Sun Jul 3 16:33:31 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.63 2022/07/03 16:03:08 tsutsui Exp $ */ +/* $NetBSD: bus.c,v 1.64 2022/07/03 16:33:31 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "opt_m68k_arch.h" #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.63 2022/07/03 16:03:08 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.64 2022/07/03 16:33:31 tsutsui Exp $"); #include #include @@ -61,10 +61,6 @@ static long iomem_ex_storage[EXTENT_FIXE static struct extent *iomem_ex; static int iomem_malloc_safe = 0; -int bus_dmamem_alloc_range(bus_dma_tag_t tag, bus_size_t size, - bus_size_t alignment, bus_size_t boundary, - bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags, - paddr_t low, paddr_t high); static int _bus_dmamap_load_buffer(bus_dma_tag_t tag, bus_dmamap_t, void *, bus_size_t, struct vmspace *, int, paddr_t *, int *, int); @@ -94,6 +90,7 @@ static int bootm_free(vaddr_t va, u_long void bootm_init(vaddr_t va, void *ptep, vsize_t size) { + bootm_ex = extent_create("bootmem", va, va + size, (void *)bootm_ex_storage, sizeof(bootm_ex_storage), EX_NOCOALESCE|EX_NOWAIT); @@ -107,7 +104,7 @@ bootm_alloc(paddr_t pa, u_long size, int pt_entry_t pg_proto; vaddr_t va, rva; - if (extent_alloc(bootm_ex, size, PAGE_SIZE, 0, EX_NOWAIT, &rva)) { + if (extent_alloc(bootm_ex, size, PAGE_SIZE, 0, EX_NOWAIT, &rva) != 0) { printf("bootm_alloc fails! Not enough fixed extents?\n"); printf("Requested extent: pa=%lx, size=%lx\n", (u_long)pa, size); @@ -118,7 +115,7 @@ bootm_alloc(paddr_t pa, u_long size, int epg = &pg[btoc(size)]; va = rva; pg_proto = pa | PG_RW | PG_V; - if (!(flags & BUS_SPACE_MAP_CACHEABLE)) + if ((flags & BUS_SPACE_MAP_CACHEABLE) == 0) pg_proto |= PG_CI; while (pg < epg) { *pg++ = pg_proto; @@ -199,11 +196,11 @@ bus_space_map(bus_space_tag_t t, bus_add error = extent_alloc_region(iomem_ex, bpa + t->base, size, EX_NOWAIT | iomem_malloc_safe); - if (error) + if (error != 0) return error; error = bus_mem_add_mapping(t, bpa, size, flags, mhp); - if (error) { + if (error != 0) { if (extent_free(iomem_ex, bpa + t->base, size, EX_NOWAIT | iomem_malloc_safe)) { printf("bus_space_map: pa 0x%lx, size 0x%lx\n", @@ -240,16 +237,16 @@ bus_space_alloc(bus_space_tag_t t, bus_a rend + t->base, size, alignment, boundary, EX_FAST | EX_NOWAIT | iomem_malloc_safe, &bpa); - if (error) + if (error != 0) return error; /* * Map the bus physical address to a kernel virtual address. */ error = bus_mem_add_mapping(t, bpa, size, flags, bshp); - if (error) { + if (error != 0) { if (extent_free(iomem_ex, bpa, size, - EX_NOWAIT | iomem_malloc_safe)) { + EX_NOWAIT | iomem_malloc_safe) != 0) { printf("bus_space_alloc: pa 0x%lx, size 0x%lx\n", bpa, size); printf("bus_space_alloc: can't free region\n"); @@ -296,7 +293,7 @@ bus_mem_add_mapping(bus_space_tag_t t, b *bshp = va + (bpa & PGOFSET); for (; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - u_int *ptep, npte; + pt_entry_t *ptep, npte; pmap_enter(pmap_kernel(), (vaddr_t)va, pa, VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE); @@ -330,7 +327,7 @@ bus_space_unmap(bus_space_tag_t t, bus_s #endif (void)pmap_extract(pmap_kernel(), va, &bpa); - bpa += ((u_long)bsh & PGOFSET); + bpa += ((paddr_t)bsh & PGOFSET); /* * Free the kernel virtual mapping. @@ -344,7 +341,8 @@ bus_space_unmap(bus_space_tag_t t, bus_s /* * Mark as free in the extent map. */ - if (extent_free(iomem_ex, bpa, size, EX_NOWAIT | iomem_malloc_safe)) { + if (extent_free(iomem_ex, bpa, size, EX_NOWAIT | iomem_malloc_safe) + != 0) { printf("bus_space_unmap: pa 0x%lx, size 0x%lx\n", bpa, size); printf("bus_space_unmap: can't free region\n"); } @@ -380,6 +378,7 @@ bus_space_mmap(bus_space_tag_t t, bus_ad static size_t _bus_dmamap_mapsize(int const nsegments) { + KASSERT(nsegments > 0); return sizeof(struct atari_bus_dmamap) + (sizeof(bus_dma_segment_t) * (nsegments - 1)); @@ -409,7 +408,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_ * the (nsegments - 1). */ if ((mapstore = kmem_zalloc(_bus_dmamap_mapsize(nsegments), - (flags & BUS_DMA_NOWAIT) ? KM_NOSLEEP : KM_SLEEP)) == NULL) +
CVS commit: src/sys/arch/atari/stand/installboot
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:16:50 UTC 2022 Modified Files: src/sys/arch/atari/stand/installboot: Makefile installboot.c Log Message: Fix inverted logic. My fault back in 2015.. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/atari/stand/installboot/Makefile cvs rdiff -u -r1.38 -r1.39 src/sys/arch/atari/stand/installboot/installboot.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/atari/stand/installboot/Makefile diff -u src/sys/arch/atari/stand/installboot/Makefile:1.10 src/sys/arch/atari/stand/installboot/Makefile:1.11 --- src/sys/arch/atari/stand/installboot/Makefile:1.10 Wed May 11 10:36:52 2022 +++ src/sys/arch/atari/stand/installboot/Makefile Sun Jul 3 16:16:50 2022 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2022/05/11 10:36:52 rin Exp $ +# $NetBSD: Makefile,v 1.11 2022/07/03 16:16:50 tsutsui Exp $ WARNS= 4 PROG= installboot @@ -6,7 +6,7 @@ NOMAN= # defined SRCS= installboot.c disklabel.c BINDIR= /usr/mdec .ifndef SMALLPROG -CPPFLAGS+= -DCHECK_OS_BOOTVERSION -DNO_USAGE -DSUPPORT_FD +CPPFLAGS+= -DCHECK_OS_BOOTVERSION -DUSAGE -DSUPPORT_FD LDADD= -lkvm .endif Index: src/sys/arch/atari/stand/installboot/installboot.c diff -u src/sys/arch/atari/stand/installboot/installboot.c:1.38 src/sys/arch/atari/stand/installboot/installboot.c:1.39 --- src/sys/arch/atari/stand/installboot/installboot.c:1.38 Wed May 11 10:31:12 2022 +++ src/sys/arch/atari/stand/installboot/installboot.c Sun Jul 3 16:16:50 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.38 2022/05/11 10:31:12 rin Exp $ */ +/* $NetBSD: installboot.c,v 1.39 2022/07/03 16:16:50 tsutsui Exp $ */ /* * Copyright (c) 1995 Waldi Ravens @@ -86,7 +86,7 @@ usage(void) { fprintf(stderr, "usage: installboot [options] device\n" -#ifndef NO_USAGE +#ifdef USAGE "where options are:\n" "\t-N do not actually write anything on the disk\n" "\t-m use Milan boot blocks\n"
CVS commit: src/sys/arch/atari/stand/installboot
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:16:50 UTC 2022 Modified Files: src/sys/arch/atari/stand/installboot: Makefile installboot.c Log Message: Fix inverted logic. My fault back in 2015.. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/atari/stand/installboot/Makefile cvs rdiff -u -r1.38 -r1.39 src/sys/arch/atari/stand/installboot/installboot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/atari
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:03:08 UTC 2022 Modified Files: src/sys/arch/atari/atari: atari_init.c bus.c machdep.c src/sys/arch/atari/include: bus_funcs.h Log Message: Move the iomem extent stuff managed by bus_space(9) and make them static. Inspired by MD bus_space(9) implemantation of arc. Briefly tested on TT030. To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/arch/atari/atari/atari_init.c cvs rdiff -u -r1.62 -r1.63 src/sys/arch/atari/atari/bus.c cvs rdiff -u -r1.187 -r1.188 src/sys/arch/atari/atari/machdep.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/atari/include/bus_funcs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/atari
Module Name:src Committed By: tsutsui Date: Sun Jul 3 16:03:08 UTC 2022 Modified Files: src/sys/arch/atari/atari: atari_init.c bus.c machdep.c src/sys/arch/atari/include: bus_funcs.h Log Message: Move the iomem extent stuff managed by bus_space(9) and make them static. Inspired by MD bus_space(9) implemantation of arc. Briefly tested on TT030. To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/arch/atari/atari/atari_init.c cvs rdiff -u -r1.62 -r1.63 src/sys/arch/atari/atari/bus.c cvs rdiff -u -r1.187 -r1.188 src/sys/arch/atari/atari/machdep.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/atari/include/bus_funcs.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/atari/atari/atari_init.c diff -u src/sys/arch/atari/atari/atari_init.c:1.105 src/sys/arch/atari/atari/atari_init.c:1.106 --- src/sys/arch/atari/atari/atari_init.c:1.105 Sat Jun 25 13:17:04 2022 +++ src/sys/arch/atari/atari/atari_init.c Sun Jul 3 16:03:08 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: atari_init.c,v 1.105 2022/06/25 13:17:04 tsutsui Exp $ */ +/* $NetBSD: atari_init.c,v 1.106 2022/07/03 16:03:08 tsutsui Exp $ */ /* * Copyright (c) 1995 Leo Weppelman @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.105 2022/06/25 13:17:04 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.106 2022/07/03 16:03:08 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_mbtype.h" @@ -58,6 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: atari_init.c #include #include #include +#include #include @@ -110,21 +111,6 @@ static u_int milan_probe_bank(paddr_t pa #endif /* - * Extent maps to manage all memory space, including I/O ranges. Allocate - * storage for 16 regions in each, initially. Later, iomem_malloc_safe - * will indicate that it's safe to use malloc() to dynamically allocate - * region descriptors. - * This means that the fixed static storage is only used for registrating - * the found memory regions and the bus-mapping of the console. - * - * The extent maps are not static! They are used for bus address space - * allocation. - */ -static long iomem_ex_storage[EXTENT_FIXED_STORAGE_SIZE(16) / sizeof(long)]; -struct extent *iomem_ex; -int iomem_malloc_safe; - -/* * All info needed to generate a panic dump. All fields are setup by * start_c(). * XXX: Should sheck usage of phys_segs. There is some unwanted overlap @@ -685,25 +671,13 @@ start_c(int id, u_int ttphystart, u_int init_stmem(); /* - * Initialize the I/O mem extent map. - * Note: we don't have to check the return value since - * creation of a fixed extent map will never fail (since - * descriptor storage has already been allocated). - * - * N.B. The iomem extent manages _all_ physical addresses - * on the machine. When the amount of RAM is found, all - * extents of RAM are allocated from the map. - */ - iomem_ex = extent_create("iomem", 0x0, 0x, - (void *)iomem_ex_storage, sizeof(iomem_ex_storage), - EX_NOCOALESCE|EX_NOWAIT); - - /* - * Allocate the physical RAM from the extent map + * Initialize the iomem extent for bus_space(9) to manage address + * spaces and allocate the physical RAM from the extent map. */ + atari_bus_space_extent_init(0x0, 0x); for (i = 0; i < NMEM_SEGS && boot_segs[i].end != 0; i++) { - if (extent_alloc_region(iomem_ex, boot_segs[i].start, - boot_segs[i].end - boot_segs[i].start, EX_NOWAIT)) { + if (atari_bus_space_alloc_physmem(boot_segs[i].start, + boot_segs[i].end)) { /* XXX: Ahum, should not happen ;-) */ printf("Warning: Cannot allocate boot memory from" " extent map!?\n"); @@ -973,7 +947,6 @@ map_io_areas(paddr_t ptpa, psize_t ptsiz /* ptsize: Size of 'pt' in bytes */ /* ptextra: #of additional I/O pte's */ { - extern void bootm_init(vaddr_t, pt_entry_t *, u_long); vaddr_t ioaddr; pt_entry_t *pt, *pg, *epg; pt_entry_t pg_proto; Index: src/sys/arch/atari/atari/bus.c diff -u src/sys/arch/atari/atari/bus.c:1.62 src/sys/arch/atari/atari/bus.c:1.63 --- src/sys/arch/atari/atari/bus.c:1.62 Tue May 24 19:55:10 2022 +++ src/sys/arch/atari/atari/bus.c Sun Jul 3 16:03:08 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.62 2022/05/24 19:55:10 andvar Exp $ */ +/* $NetBSD: bus.c,v 1.63 2022/07/03 16:03:08 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "opt_m68k_arch.h" #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.62 2022/05/24 19:55:10 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.63 2022/07/03 16:03:08 tsutsui Exp $"); #include #include @@ -49,6 +49,18 @@ __KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.62 #define _ATARI_BUS_DMA_PRIVATE #include +/* + * Extent maps to manage all memory space, including I/O ranges. Allocate + * storage for 16 regions in each, initially. Later, iomem_malloc_safe + * will indicate that
CVS commit: src/sys/arch/atari/vme
Module Name:src Committed By: tsutsui Date: Sun Jul 3 15:25:54 UTC 2022 Modified Files: src/sys/arch/atari/vme: et4000.c leo.c Log Message: Make local cdevsw functions static. XXX: there is no config file that has leo(4) (though it still compiles) To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/atari/vme/et4000.c cvs rdiff -u -r1.22 -r1.23 src/sys/arch/atari/vme/leo.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/atari/vme/et4000.c diff -u src/sys/arch/atari/vme/et4000.c:1.26 src/sys/arch/atari/vme/et4000.c:1.27 --- src/sys/arch/atari/vme/et4000.c:1.26 Fri Jul 25 08:10:32 2014 +++ src/sys/arch/atari/vme/et4000.c Sun Jul 3 15:25:54 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: et4000.c,v 1.26 2014/07/25 08:10:32 dholland Exp $ */ +/* $NetBSD: et4000.c,v 1.27 2022/07/03 15:25:54 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -45,7 +45,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: et4000.c,v 1.26 2014/07/25 08:10:32 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: et4000.c,v 1.27 2022/07/03 15:25:54 tsutsui Exp $"); #include #include @@ -130,12 +130,12 @@ struct et4k_softc { CFATTACH_DECL_NEW(et4k, sizeof(struct et4k_softc), et4k_vme_match, et4k_vme_attach, NULL, NULL); -dev_type_open(et4kopen); -dev_type_close(et4kclose); -dev_type_read(et4kread); -dev_type_write(et4kwrite); -dev_type_ioctl(et4kioctl); -dev_type_mmap(et4kmmap); +static dev_type_open(et4kopen); +static dev_type_close(et4kclose); +static dev_type_read(et4kread); +static dev_type_write(et4kwrite); +static dev_type_ioctl(et4kioctl); +static dev_type_mmap(et4kmmap); const struct cdevsw et4k_cdevsw = { .d_open = et4kopen, Index: src/sys/arch/atari/vme/leo.c diff -u src/sys/arch/atari/vme/leo.c:1.22 src/sys/arch/atari/vme/leo.c:1.23 --- src/sys/arch/atari/vme/leo.c:1.22 Wed Feb 1 14:33:10 2017 +++ src/sys/arch/atari/vme/leo.c Sun Jul 3 15:25:54 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: leo.c,v 1.22 2017/02/01 14:33:10 christos Exp $ */ +/* $NetBSD: leo.c,v 1.23 2022/07/03 15:25:54 tsutsui Exp $ */ /*- * Copyright (c) 1997 maximum entropy @@ -47,7 +47,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: leo.c,v 1.22 2017/02/01 14:33:10 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: leo.c,v 1.23 2022/07/03 15:25:54 tsutsui Exp $"); #include #include @@ -101,11 +101,11 @@ static int leo_scroll(struct leo_softc * CFATTACH_DECL_NEW(leo, sizeof(struct leo_softc), leo_match, leo_attach, NULL, NULL); -dev_type_open(leoopen); -dev_type_close(leoclose); -dev_type_read(leomove); -dev_type_ioctl(leoioctl); -dev_type_mmap(leommap); +static dev_type_open(leoopen); +static dev_type_close(leoclose); +static dev_type_read(leomove); +static dev_type_ioctl(leoioctl); +static dev_type_mmap(leommap); const struct cdevsw leo_cdevsw = { .d_open = leoopen,
CVS commit: src/sys/arch/atari/vme
Module Name:src Committed By: tsutsui Date: Sun Jul 3 15:25:54 UTC 2022 Modified Files: src/sys/arch/atari/vme: et4000.c leo.c Log Message: Make local cdevsw functions static. XXX: there is no config file that has leo(4) (though it still compiles) To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/atari/vme/et4000.c cvs rdiff -u -r1.22 -r1.23 src/sys/arch/atari/vme/leo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Sun Jul 3 14:35:55 UTC 2022 Modified Files: src/tests/usr.bin/xlint/lint1: msg_132.c src/usr.bin/xlint/common: tyname.c src/usr.bin/xlint/lint1: decl.c Log Message: lint: include the width of bit-fields in the type name To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/tests/usr.bin/xlint/lint1/msg_132.c cvs rdiff -u -r1.52 -r1.53 src/usr.bin/xlint/common/tyname.c cvs rdiff -u -r1.293 -r1.294 src/usr.bin/xlint/lint1/decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/msg_132.c diff -u src/tests/usr.bin/xlint/lint1/msg_132.c:1.20 src/tests/usr.bin/xlint/lint1/msg_132.c:1.21 --- src/tests/usr.bin/xlint/lint1/msg_132.c:1.20 Sat Jul 2 09:48:18 2022 +++ src/tests/usr.bin/xlint/lint1/msg_132.c Sun Jul 3 14:35:54 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_132.c,v 1.20 2022/07/02 09:48:18 rillig Exp $ */ +/* $NetBSD: msg_132.c,v 1.21 2022/07/03 14:35:54 rillig Exp $ */ # 3 "msg_132.c" // Test for message: conversion from '%s' to '%s' may lose accuracy [132] @@ -233,13 +233,13 @@ struct bit_fields { unsigned char test_bit_fields(struct bit_fields s, unsigned long long m) { - /* expect+1: warning: conversion from 'unsigned long long' to 'unsigned int' may lose accuracy [132] */ + /* expect+1: warning: conversion from 'unsigned long long:32' to 'unsigned int:3' may lose accuracy [132] */ s.bits_3 = s.bits_32 & m; s.bits_5 = s.bits_3 & m; s.bits_32 = s.bits_5 & m; - /* expect+1: warning: conversion from 'unsigned long long' to 'unsigned char' may lose accuracy [132] */ + /* expect+1: warning: conversion from 'unsigned long long:32' to 'unsigned char' may lose accuracy [132] */ return s.bits_32 & m; } Index: src/usr.bin/xlint/common/tyname.c diff -u src/usr.bin/xlint/common/tyname.c:1.52 src/usr.bin/xlint/common/tyname.c:1.53 --- src/usr.bin/xlint/common/tyname.c:1.52 Tue Jun 21 22:10:30 2022 +++ src/usr.bin/xlint/common/tyname.c Sun Jul 3 14:35:54 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tyname.c,v 1.52 2022/06/21 22:10:30 rillig Exp $ */ +/* $NetBSD: tyname.c,v 1.53 2022/07/03 14:35:54 rillig Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tyname.c,v 1.52 2022/06/21 22:10:30 rillig Exp $"); +__RCSID("$NetBSD: tyname.c,v 1.53 2022/07/03 14:35:54 rillig Exp $"); #endif #include @@ -269,6 +269,13 @@ type_name(const type_t *tp) #endif buf_add(&buf, tspec_name(t)); +#ifdef IS_LINT1 + if (tp->t_bitfield) { + buf_add(&buf, ":"); + buf_add_int(&buf, (int)tp->t_flen); + } +#endif + switch (t) { case PTR: buf_add(&buf, " to "); Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.293 src/usr.bin/xlint/lint1/decl.c:1.294 --- src/usr.bin/xlint/lint1/decl.c:1.293 Wed Jun 22 19:23:17 2022 +++ src/usr.bin/xlint/lint1/decl.c Sun Jul 3 14:35:54 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.293 2022/06/22 19:23:17 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.294 2022/07/03 14:35:54 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: decl.c,v 1.293 2022/06/22 19:23:17 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.294 2022/07/03 14:35:54 rillig Exp $"); #endif #include @@ -1052,11 +1052,15 @@ check_bit_field_type(sym_t *dsym, type_t if (!bitfieldtype_ok) { /* TODO: Make this an error in C99 mode as well. */ if (!allow_trad && !allow_c99) { +type_t *btp = block_dup_type(tp); +btp->t_bitfield = false; /* bit-field type '%s' invalid in ANSI C */ -warning(273, type_name(tp)); +warning(273, type_name(btp)); } else if (pflag) { +type_t *btp = block_dup_type(tp); +btp->t_bitfield = false; /* nonportable bit-field type '%s' */ -warning(34, type_name(tp)); +warning(34, type_name(btp)); } } } else if (t == INT && dcs->d_sign_mod == NOTSPEC) { @@ -1067,8 +1071,10 @@ check_bit_field_type(sym_t *dsym, type_t } else if (!(t == INT || t == UINT || t == BOOL || (is_integer(t) && (bitfieldtype_ok || allow_gcc { + type_t *btp = block_dup_type(tp); + btp->t_bitfield = false; /* illegal bit-field type '%s' */ - warning(35, type_name(tp)); + warning(35, type_name(btp)); unsigned int sz = tp->t_flen; dsym->s_type = tp = block_dup_type(gettyp(t = INT));
CVS commit: src
Module Name:src Committed By: rillig Date: Sun Jul 3 14:35:55 UTC 2022 Modified Files: src/tests/usr.bin/xlint/lint1: msg_132.c src/usr.bin/xlint/common: tyname.c src/usr.bin/xlint/lint1: decl.c Log Message: lint: include the width of bit-fields in the type name To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/tests/usr.bin/xlint/lint1/msg_132.c cvs rdiff -u -r1.52 -r1.53 src/usr.bin/xlint/common/tyname.c cvs rdiff -u -r1.293 -r1.294 src/usr.bin/xlint/lint1/decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 14:15:38 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: debug.c externs1.h tree.c Log Message: lint: add debug logging for struct and enum details To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/lint1/debug.c cvs rdiff -u -r1.163 -r1.164 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.469 -r1.470 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/debug.c diff -u src/usr.bin/xlint/lint1/debug.c:1.21 src/usr.bin/xlint/lint1/debug.c:1.22 --- src/usr.bin/xlint/lint1/debug.c:1.21 Thu May 26 16:45:25 2022 +++ src/usr.bin/xlint/lint1/debug.c Sun Jul 3 14:15:38 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: debug.c,v 1.21 2022/05/26 16:45:25 rillig Exp $ */ +/* $NetBSD: debug.c,v 1.22 2022/07/03 14:15:38 rillig Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: debug.c,v 1.21 2022/05/26 16:45:25 rillig Exp $"); +__RCSID("$NetBSD: debug.c,v 1.22 2022/07/03 14:15:38 rillig Exp $"); #endif #include @@ -106,6 +106,37 @@ void printf("%*s- %s\n", 2 * --debug_indentation, "", func); } +static void +debug_type_details(const type_t *tp) +{ + + if (is_struct_or_union(tp->t_tspec)) { + debug_indent_inc(); + for (const sym_t *mem = tp->t_str->sou_first_member; + mem != NULL; mem = mem->s_next) { + debug_sym("", mem, "\n"); + debug_type_details(mem->s_type); + } + debug_indent_dec(); + } + if (tp->t_is_enum) { + debug_indent_inc(); + for (const sym_t *en = tp->t_enum->en_first_enumerator; + en != NULL; en = en->s_next) { + debug_sym("", en, "\n"); + } + debug_indent_dec(); + } +} + +void +debug_type(const type_t *tp) +{ + + debug_step("type details for '%s':", type_name(tp)); + debug_type_details(tp); +} + void debug_node(const tnode_t *tn) // NOLINT(misc-no-recursion) { Index: src/usr.bin/xlint/lint1/externs1.h diff -u src/usr.bin/xlint/lint1/externs1.h:1.163 src/usr.bin/xlint/lint1/externs1.h:1.164 --- src/usr.bin/xlint/lint1/externs1.h:1.163 Fri Jul 1 21:25:39 2022 +++ src/usr.bin/xlint/lint1/externs1.h Sun Jul 3 14:15:38 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.163 2022/07/01 21:25:39 rillig Exp $ */ +/* $NetBSD: externs1.h,v 1.164 2022/07/03 14:15:38 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -122,6 +122,7 @@ const char *symt_name(symt_t); const char *tqual_name(tqual_t); void debug_dinfo(const dinfo_t *); void debug_node(const tnode_t *); +void debug_type(const type_t *); void debug_sym(const char *, const sym_t *, const char *); void debug_symtab(void); void debug_printf(const char *fmt, ...) __printflike(1, 2); @@ -139,6 +140,7 @@ void debug_leave(const char *); #define debug_sym(p, sym, s) debug_noop() #define debug_symtab() debug_noop() #define debug_node(tn) debug_noop() +#define debug_type(tp) debug_noop() #define debug_printf(...) debug_noop() #define debug_print_indent() debug_noop() #define debug_indent_inc() debug_noop() Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.469 src/usr.bin/xlint/lint1/tree.c:1.470 --- src/usr.bin/xlint/lint1/tree.c:1.469 Sat Jul 2 10:47:29 2022 +++ src/usr.bin/xlint/lint1/tree.c Sun Jul 3 14:15:38 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.469 2022/07/02 10:47:29 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.470 2022/07/03 14:15:38 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.469 2022/07/02 10:47:29 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.470 2022/07/03 14:15:38 rillig Exp $"); #endif #include @@ -2546,6 +2546,8 @@ should_warn_about_pointer_cast(const typ /* Allow cast between pointers to sockaddr variants. */ if (nst == STRUCT && ost == STRUCT) { + debug_type(nstp); + debug_type(ostp); const sym_t *nmem = nstp->t_str->sou_first_member; const sym_t *omem = ostp->t_str->sou_first_member; while (nmem != NULL && omem != NULL &&
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 14:15:38 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: debug.c externs1.h tree.c Log Message: lint: add debug logging for struct and enum details To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/lint1/debug.c cvs rdiff -u -r1.163 -r1.164 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.469 -r1.470 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.
CVS commit: src/external/mit/xorg/lib/libXaw
Module Name:src Committed By: rillig Date: Sun Jul 3 14:09:22 UTC 2022 Modified Files: src/external/mit/xorg/lib/libXaw: Makefile.common Log Message: libXaw: suppress lint warnings about pointer casts Typical example: TextAction.c(373): warning: pointer cast from 'pointer to struct _WidgetRec' to 'pointer to struct _TextRec' may be troublesome [247] To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/lib/libXaw/Makefile.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/lib/libXaw/Makefile.common diff -u src/external/mit/xorg/lib/libXaw/Makefile.common:1.3 src/external/mit/xorg/lib/libXaw/Makefile.common:1.4 --- src/external/mit/xorg/lib/libXaw/Makefile.common:1.3 Sun May 30 02:20:09 2021 +++ src/external/mit/xorg/lib/libXaw/Makefile.common Sun Jul 3 14:09:22 2022 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.common,v 1.3 2021/05/30 02:20:09 joerg Exp $ +# $NetBSD: Makefile.common,v 1.4 2022/07/03 14:09:22 rillig Exp $ CPPFLAGS+= -DHAVE_WCHAR_H \ -DHAVE_WCTYPE_H \ @@ -22,3 +22,8 @@ COPTS.Pixmap.c+= ${${ACTIVE_CC} == "gcc" COPTS.Pixmap.c+= ${${ACTIVE_CC} == "clang":? -Wno-incompatible-pointer-types-discards-qualifiers :} COPTS.TextAction.c+= ${${ACTIVE_CC} == "gcc":? -Wno-discarded-qualifiers :} COPTS.TextAction.c+= ${${ACTIVE_CC} == "clang":? -Wno-incompatible-pointer-types-discards-qualifiers :} + +# This warning mostly affects casts between _WidgetRec and _TextRec, +# which don't have a common type prefix, but their members are compatible +# nevertheless. +LINTFLAGS+= -X 247 # pointer cast from '%s' to '%s' may be troublesome
CVS commit: src/external/mit/xorg/lib/libXaw
Module Name:src Committed By: rillig Date: Sun Jul 3 14:09:22 UTC 2022 Modified Files: src/external/mit/xorg/lib/libXaw: Makefile.common Log Message: libXaw: suppress lint warnings about pointer casts Typical example: TextAction.c(373): warning: pointer cast from 'pointer to struct _WidgetRec' to 'pointer to struct _TextRec' may be troublesome [247] To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/lib/libXaw/Makefile.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: skrll Date: Sun Jul 3 13:29:29 UTC 2022 Modified Files: src/sys/dev/pci: if_bge.c To generate a diff of this commit: cvs rdiff -u -r1.364 -r1.365 src/sys/dev/pci/if_bge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.364 src/sys/dev/pci/if_bge.c:1.365 --- src/sys/dev/pci/if_bge.c:1.364 Sun Jul 3 13:25:18 2022 +++ src/sys/dev/pci/if_bge.c Sun Jul 3 13:29:28 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.364 2022/07/03 13:25:18 skrll Exp $ */ +/* $NetBSD: if_bge.c,v 1.365 2022/07/03 13:29:28 skrll Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.364 2022/07/03 13:25:18 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.365 2022/07/03 13:29:28 skrll Exp $"); #include @@ -1365,8 +1365,7 @@ bge_alloc_jumbo_mem(struct bge_softc *sc for (i = 0; i < BGE_JSLOTS; i++) { sc->bge_cdata.bge_jslots[i] = ptr; ptr += BGE_JLEN; - entry = malloc(sizeof(struct bge_jpool_entry), - M_DEVBUF, M_WAITOK); + entry = malloc(sizeof(*entry), M_DEVBUF, M_WAITOK); entry->slot = i; SLIST_INSERT_HEAD(&sc->bge_jfree_listhead, entry, jpool_entries);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: skrll Date: Sun Jul 3 13:29:29 UTC 2022 Modified Files: src/sys/dev/pci: if_bge.c To generate a diff of this commit: cvs rdiff -u -r1.364 -r1.365 src/sys/dev/pci/if_bge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: skrll Date: Sun Jul 3 13:25:18 UTC 2022 Modified Files: src/sys/dev/pci: if_bge.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.363 -r1.364 src/sys/dev/pci/if_bge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.363 src/sys/dev/pci/if_bge.c:1.364 --- src/sys/dev/pci/if_bge.c:1.363 Sun Jul 3 13:21:28 2022 +++ src/sys/dev/pci/if_bge.c Sun Jul 3 13:25:18 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.363 2022/07/03 13:21:28 skrll Exp $ */ +/* $NetBSD: if_bge.c,v 1.364 2022/07/03 13:25:18 skrll Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,15 +79,15 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.363 2022/07/03 13:21:28 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.364 2022/07/03 13:25:18 skrll Exp $"); #include #include #include +#include #include #include -#include #include #include #include @@ -1510,8 +1510,8 @@ bge_newbuf_std(struct bge_softc *sc, int bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, offsetof(struct bge_ring_data, bge_rx_std_ring) + - i * sizeof (struct bge_rx_bd), - sizeof (struct bge_rx_bd), + i * sizeof(struct bge_rx_bd), + sizeof(struct bge_rx_bd), BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); return 0; @@ -1569,8 +1569,8 @@ bge_newbuf_jumbo(struct bge_softc *sc, i bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, offsetof(struct bge_ring_data, bge_rx_jumbo_ring) + - i * sizeof (struct bge_rx_bd), - sizeof (struct bge_rx_bd), + i * sizeof(struct bge_rx_bd), + sizeof(struct bge_rx_bd), BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); return 0; @@ -2541,7 +2541,7 @@ bge_blockinit(struct bge_softc *sc) bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, offsetof(struct bge_ring_data, bge_info), - sizeof (struct bge_gib), + sizeof(struct bge_gib), BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } @@ -4394,7 +4394,7 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, offsetof(struct bge_ring_data, bge_status_block), - sizeof (struct bge_status_block), + sizeof(struct bge_status_block), BUS_DMASYNC_POSTREAD); rx_cons = sc->bge_rx_saved_considx; @@ -4410,11 +4410,11 @@ bge_rxeof(struct bge_softc *sc) if (tosync != 0) rnd_add_uint32(&sc->rnd_source, tosync); - toff = offset + (rx_cons * sizeof (struct bge_rx_bd)); + toff = offset + (rx_cons * sizeof(struct bge_rx_bd)); if (tosync < 0) { tlen = (sc->bge_return_ring_cnt - rx_cons) * - sizeof (struct bge_rx_bd); + sizeof(struct bge_rx_bd); bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, toff, tlen, BUS_DMASYNC_POSTREAD); tosync = -tosync; @@ -4422,7 +4422,7 @@ bge_rxeof(struct bge_softc *sc) if (tosync != 0) { bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, - offset, tosync * sizeof (struct bge_rx_bd), + offset, tosync * sizeof(struct bge_rx_bd), BUS_DMASYNC_POSTREAD); } @@ -4573,7 +4573,7 @@ bge_txeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, offsetof(struct bge_ring_data, bge_status_block), - sizeof (struct bge_status_block), + sizeof(struct bge_status_block), BUS_DMASYNC_POSTREAD); offset = offsetof(struct bge_ring_data, bge_tx_ring); @@ -4583,11 +4583,11 @@ bge_txeof(struct bge_softc *sc) if (tosync != 0) rnd_add_uint32(&sc->rnd_source, tosync); - toff = offset + (sc->bge_tx_saved_considx * sizeof (struct bge_tx_bd)); + toff = offset + (sc->bge_tx_saved_considx * sizeof(struct bge_tx_bd)); if (tosync < 0) { tlen = (BGE_TX_RING_CNT - sc->bge_tx_saved_considx) * - sizeof (struct bge_tx_bd); + sizeof(struct bge_tx_bd); bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, toff, tlen, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); tosync = -tosync; @@ -4595,7 +4595,7 @@ bge_txeof(struct bge_softc *sc) if (tosync != 0) { bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, - offset, tosync * sizeof (struct bge_tx_bd), + offset, tosync * sizeof(struct bge_tx_bd), BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); } @@ -4663,7 +4663,7 @@ bge_intr(void *xsc) /* read status word from status block */ bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, offsetof(struct bge_ring_data, bge_status_block), - sizeof (struct bge_status_block), + sizeof(struct bge_status_block), BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); statusword = sc->bge_rdata->bge_status_block.bge_status; statustag = sc->bge_rdata->bge_status_block.bge_status_tag << 24; @@ -4692,7 +4692,7 @@ bge_intr(void *xsc) bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, offsetof(struct bge_ring_data, bge_status_block), - sizeof (struct bge_sta
CVS commit: src/sys/dev/pci
Module Name:src Committed By: skrll Date: Sun Jul 3 13:25:18 UTC 2022 Modified Files: src/sys/dev/pci: if_bge.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.363 -r1.364 src/sys/dev/pci/if_bge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: skrll Date: Sun Jul 3 13:21:28 UTC 2022 Modified Files: src/sys/dev/pci: if_bge.c Log Message: Perform a BUS_DMASYNC_POSTREAD on the bge_status_block before reading from it as required by bus_dma(9). To generate a diff of this commit: cvs rdiff -u -r1.362 -r1.363 src/sys/dev/pci/if_bge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.362 src/sys/dev/pci/if_bge.c:1.363 --- src/sys/dev/pci/if_bge.c:1.362 Sat Jul 2 08:39:48 2022 +++ src/sys/dev/pci/if_bge.c Sun Jul 3 13:21:28 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.362 2022/07/02 08:39:48 skrll Exp $ */ +/* $NetBSD: if_bge.c,v 1.363 2022/07/03 13:21:28 skrll Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.362 2022/07/02 08:39:48 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.363 2022/07/03 13:21:28 skrll Exp $"); #include @@ -4392,6 +4392,11 @@ bge_rxeof(struct bge_softc *sc) bus_size_t tlen; int tosync; + bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, + offsetof(struct bge_ring_data, bge_status_block), + sizeof (struct bge_status_block), + BUS_DMASYNC_POSTREAD); + rx_cons = sc->bge_rx_saved_considx; rx_prod = sc->bge_rdata->bge_status_block.bge_idx[0].bge_rx_prod_idx; @@ -4399,11 +4404,6 @@ bge_rxeof(struct bge_softc *sc) if (rx_cons == rx_prod) return; - bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, - offsetof(struct bge_ring_data, bge_status_block), - sizeof (struct bge_status_block), - BUS_DMASYNC_POSTREAD); - offset = offsetof(struct bge_ring_data, bge_rx_return_ring); tosync = rx_prod - rx_cons;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: skrll Date: Sun Jul 3 13:21:28 UTC 2022 Modified Files: src/sys/dev/pci: if_bge.c Log Message: Perform a BUS_DMASYNC_POSTREAD on the bge_status_block before reading from it as required by bus_dma(9). To generate a diff of this commit: cvs rdiff -u -r1.362 -r1.363 src/sys/dev/pci/if_bge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: andvar Date: Sun Jul 3 11:30:48 UTC 2022 Modified Files: src/sys/arch/atari/include: video.h src/sys/arch/hp300/dev: sti_sgc.c src/sys/arch/hpcmips/dev: ite8181reg.h src/sys/arch/hpcsh/dev/hd64461: hd64461video.c src/sys/arch/luna68k/dev: lunafb.c src/sys/dev/pci: tgareg.h Log Message: fix various typos in comments, mainly s/pallete/palette/. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/atari/include/video.h cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp300/dev/sti_sgc.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpcmips/dev/ite8181reg.h cvs rdiff -u -r1.56 -r1.57 src/sys/arch/hpcsh/dev/hd64461/hd64461video.c cvs rdiff -u -r1.43 -r1.44 src/sys/arch/luna68k/dev/lunafb.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/tgareg.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/atari/include/video.h diff -u src/sys/arch/atari/include/video.h:1.7 src/sys/arch/atari/include/video.h:1.8 --- src/sys/arch/atari/include/video.h:1.7 Tue Oct 20 19:10:11 2009 +++ src/sys/arch/atari/include/video.h Sun Jul 3 11:30:48 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: video.h,v 1.7 2009/10/20 19:10:11 snj Exp $ */ +/* $NetBSD: video.h,v 1.8 2022/07/03 11:30:48 andvar Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -112,7 +112,7 @@ struct video { #define RES_TTMID 0x0400 /* 640x480, 16 colors */ #define RES_TTHIGH 0x0600 /* 1280x960, monochrome */ #define RES_TTLOW 0x0700 /* 320x480, 256 colors */ -#define TT_PALLET 0x000f /* Pallette number */ +#define TT_PALLET 0x000f /* Palette number */ #define TT_HYMONO 0x8000 /* Hyper mono mode */ #define TT_SHOLD 0x1000 /* Sample/hold mode */ Index: src/sys/arch/hp300/dev/sti_sgc.c diff -u src/sys/arch/hp300/dev/sti_sgc.c:1.6 src/sys/arch/hp300/dev/sti_sgc.c:1.7 --- src/sys/arch/hp300/dev/sti_sgc.c:1.6 Sat Aug 7 16:18:53 2021 +++ src/sys/arch/hp300/dev/sti_sgc.c Sun Jul 3 11:30:48 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: sti_sgc.c,v 1.6 2021/08/07 16:18:53 thorpej Exp $ */ +/* $NetBSD: sti_sgc.c,v 1.7 2022/07/03 11:30:48 andvar Exp $ */ /* $OpenBSD: sti_sgc.c,v 1.14 2007/05/26 00:36:03 krw Exp $ */ /* @@ -27,7 +27,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.6 2021/08/07 16:18:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.7 2022/07/03 11:30:48 andvar Exp $"); #include #include @@ -259,7 +259,7 @@ sti_sgc_probe(bus_space_tag_t iot, int s /* * This might not be reliable enough. On the other hand, non-STI - * SGC cards will apparently not initialize in an hp300, to the + * SGC cards will apparently not initialize in the hp300, to the * point of not even answering bus probes (checked with an * Harmony/FDDI SGC card). */ @@ -317,7 +317,7 @@ sti_evrx_resetramdac(struct sti_screen * bus_space_write_1(bst, bsh, EVRX_BT458_ADDR, 0x05); bus_space_write_1(bst, bsh, EVRX_BT458_CTRL, 0x00); - /* pallete enabled, ovly plane disabled */ + /* palette enabled, ovly plane disabled */ bus_space_write_1(bst, bsh, EVRX_BT458_ADDR, 0x06); bus_space_write_1(bst, bsh, EVRX_BT458_CTRL, 0x40); Index: src/sys/arch/hpcmips/dev/ite8181reg.h diff -u src/sys/arch/hpcmips/dev/ite8181reg.h:1.4 src/sys/arch/hpcmips/dev/ite8181reg.h:1.5 --- src/sys/arch/hpcmips/dev/ite8181reg.h:1.4 Sun Dec 11 12:17:33 2005 +++ src/sys/arch/hpcmips/dev/ite8181reg.h Sun Jul 3 11:30:48 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: ite8181reg.h,v 1.4 2005/12/11 12:17:33 christos Exp $ */ +/* $NetBSD: ite8181reg.h,v 1.5 2022/07/03 11:30:48 andvar Exp $ */ /*- * Copyright (c) 2000 SATO Kazumi @@ -38,7 +38,7 @@ #define ITE8181_DATA_CLASS 0x0380 #define ITE8181_CLASS_MASK 0x #define ITE8181_REV_MASK 0x00ff -#define ITE8181_MBA 0x10 /* Memory Base Address(4MB bounday) */ +#define ITE8181_MBA 0x10 /* Memory Base Address(4MB boundary) */ #define ITE8181_GBA 0x14 /* GUI Base Address(32KB boundary) */ #define ITE8181_SBA 0x18 /* Graphic Base Address (64KB boundary) */ #define ITE8181_TEST 0x40 /* Test Reg. */ @@ -49,7 +49,7 @@ #define ITE8181_DATA_PLL1_RESET 0x4000 /* PLL1 reset */ #define ITE8181_DATA_PLL2_PWDOWN 0x2000 /* PLL2 powerdown */ #define ITE8181_DATA_PLL1_PWDOWN 0x1000 /* PLL1 powerdown */ -#define ITE8181_DATA_PALETTESTBY 0x0200 /* Pallete RAM standby */ +#define ITE8181_DATA_PALETTESTBY 0x0200 /* Palette RAM standby */ #define ITE8181_DATA_CURSORSTBY 0x0100 /* Cursor standby */ #define ITE8181_DATA_BITBLTSTBY 0x0080 /* BitBlt engine standby */ #define ITE8181_DATA_LINESTBY 0x0040 /* Line Draw standby */ @@ -204,7 +204,7 @@ #define ITE8181_FRCCOL_8 0x80 /* option1, 8 color */ #define ITE8181_FRCCOL_16 0x00 /* option2, 16 color */ -#define ITE8181_EMA_FRCPAT 0xa3 /* select frame rate perttern */ +#define ITE8181_EMA_FRCPAT 0xa3 /* select frame rate pattern */ #de
CVS commit: src/sys
Module Name:src Committed By: andvar Date: Sun Jul 3 11:30:48 UTC 2022 Modified Files: src/sys/arch/atari/include: video.h src/sys/arch/hp300/dev: sti_sgc.c src/sys/arch/hpcmips/dev: ite8181reg.h src/sys/arch/hpcsh/dev/hd64461: hd64461video.c src/sys/arch/luna68k/dev: lunafb.c src/sys/dev/pci: tgareg.h Log Message: fix various typos in comments, mainly s/pallete/palette/. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/atari/include/video.h cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp300/dev/sti_sgc.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpcmips/dev/ite8181reg.h cvs rdiff -u -r1.56 -r1.57 src/sys/arch/hpcsh/dev/hd64461/hd64461video.c cvs rdiff -u -r1.43 -r1.44 src/sys/arch/luna68k/dev/lunafb.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/tgareg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/historical/nawk/bin
Module Name:src Committed By: rillig Date: Sun Jul 3 10:56:22 UTC 2022 Modified Files: src/external/historical/nawk/bin: awk.1 Log Message: awk.1: remove trailing space in output of 'echo' example program To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/historical/nawk/bin/awk.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/historical/nawk/bin/awk.1 diff -u src/external/historical/nawk/bin/awk.1:1.8 src/external/historical/nawk/bin/awk.1:1.9 --- src/external/historical/nawk/bin/awk.1:1.8 Sat Dec 21 09:11:59 2019 +++ src/external/historical/nawk/bin/awk.1 Sun Jul 3 10:56:22 2022 @@ -1,4 +1,4 @@ -.\" $NetBSD: awk.1,v 1.8 2019/12/21 09:11:59 wiz Exp $ +.\" $NetBSD: awk.1,v 1.9 2022/07/03 10:56:22 rillig Exp $ .\" .\" Copyright (C) Lucent Technologies 1997 .\" All Rights Reserved @@ -22,7 +22,7 @@ .\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF .\" THIS SOFTWARE. .\" -.Dd December 19, 2019 +.Dd July 3, 2022 .Dt AWK 1 .Os .Sh NAME @@ -711,10 +711,11 @@ Print all lines between start/stop pairs .Pp Simulate echo(1): .Bd -literal -offset indent -BEGIN { # Simulate echo(1) -for (i = 1; i < ARGC; i++) printf "%s ", ARGV[i] -printf "\en" -exit } +BEGIN { + if (1 < ARGC) printf "%s", ARGV[1] + for (i = 2; i < ARGC; i++) printf " %s", ARGV[i] + printf "\en" +} .Ed .Pp Print an error message to standard error:
CVS commit: src/external/historical/nawk/bin
Module Name:src Committed By: rillig Date: Sun Jul 3 10:56:22 UTC 2022 Modified Files: src/external/historical/nawk/bin: awk.1 Log Message: awk.1: remove trailing space in output of 'echo' example program To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/historical/nawk/bin/awk.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 07:33:09 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: check-msgs.lua func.c Log Message: lint: verify that comment above warning_at matches the message No binary change. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint1/check-msgs.lua cvs rdiff -u -r1.142 -r1.143 src/usr.bin/xlint/lint1/func.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/check-msgs.lua diff -u src/usr.bin/xlint/lint1/check-msgs.lua:1.13 src/usr.bin/xlint/lint1/check-msgs.lua:1.14 --- src/usr.bin/xlint/lint1/check-msgs.lua:1.13 Thu Dec 16 21:14:58 2021 +++ src/usr.bin/xlint/lint1/check-msgs.lua Sun Jul 3 07:33:08 2022 @@ -1,5 +1,5 @@ #! /usr/bin/lua --- $NetBSD: check-msgs.lua,v 1.13 2021/12/16 21:14:58 rillig Exp $ +-- $NetBSD: check-msgs.lua,v 1.14 2022/07/03 07:33:08 rillig Exp $ --[[ @@ -61,6 +61,15 @@ local function check_message(fname, line fname, lineno, id, msg, comment) end +local is_message_function = { + error = true, + error_at = true, + warning = true, + warning_at = true, + c99ism = true, + c11ism = true, + gnuism = true, +} local function check_file(fname, msgs) local f = assert(io.open(fname, "r")) @@ -69,11 +78,9 @@ local function check_file(fname, msgs) for line in f:lines() do lineno = lineno + 1 -local func, id = line:match("^%s+(%w+)%((%d+)[),]") -id = tonumber(id) -if func == "error" or func == "warning" or - func == "c99ism" or func == "c11ism" or - func == "gnuism" or func == "message" then +local func, id = line:match("^%s+([%w_]+)%((%d+)[),]") +if is_message_function[func] then + id = tonumber(id) local comment = prev:match("^%s+/%* (.+) %*/$") if comment ~= nil then check_message(fname, lineno, id, comment, msgs) Index: src/usr.bin/xlint/lint1/func.c diff -u src/usr.bin/xlint/lint1/func.c:1.142 src/usr.bin/xlint/lint1/func.c:1.143 --- src/usr.bin/xlint/lint1/func.c:1.142 Wed Jun 22 19:23:17 2022 +++ src/usr.bin/xlint/lint1/func.c Sun Jul 3 07:33:08 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: func.c,v 1.142 2022/06/22 19:23:17 rillig Exp $ */ +/* $NetBSD: func.c,v 1.143 2022/07/03 07:33:08 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: func.c,v 1.142 2022/06/22 19:23:17 rillig Exp $"); +__RCSID("$NetBSD: func.c,v 1.143 2022/07/03 07:33:08 rillig Exp $"); #endif #include @@ -1152,7 +1152,7 @@ global_clean_up_decl(bool silent) } if (scanflike_argnum != -1) { if (!silent) { - /* must precede function definition: ** %s ** */ + /* comment ** %s ** must precede function definition */ warning_at(282, &scanflike_pos, "SCANFLIKE"); } scanflike_argnum = -1;
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sun Jul 3 07:33:09 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: check-msgs.lua func.c Log Message: lint: verify that comment above warning_at matches the message No binary change. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint1/check-msgs.lua cvs rdiff -u -r1.142 -r1.143 src/usr.bin/xlint/lint1/func.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.