CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Jun 21 22:21:49 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: lint: merge duplicate code in typeok_minus No functional change. To generate a diff of this commit: cvs rdiff -u -r1.457 -r1.458 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/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Jun 21 22:21:49 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: lint: merge duplicate code in typeok_minus No functional change. To generate a diff of this commit: cvs rdiff -u -r1.457 -r1.458 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.457 src/usr.bin/xlint/lint1/tree.c:1.458 --- src/usr.bin/xlint/lint1/tree.c:1.457 Tue Jun 21 22:16:26 2022 +++ src/usr.bin/xlint/lint1/tree.c Tue Jun 21 22:21:49 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.457 2022/06/21 22:16:26 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.458 2022/06/21 22:21:49 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.457 2022/06/21 22:16:26 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.458 2022/06/21 22:21:49 rillig Exp $"); #endif #include @@ -1106,10 +1106,8 @@ typeok_minus(op_t op, const type_t *rtp, tspec_t rt) { /* operands have scalar types (checked in typeok) */ - if (lt == PTR && (!is_integer(rt) && rt != PTR)) { - warn_incompatible_types(op, ltp, lt, rtp, rt); - return false; - } else if (rt == PTR && lt != PTR) { + if ((lt == PTR && rt != PTR && !is_integer(rt)) || + (lt != PTR && rt == PTR)) { warn_incompatible_types(op, ltp, lt, rtp, rt); return false; }
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Jun 21 22:16:26 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: lint: clean up comments, don't include unused header No functional change. To generate a diff of this commit: cvs rdiff -u -r1.456 -r1.457 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/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Jun 21 22:16:26 UTC 2022 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: lint: clean up comments, don't include unused header No functional change. To generate a diff of this commit: cvs rdiff -u -r1.456 -r1.457 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.456 src/usr.bin/xlint/lint1/tree.c:1.457 --- src/usr.bin/xlint/lint1/tree.c:1.456 Tue Jun 21 22:10:30 2022 +++ src/usr.bin/xlint/lint1/tree.c Tue Jun 21 22:16:26 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.456 2022/06/21 22:10:30 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.457 2022/06/21 22:16:26 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.456 2022/06/21 22:10:30 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.457 2022/06/21 22:16:26 rillig Exp $"); #endif #include @@ -48,7 +48,6 @@ __RCSID("$NetBSD: tree.c,v 1.456 2022/06 #include #include "lint1.h" -#include "cgram.h" typedef struct integer_constraints { int64_t smin; /* signed minimum */ @@ -1079,7 +1078,7 @@ typeok_address(const mod_t *mp, static bool typeok_indir(const type_t *tp, tspec_t t) { - /* until now there were no type checks for this operator */ + if (t != PTR) { /* cannot dereference non-pointer type '%s' */ error(96, type_name(tp)); @@ -1093,7 +1092,7 @@ typeok_plus(op_t op, const type_t *ltp, tspec_t lt, const type_t *rtp, tspec_t rt) { - /* operands have scalar types (checked above) */ + /* operands have scalar types (checked in typeok) */ if ((lt == PTR && !is_integer(rt)) || (rt == PTR && !is_integer(lt))) { warn_incompatible_types(op, ltp, lt, rtp, rt); return false; @@ -1106,7 +1105,7 @@ typeok_minus(op_t op, const type_t *ltp, tspec_t lt, const type_t *rtp, tspec_t rt) { - /* operands have scalar types (checked above) */ + /* operands have scalar types (checked in typeok) */ if (lt == PTR && (!is_integer(rt) && rt != PTR)) { warn_incompatible_types(op, ltp, lt, rtp, rt); return false; @@ -1133,7 +1132,7 @@ typeok_shr(const mod_t *mp, olt = before_conversion(ln)->tn_type->t_tspec; ort = before_conversion(rn)->tn_type->t_tspec; - /* operands have integer types (checked above) */ + /* operands have integer types (checked in typeok) */ if (pflag && !is_uinteger(olt)) { /* * The left operand is signed. This means that @@ -1272,7 +1271,7 @@ typeok_colon_pointer(const mod_t *mp, co tspec_t rst = rstp->t_tspec; if ((lst == VOID && rst == FUNC) || (lst == FUNC && rst == VOID)) { - /* (void *)0 handled above */ + /* (void *)0 is handled in typeok_colon */ /* TODO: C99 behaves like C90 here. */ if (!allow_trad && !allow_c99) /* ANSI C forbids conversion of %s to %s, op %s */
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Tue Jun 21 22:10:31 UTC 2022 Modified Files: src/usr.bin/xlint/common: tyname.c src/usr.bin/xlint/lint1: decl.c emit1.c tree.c Log Message: lint: use is_struct_or_union instead of comparing twice No functional change. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/usr.bin/xlint/common/tyname.c cvs rdiff -u -r1.291 -r1.292 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.62 -r1.63 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.455 -r1.456 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/common/tyname.c diff -u src/usr.bin/xlint/common/tyname.c:1.51 src/usr.bin/xlint/common/tyname.c:1.52 --- src/usr.bin/xlint/common/tyname.c:1.51 Fri May 20 21:18:54 2022 +++ src/usr.bin/xlint/common/tyname.c Tue Jun 21 22:10:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tyname.c,v 1.51 2022/05/20 21:18:54 rillig Exp $ */ +/* $NetBSD: tyname.c,v 1.52 2022/06/21 22:10:30 rillig Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tyname.c,v 1.51 2022/05/20 21:18:54 rillig Exp $"); +__RCSID("$NetBSD: tyname.c,v 1.52 2022/06/21 22:10:30 rillig Exp $"); #endif #include @@ -264,7 +264,7 @@ type_name(const type_t *tp) buf_add(&buf, "volatile "); #ifdef IS_LINT1 - if ((t == STRUCT || t == UNION) && tp->t_str->sou_incomplete) + if (is_struct_or_union(t) && tp->t_str->sou_incomplete) buf_add(&buf, "incomplete "); #endif buf_add(&buf, tspec_name(t)); Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.291 src/usr.bin/xlint/lint1/decl.c:1.292 --- src/usr.bin/xlint/lint1/decl.c:1.291 Tue Jun 21 21:18:30 2022 +++ src/usr.bin/xlint/lint1/decl.c Tue Jun 21 22:10:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.291 2022/06/21 21:18:30 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.292 2022/06/21 22:10:30 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.291 2022/06/21 21:18:30 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.292 2022/06/21 22:10:30 rillig Exp $"); #endif #include @@ -210,7 +210,7 @@ is_incomplete(const type_t *tp) return true; } else if (t == ARRAY) { return tp->t_incomplete_array; - } else if (t == STRUCT || t == UNION) { + } else if (is_struct_or_union(t)) { return tp->t_str->sou_incomplete; } else if (t == ENUM) { return tp->t_enum->en_incomplete; @@ -278,7 +278,7 @@ add_type(type_t *tp) t = tp->t_tspec; - if (t == STRUCT || t == UNION || t == ENUM) { + if (is_struct_or_union(t) || t == ENUM) { /* * something like "int struct a ..." * struct/union/enum with anything else is not allowed @@ -2245,7 +2245,7 @@ eqtype(const type_t *tp1, const type_t * if (!qualifiers_correspond(tp1, tp2, ignqual)) return false; - if (t == STRUCT || t == UNION) + if (is_struct_or_union(t)) return tp1->t_str == tp2->t_str; if (t == ENUM && eflag) Index: src/usr.bin/xlint/lint1/emit1.c diff -u src/usr.bin/xlint/lint1/emit1.c:1.62 src/usr.bin/xlint/lint1/emit1.c:1.63 --- src/usr.bin/xlint/lint1/emit1.c:1.62 Fri May 20 21:18:55 2022 +++ src/usr.bin/xlint/lint1/emit1.c Tue Jun 21 22:10:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: emit1.c,v 1.62 2022/05/20 21:18:55 rillig Exp $ */ +/* $NetBSD: emit1.c,v 1.63 2022/06/21 22:10:30 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: emit1.c,v 1.62 2022/05/20 21:18:55 rillig Exp $"); +__RCSID("$NetBSD: emit1.c,v 1.63 2022/06/21 22:10:30 rillig Exp $"); #endif #include "lint1.h" @@ -120,7 +120,7 @@ outtype(const type_t *tp) outint(tp->t_dim); } else if (ts == ENUM) { outtt(tp->t_enum->en_tag, tp->t_enum->en_first_typedef); - } else if (ts == STRUCT || ts == UNION) { + } else if (is_struct_or_union(ts)) { outtt(tp->t_str->sou_tag, tp->t_str->sou_first_typedef); } else if (ts == FUNC && tp->t_proto) { na = 0; Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.455 src/usr.bin/xlint/lint1/tree.c:1.456 --- src/usr.bin/xlint/lint1/tree.c:1.455 Tue Jun 21 21:18:30 2022 +++ src/usr.bin/xlint/lint1/tree.c Tue Jun 21 22:10:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.455 2022/06/21 21:18:30 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.456 2022/06/21 22:10:30 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.455 2022/06/21 21:18:30 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.456 2022/06/21 22:10:30 rillig Exp $"); #endif #include @@ -563,11 +563,11 @@ struct_or_union_member(tnode_t *tn, op_t str = NULL; t = (tp = tn->tn_type)->t_ts
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Tue Jun 21 22:10:31 UTC 2022 Modified Files: src/usr.bin/xlint/common: tyname.c src/usr.bin/xlint/lint1: decl.c emit1.c tree.c Log Message: lint: use is_struct_or_union instead of comparing twice No functional change. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/usr.bin/xlint/common/tyname.c cvs rdiff -u -r1.291 -r1.292 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.62 -r1.63 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.455 -r1.456 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
Module Name:src Committed By: rillig Date: Tue Jun 21 21:18:30 UTC 2022 Modified Files: src/tests/usr.bin/xlint/lint1: msg_062.c msg_085.c msg_090.c msg_092.c msg_093.c msg_094.c msg_095.c msg_096.c msg_108.c msg_114.c msg_343.c src/usr.bin/xlint/lint1: decl.c err.c tree.c Log Message: lint: add quotes and details to some more messages To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_062.c \ src/tests/usr.bin/xlint/lint1/msg_085.c \ src/tests/usr.bin/xlint/lint1/msg_093.c \ src/tests/usr.bin/xlint/lint1/msg_094.c \ src/tests/usr.bin/xlint/lint1/msg_095.c cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_090.c \ src/tests/usr.bin/xlint/lint1/msg_092.c cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_096.c \ src/tests/usr.bin/xlint/lint1/msg_114.c cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_108.c cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_343.c cvs rdiff -u -r1.290 -r1.291 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.174 -r1.175 src/usr.bin/xlint/lint1/err.c cvs rdiff -u -r1.454 -r1.455 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/msg_062.c diff -u src/tests/usr.bin/xlint/lint1/msg_062.c:1.4 src/tests/usr.bin/xlint/lint1/msg_062.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_062.c:1.4 Sun Apr 24 20:08:23 2022 +++ src/tests/usr.bin/xlint/lint1/msg_062.c Tue Jun 21 21:18:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_062.c,v 1.4 2022/04/24 20:08:23 rillig Exp $ */ +/* $NetBSD: msg_062.c,v 1.5 2022/06/21 21:18:30 rillig Exp $ */ # 3 "msg_062.c" // Test for message: function prototype parameters must have types [62] @@ -6,6 +6,6 @@ /* expect+1: error: old style declaration; add 'int' [1] */ outer() { /* expect+2: warning: function prototype parameters must have types [62] */ - /* expect+1: warning: dubious static function at block level: inner [93] */ + /* expect+1: warning: dubious static function 'inner' at block level [93] */ static int inner(a); } Index: src/tests/usr.bin/xlint/lint1/msg_085.c diff -u src/tests/usr.bin/xlint/lint1/msg_085.c:1.4 src/tests/usr.bin/xlint/lint1/msg_085.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_085.c:1.4 Wed Jun 15 20:18:31 2022 +++ src/tests/usr.bin/xlint/lint1/msg_085.c Tue Jun 21 21:18:30 2022 @@ -1,13 +1,13 @@ -/* $NetBSD: msg_085.c,v 1.4 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_085.c,v 1.5 2022/06/21 21:18:30 rillig Exp $ */ # 3 "msg_085.c" -// Test for message: dubious tag declaration: %s %s [85] +// Test for message: dubious tag declaration '%s %s' [85] -/* expect+1: warning: dubious tag declaration: struct in_argument [85] */ +/* expect+1: warning: dubious tag declaration 'struct in_argument' [85] */ void declare_struct(struct in_argument *); -/* expect+1: warning: dubious tag declaration: union in_argument [85] */ +/* expect+1: warning: dubious tag declaration 'union in_argument' [85] */ void declare_union(union in_argument *); -/* expect+1: warning: dubious tag declaration: enum in_argument [85] */ +/* expect+1: warning: dubious tag declaration 'enum in_argument' [85] */ void declare_enum(enum in_argument *); /* expect+1: warning: struct 'ok' never defined [233] */ Index: src/tests/usr.bin/xlint/lint1/msg_093.c diff -u src/tests/usr.bin/xlint/lint1/msg_093.c:1.4 src/tests/usr.bin/xlint/lint1/msg_093.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_093.c:1.4 Sun Apr 3 09:34:45 2022 +++ src/tests/usr.bin/xlint/lint1/msg_093.c Tue Jun 21 21:18:30 2022 @@ -1,12 +1,12 @@ -/* $NetBSD: msg_093.c,v 1.4 2022/04/03 09:34:45 rillig Exp $ */ +/* $NetBSD: msg_093.c,v 1.5 2022/06/21 21:18:30 rillig Exp $ */ # 3 "msg_093.c" -// Test for message: dubious static function at block level: %s [93] +// Test for message: dubious static function '%s' at block level [93] void example(void) { - /* expect+1: warning: dubious static function at block level: nested [93] */ + /* expect+1: warning: dubious static function 'nested' at block level [93] */ static void nested(void); nested(); Index: src/tests/usr.bin/xlint/lint1/msg_094.c diff -u src/tests/usr.bin/xlint/lint1/msg_094.c:1.4 src/tests/usr.bin/xlint/lint1/msg_094.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_094.c:1.4 Sun Apr 3 09:34:45 2022 +++ src/tests/usr.bin/xlint/lint1/msg_094.c Tue Jun 21 21:18:30 2022 @@ -1,13 +1,13 @@ -/* $NetBSD: msg_094.c,v 1.4 2022/04/03 09:34:45 rillig Exp $ */ +/* $NetBSD: msg_094.c,v 1.5 2022/06/21 21:18:30 rillig Exp $ */ # 3 "msg_094.c" -// Test for message: function has illegal storage class: %s [94] +// Test for message: function '%s' has illegal storage class [94] /* expect+2: error: illegal storage class [8] */ register int global_example(int arg) { - /* expect+1: error: function has illegal storage class: register_example [94] *
CVS commit: src
Module Name:src Committed By: rillig Date: Tue Jun 21 21:18:30 UTC 2022 Modified Files: src/tests/usr.bin/xlint/lint1: msg_062.c msg_085.c msg_090.c msg_092.c msg_093.c msg_094.c msg_095.c msg_096.c msg_108.c msg_114.c msg_343.c src/usr.bin/xlint/lint1: decl.c err.c tree.c Log Message: lint: add quotes and details to some more messages To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_062.c \ src/tests/usr.bin/xlint/lint1/msg_085.c \ src/tests/usr.bin/xlint/lint1/msg_093.c \ src/tests/usr.bin/xlint/lint1/msg_094.c \ src/tests/usr.bin/xlint/lint1/msg_095.c cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_090.c \ src/tests/usr.bin/xlint/lint1/msg_092.c cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_096.c \ src/tests/usr.bin/xlint/lint1/msg_114.c cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_108.c cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_343.c cvs rdiff -u -r1.290 -r1.291 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.174 -r1.175 src/usr.bin/xlint/lint1/err.c cvs rdiff -u -r1.454 -r1.455 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.
Re: CVS commit: src/tests/libexec/ld.elf_so
On 21/06/2022 17:24, Christos Zoulas wrote: Module Name:src Committed By: christos Date: Tue Jun 21 16:24:37 UTC 2022 Modified Files: src/tests/libexec/ld.elf_so: t_ifunc.c Log Message: sort; it is the same list as in h_ifunc_static.c; perhaps it should be a HAVE_ something? Thanks. I agree a HAVE_ something (in a arch/foo.h file) would be better. Nick
CVS commit: src/tests/libexec/ld.elf_so
Module Name:src Committed By: christos Date: Tue Jun 21 16:24:37 UTC 2022 Modified Files: src/tests/libexec/ld.elf_so: t_ifunc.c Log Message: sort; it is the same list as in h_ifunc_static.c; perhaps it should be a HAVE_ something? To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/tests/libexec/ld.elf_so/t_ifunc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/libexec/ld.elf_so
Module Name:src Committed By: christos Date: Tue Jun 21 16:24:37 UTC 2022 Modified Files: src/tests/libexec/ld.elf_so: t_ifunc.c Log Message: sort; it is the same list as in h_ifunc_static.c; perhaps it should be a HAVE_ something? To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/tests/libexec/ld.elf_so/t_ifunc.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/libexec/ld.elf_so/t_ifunc.c diff -u src/tests/libexec/ld.elf_so/t_ifunc.c:1.12 src/tests/libexec/ld.elf_so/t_ifunc.c:1.13 --- src/tests/libexec/ld.elf_so/t_ifunc.c:1.12 Tue Jun 21 02:52:17 2022 +++ src/tests/libexec/ld.elf_so/t_ifunc.c Tue Jun 21 12:24:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ifunc.c,v 1.12 2022/06/21 06:52:17 skrll Exp $ */ +/* $NetBSD: t_ifunc.c,v 1.13 2022/06/21 16:24:37 christos Exp $ */ /* * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -39,8 +39,8 @@ defined(__aarch64__) || \ defined(__arm__) || \ defined(__i386__) || \ -defined(__sparc__) || \ defined(__powerpc__) || \ +defined(__sparc__) || \ defined(__x86_64__) #define LINKER_SUPPORT 1 #else
Re: CVS commit: src/usr.sbin/sysinst
On Wed, Jun 22, 2022 at 12:55:16AM +0900, Izumi Tsutsui wrote: > Shouldn't this part be '&& part != RAW_PART - 1' ? Good catch! > It looks we cannot choose RAW_PART (and RAW_PART-1 on MBR ports) > on the inner editor, though. Yes, the UI should prevent it, but better double check in the backend. Martin
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 16:08:25 UTC 2022 Modified Files: src/usr.sbin/sysinst: disklabel.c Log Message: Fix inverted condition in previous and only apply special handling for the "all of NetBSD" partition when we have an outer MBR label. Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/disklabel.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/sysinst/disklabel.c diff -u src/usr.sbin/sysinst/disklabel.c:1.47 src/usr.sbin/sysinst/disklabel.c:1.48 --- src/usr.sbin/sysinst/disklabel.c:1.47 Tue Jun 21 15:42:43 2022 +++ src/usr.sbin/sysinst/disklabel.c Tue Jun 21 16:08:25 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.47 2022/06/21 15:42:43 martin Exp $ */ +/* $NetBSD: disklabel.c,v 1.48 2022/06/21 16:08:25 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -826,7 +826,8 @@ disklabel_set_part_info(struct disk_part parts->l.d_partitions[part].p_offset = info->start; if (part != RAW_PART #if RAW_PART == 3 -|| part == RAW_PART-1 +&& (part != RAW_PART-1 || +parts->dp.parent == NULL) #endif ) { parts->dp.free_space +=
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 16:08:25 UTC 2022 Modified Files: src/usr.sbin/sysinst: disklabel.c Log Message: Fix inverted condition in previous and only apply special handling for the "all of NetBSD" partition when we have an outer MBR label. Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/disklabel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/usr.sbin/sysinst
> Module Name: src > Committed By: martin > Date: Tue Jun 21 15:42:44 UTC 2022 > > Modified Files: > src/usr.sbin/sysinst: disklabel.c > > Log Message: > Fix free space accounting for partition size changes and deletions. > Part of PR 56886. @@ -822,6 +824,15 @@ > was_inst_target = parts->l.d_partitions[part].p_offset > == parts->install_target; > parts->l.d_partitions[part].p_offset = info->start; > + if (part != RAW_PART > +#if RAW_PART == 3 > + || part == RAW_PART-1 > +#endif > + ) { Shouldn't this part be '&& part != RAW_PART - 1' ? It looks we cannot choose RAW_PART (and RAW_PART-1 on MBR ports) on the inner editor, though. --- Izumi Tsutsui
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 15:46:11 UTC 2022 Modified Files: src/usr.sbin/sysinst: label.c Log Message: Fix free space accounting when partitions change size or are deleted. Part of PR 56886. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/sysinst/label.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/sysinst/label.c diff -u src/usr.sbin/sysinst/label.c:1.40 src/usr.sbin/sysinst/label.c:1.41 --- src/usr.sbin/sysinst/label.c:1.40 Tue Jun 21 15:45:03 2022 +++ src/usr.sbin/sysinst/label.c Tue Jun 21 15:46:10 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: label.c,v 1.40 2022/06/21 15:45:03 martin Exp $ */ +/* $NetBSD: label.c,v 1.41 2022/06/21 15:46:10 martin Exp $ */ /* * Copyright 1997 Jonathan Stone @@ -36,7 +36,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: label.c,v 1.40 2022/06/21 15:45:03 martin Exp $"); +__RCSID("$NetBSD: label.c,v 1.41 2022/06/21 15:46:10 martin Exp $"); #endif #include @@ -1007,6 +1007,9 @@ edit_ptn(menudesc *menu, void *arg) if (!pset->parts->pscheme->set_part_info(pset->parts, edit.id, &edit.info, &err)) err_msg_win(err); + else +pset->cur_free_space += edit.old_info.size - +edit.info.size; } /* @@ -1036,7 +1039,7 @@ edit_ptn(menudesc *menu, void *arg) } remember_deleted(pset, pset->infos[edit.index].parts); - pset->cur_free_space += pset->infos[edit.index].size; + pset->cur_free_space += edit.info.size; memmove(pset->infos+edit.index, pset->infos+edit.index+1, sizeof(*pset->infos)*(pset->num-edit.index));
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 15:46:11 UTC 2022 Modified Files: src/usr.sbin/sysinst: label.c Log Message: Fix free space accounting when partitions change size or are deleted. Part of PR 56886. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/sysinst/label.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 15:45:03 UTC 2022 Modified Files: src/usr.sbin/sysinst: label.c Log Message: renumber_partitions() needs to deal with removed/added partitions. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/sysinst/label.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 15:45:03 UTC 2022 Modified Files: src/usr.sbin/sysinst: label.c Log Message: renumber_partitions() needs to deal with removed/added partitions. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/sysinst/label.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/sysinst/label.c diff -u src/usr.sbin/sysinst/label.c:1.39 src/usr.sbin/sysinst/label.c:1.40 --- src/usr.sbin/sysinst/label.c:1.39 Mon Jun 20 16:06:38 2022 +++ src/usr.sbin/sysinst/label.c Tue Jun 21 15:45:03 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: label.c,v 1.39 2022/06/20 16:06:38 martin Exp $ */ +/* $NetBSD: label.c,v 1.40 2022/06/21 15:45:03 martin Exp $ */ /* * Copyright 1997 Jonathan Stone @@ -36,7 +36,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: label.c,v 1.39 2022/06/20 16:06:38 martin Exp $"); +__RCSID("$NetBSD: label.c,v 1.40 2022/06/21 15:45:03 martin Exp $"); #endif #include @@ -508,7 +508,7 @@ renumber_partitions(struct partition_usa if (!pset->parts->pscheme->get_part_info(pset->parts, pno, &info)) continue; - for (i = 0; i < pset->parts->num_part; i++) { + for (i = 0; i < pset->num; i++) { if (pset->infos[i].cur_start != info.start) continue; if (pset->infos[i].cur_flags != info.flags) @@ -525,8 +525,9 @@ renumber_partitions(struct partition_usa } } - memcpy(pset->infos, ninfos, sizeof(*pset->infos)*pset->parts->num_part); - free(ninfos); + free(pset->infos); + pset->infos = ninfos; + pset->num = pset->parts->num_part; } /*
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 15:42:44 UTC 2022 Modified Files: src/usr.sbin/sysinst: disklabel.c Log Message: Fix free space accounting for partition size changes and deletions. Part of PR 56886. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/disklabel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 15:42:44 UTC 2022 Modified Files: src/usr.sbin/sysinst: disklabel.c Log Message: Fix free space accounting for partition size changes and deletions. Part of PR 56886. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/disklabel.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/sysinst/disklabel.c diff -u src/usr.sbin/sysinst/disklabel.c:1.46 src/usr.sbin/sysinst/disklabel.c:1.47 --- src/usr.sbin/sysinst/disklabel.c:1.46 Tue Jun 21 15:41:29 2022 +++ src/usr.sbin/sysinst/disklabel.c Tue Jun 21 15:42:43 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.46 2022/06/21 15:41:29 martin Exp $ */ +/* $NetBSD: disklabel.c,v 1.47 2022/06/21 15:42:43 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -520,6 +520,8 @@ disklabel_delete(struct disk_partitions if (parts->install_target == parts->l.d_partitions[part].p_offset) parts->install_target = -1; + parts->dp.free_space += + parts->l.d_partitions[part].p_size; parts->l.d_partitions[part].p_size = 0; parts->l.d_partitions[part].p_offset = 0; parts->l.d_partitions[part].p_fstype = FS_UNUSED; @@ -822,6 +824,15 @@ disklabel_set_part_info(struct disk_part was_inst_target = parts->l.d_partitions[part].p_offset == parts->install_target; parts->l.d_partitions[part].p_offset = info->start; + if (part != RAW_PART +#if RAW_PART == 3 +|| part == RAW_PART-1 +#endif + ) { +parts->dp.free_space += +parts->l.d_partitions[part].p_size - +info->size; + } parts->l.d_partitions[part].p_size = info->size; parts->l.d_partitions[part].p_fstype = dl_part_type_from_generic(info->nat_type);
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 15:41:29 UTC 2022 Modified Files: src/usr.sbin/sysinst: disklabel.c Log Message: disklabel_can_add_partition() did not consider additional partitions (while there still is space in the disklabel). Part of PR 56886. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/sysinst/disklabel.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/sysinst/disklabel.c diff -u src/usr.sbin/sysinst/disklabel.c:1.45 src/usr.sbin/sysinst/disklabel.c:1.46 --- src/usr.sbin/sysinst/disklabel.c:1.45 Sat Jun 18 13:56:41 2022 +++ src/usr.sbin/sysinst/disklabel.c Tue Jun 21 15:41:29 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.45 2022/06/18 13:56:41 martin Exp $ */ +/* $NetBSD: disklabel.c,v 1.46 2022/06/21 15:41:29 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -940,7 +940,8 @@ disklabel_can_add_partition(const struct if (disklabel_get_free_spaces_internal(parts, &space, 1, parts->ptn_alignment, parts->ptn_alignment, 0, -1) < 1) return false; - + if (parts->l.d_npartitions < dl_maxpart) + return true; for (i = 0; i < parts->l.d_npartitions; i++) { if (i == RAW_PART) continue;
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jun 21 15:41:29 UTC 2022 Modified Files: src/usr.sbin/sysinst: disklabel.c Log Message: disklabel_can_add_partition() did not consider additional partitions (while there still is space in the disklabel). Part of PR 56886. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/sysinst/disklabel.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: tsutsui Date: Tue Jun 21 15:40:21 UTC 2022 Modified Files: src/sys/arch/atari/dev: font_8x16.c src/sys/dev/wsfont: vt220iso8x16.h Log Message: Correct flipped glyph of 'N' in the "New Line" in the DEC graphics chars. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/atari/dev/font_8x16.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/wsfont/vt220iso8x16.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/dev/font_8x16.c diff -u src/sys/arch/atari/dev/font_8x16.c:1.4 src/sys/arch/atari/dev/font_8x16.c:1.5 --- src/sys/arch/atari/dev/font_8x16.c:1.4 Sun Dec 11 12:16:54 2005 +++ src/sys/arch/atari/dev/font_8x16.c Tue Jun 21 15:40:20 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: font_8x16.c,v 1.4 2005/12/11 12:16:54 christos Exp $ */ +/* $NetBSD: font_8x16.c,v 1.5 2022/06/21 15:40:20 tsutsui Exp $ */ /* * Copyright (c) 1992, 1993, 1994 Hellmuth Michaelis and Joerg Wunsch @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: font_8x16.c,v 1.4 2005/12/11 12:16:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: font_8x16.c,v 1.5 2022/06/21 15:40:20 tsutsui Exp $"); #include @@ -72,7 +72,7 @@ unsigned char fontdata_8x16[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08 */ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, -/* 0x09 */ 0x00, 0x00, 0x88, 0x98, 0xa8, 0xc8, 0x88, 0x00, +/* 0x09 */ 0x00, 0x00, 0x88, 0xc8, 0xa8, 0x98, 0x88, 0x00, 0x10, 0x10, 0x10, 0x10, 0x1e, 0x00, 0x00, 0x00, /* 0x0a */ 0x00, 0x00, 0x88, 0x88, 0x50, 0x50, 0x20, 0x00, 0x3e, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, Index: src/sys/dev/wsfont/vt220iso8x16.h diff -u src/sys/dev/wsfont/vt220iso8x16.h:1.7 src/sys/dev/wsfont/vt220iso8x16.h:1.8 --- src/sys/dev/wsfont/vt220iso8x16.h:1.7 Sun Dec 11 12:24:12 2005 +++ src/sys/dev/wsfont/vt220iso8x16.h Tue Jun 21 15:40:20 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: vt220iso8x16.h,v 1.7 2005/12/11 12:24:12 christos Exp $ */ +/* $NetBSD: vt220iso8x16.h,v 1.8 2022/06/21 15:40:20 tsutsui Exp $ */ /* * Copyright (c) 1992, 1993, 1994 Hellmuth Michaelis and Joerg Wunsch @@ -226,9 +226,9 @@ static u_char vt220iso8x16_data[] = { 0x00, /* */ 0x00, /* */ 0x88, /* *...*... */ - 0x98, /* *..**... */ - 0xa8, /* *.*.*... */ 0xc8, /* **..*... */ + 0xa8, /* *.*.*... */ + 0x98, /* *..**... */ 0x88, /* *...*... */ 0x00, /* */ 0x10, /* ...* */
CVS commit: src/sys
Module Name:src Committed By: tsutsui Date: Tue Jun 21 15:40:21 UTC 2022 Modified Files: src/sys/arch/atari/dev: font_8x16.c src/sys/dev/wsfont: vt220iso8x16.h Log Message: Correct flipped glyph of 'N' in the "New Line" in the DEC graphics chars. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/atari/dev/font_8x16.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/wsfont/vt220iso8x16.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/x68k/stand/boot
Module Name:src Committed By: isaki Date: Tue Jun 21 12:45:46 UTC 2022 Modified Files: src/sys/arch/x68k/stand/boot: version Log Message: x68k/stand: Bump boot's version. Fix blocksize parameter passes to SCSI IOCS. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x68k/stand/boot/version 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/x68k/stand/boot/version diff -u src/sys/arch/x68k/stand/boot/version:1.8 src/sys/arch/x68k/stand/boot/version:1.9 --- src/sys/arch/x68k/stand/boot/version:1.8 Sat Jun 25 14:35:58 2016 +++ src/sys/arch/x68k/stand/boot/version Tue Jun 21 12:45:46 2022 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.8 2016/06/25 14:35:58 isaki Exp $ +$NetBSD: version,v 1.9 2022/06/21 12:45:46 isaki Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -14,3 +14,4 @@ is taken as the current. non ASCII keys (CTRL, OPT.1 etc.) are pressed during boot. 1.6: Disable slow gunzip CRC32 calculation. 1.7: Integrate netboot. +1.8: Fix blocksize parameter passes to SCSI IOCS.
CVS commit: src/sys/arch/x68k/stand/boot
Module Name:src Committed By: isaki Date: Tue Jun 21 12:45:46 UTC 2022 Modified Files: src/sys/arch/x68k/stand/boot: version Log Message: x68k/stand: Bump boot's version. Fix blocksize parameter passes to SCSI IOCS. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x68k/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x68k/stand/libsa
Module Name:src Committed By: isaki Date: Tue Jun 21 12:43:57 UTC 2022 Modified Files: src/sys/arch/x68k/stand/libsa: sdcd.c Log Message: x68k/stand: Correct blocksize in case of CD. - Fix calculation of the blocksize passes to SCSI IOCS. - Use three kind of sector size (blocksize) properly; media's sector size, DEV_BSIZE from xxstrategy, and Human68k's sector size. By this change, - For 512 bytes/sector HDD, no changes are intended. - For CD, corrects the blocksize (%d5) passes to SCSI IOCS. It has worked previously though the blocksize was incorrect. Now it works with correct blocksize. - As a secondary effect, 256 or 1024 bytes/sector media may work but not well tested. Reviewed by tsutsui@ at port-x68k. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x68k/stand/libsa/sdcd.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/x68k/stand/libsa/sdcd.c diff -u src/sys/arch/x68k/stand/libsa/sdcd.c:1.16 src/sys/arch/x68k/stand/libsa/sdcd.c:1.17 --- src/sys/arch/x68k/stand/libsa/sdcd.c:1.16 Tue Jun 21 12:20:43 2022 +++ src/sys/arch/x68k/stand/libsa/sdcd.c Tue Jun 21 12:43:57 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: sdcd.c,v 1.16 2022/06/21 12:20:43 isaki Exp $ */ +/* $NetBSD: sdcd.c,v 1.17 2022/06/21 12:43:57 isaki Exp $ */ /* * Copyright (c) 2001 MINOURA Makoto. @@ -26,6 +26,7 @@ */ #include +#include #include #include #include @@ -36,9 +37,14 @@ static int current_id = -1; -static int current_blklen, current_devsize, current_npart; +static int current_blkbytes; +static int current_blkshift; +static int current_devsize, current_npart; static struct boot_partinfo partitions[MAXPARTITIONS]; +static uint human2blk(uint); +static uint human2bsd(uint); +static uint bsd2blk(uint); static int readdisklabel(int); static int check_unit(int); @@ -48,6 +54,44 @@ static int check_unit(int); #define DPRINTF(x) #endif +/* + * Convert the number of sectors on Human68k + * into the number of blocks on the current device. + */ +static uint +human2blk(uint n) +{ + uint blk_per_sect; + + /* Human68k uses 1024 byte/sector. */ + blk_per_sect = 4 >> current_blkshift; + if (blk_per_sect == 0) + blk_per_sect = 1; + return blk_per_sect * n; +} + +/* + * Convert the number of sectors on Human68k + * into the number of DEV_BSIZE sectors. + */ +static uint +human2bsd(uint n) +{ + + return n * (1024 / DEV_BSIZE); +} + +/* + * Convert the number of DEV_BSIZE sectors + * into the number of blocks on the current device. + */ +static uint +bsd2blk(uint n) +{ + + return ((DEV_BSIZE / 256) * n) >> current_blkshift; +} + static int check_unit(int id) { @@ -90,12 +134,13 @@ check_unit(int id) error = EUNIT; goto out; } - current_blklen = rcdata->size >> 9; + current_blkbytes = rcdata->size; + current_blkshift = fls32(current_blkbytes) - 9; current_devsize = rcdata->block; } { - error = IOCS_S_READ(0, 1, id, current_blklen, buffer); + error = IOCS_S_READ(0, 1, id, current_blkshift, buffer); if (error < 0) { error = EIO; goto out; @@ -125,15 +170,15 @@ readdisklabel(int id) error = check_unit(id); if (error) return error; - if (current_blklen > 4) { + if (current_blkbytes > 2048) { printf("FATAL: Unsupported block size %d.\n", - 256 << current_blklen); + current_blkbytes); return ERDLAB; } /* Try BSD disklabel first */ buffer = alloca(2048); - error = IOCS_S_READ(LABELSECTOR, 1, id, current_blklen, buffer); + error = IOCS_S_READ(LABELSECTOR, 1, id, current_blkshift, buffer); if (error < 0) return EIO; label = (void *)(buffer + LABELOFFSET); @@ -149,13 +194,7 @@ readdisklabel(int id) } /* Try Human68K-style partition table */ -#if 0 - /* assumes 512byte/sec */ - error = IOCS_S_READ(DOSPARTOFF, 2, id, current_blklen, buffer); -#else - error = IOCS_S_READ(8 >> current_blklen, 8 >> current_blklen, - id, current_blklen, buffer); -#endif + error = IOCS_S_READ(human2blk(2), 1, id, current_blkshift, buffer); if (error < 0) return EIO; parttbl = (void *)(buffer + DOSBBSECTOR); @@ -166,9 +205,9 @@ readdisklabel(int id) current_npart < MAXPARTITIONS && i < 15 && parttbl[i].dp_size; i++) { partitions[current_npart].start - = parttbl[i].dp_start * 2; + = human2bsd(parttbl[i].dp_start); partitions[current_npart].size - = parttbl[i].dp_size * 2; + = human2bsd(parttbl[i].dp_size); if (++current_npart == RAW_PART) { partitions[current_npart].start = 0; partitions[current_npart].size = -1; /* XXX */ @@ -205,8 +244,7 @@ sd_getbsdpartition(int id, int humanpart return -1; } buffer = alloca(2048); - error = IOCS_S_READ(8 >> current_blklen, 8 >> current_blklen, - id, current_blklen, buffer); + error = IOCS_S_READ(human2blk(2), 1, id, current_blkshift, buffer); if (error < 0) { printf("Reading partition table: %s\n", strerror(err
CVS commit: src/sys/arch/x68k/stand/libsa
Module Name:src Committed By: isaki Date: Tue Jun 21 12:43:57 UTC 2022 Modified Files: src/sys/arch/x68k/stand/libsa: sdcd.c Log Message: x68k/stand: Correct blocksize in case of CD. - Fix calculation of the blocksize passes to SCSI IOCS. - Use three kind of sector size (blocksize) properly; media's sector size, DEV_BSIZE from xxstrategy, and Human68k's sector size. By this change, - For 512 bytes/sector HDD, no changes are intended. - For CD, corrects the blocksize (%d5) passes to SCSI IOCS. It has worked previously though the blocksize was incorrect. Now it works with correct blocksize. - As a secondary effect, 256 or 1024 bytes/sector media may work but not well tested. Reviewed by tsutsui@ at port-x68k. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x68k/stand/libsa/sdcd.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/x68k/stand/libsa
Module Name:src Committed By: isaki Date: Tue Jun 21 12:20:43 UTC 2022 Modified Files: src/sys/arch/x68k/stand/libsa: sdcd.c Log Message: x68k/stand: Correct a condition expression. - start is LBA but dblk is relative from this partition. - The first term was wrong. It should be '(x & 0x1f) == x', but it's more simple to use numerical comparison. There would have been no impact. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x68k/stand/libsa/sdcd.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/x68k/stand/libsa/sdcd.c diff -u src/sys/arch/x68k/stand/libsa/sdcd.c:1.15 src/sys/arch/x68k/stand/libsa/sdcd.c:1.16 --- src/sys/arch/x68k/stand/libsa/sdcd.c:1.15 Tue Feb 11 08:06:07 2014 +++ src/sys/arch/x68k/stand/libsa/sdcd.c Tue Jun 21 12:20:43 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: sdcd.c,v 1.15 2014/02/11 08:06:07 tsutsui Exp $ */ +/* $NetBSD: sdcd.c,v 1.16 2022/06/21 12:20:43 isaki Exp $ */ /* * Copyright (c) 2001 MINOURA Makoto. @@ -289,7 +289,7 @@ sdstrategy(void *arg, int rw, daddr_t db } nblks = howmany(size, 256 << current_blklen); - if ((dblk & 0x1f) == 0x1f && (nblks & 0xff) == nblks) { + if (start < 0x20 && nblks < 256) { if (rw & F_WRITE) error = IOCS_S_WRITE(start, nblks, current_id, current_blklen, buf);
CVS commit: src/sys/arch/x68k/stand/libsa
Module Name:src Committed By: isaki Date: Tue Jun 21 12:20:43 UTC 2022 Modified Files: src/sys/arch/x68k/stand/libsa: sdcd.c Log Message: x68k/stand: Correct a condition expression. - start is LBA but dblk is relative from this partition. - The first term was wrong. It should be '(x & 0x1f) == x', but it's more simple to use numerical comparison. There would have been no impact. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x68k/stand/libsa/sdcd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.