From e6925175174b1a7d7b5aef035ec684b2d5f628b9 Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Wed, 23 Feb 2022 21:26:41 -0800 Subject: [PATCH] Handle MODULE_VERBOSE_TWIDDLE in module_verbose_set If module_verbose is set to a value below MODULE_VERBOSE_TWIDDLE call twiddle_divisor(UINT_MAX). This makes more sense here than when we are loading the kernel. Sponsored by: Juniper Networks, Inc. --- stand/common/console.c | 5 +++++ stand/common/load_elf.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stand/common/console.c b/stand/common/console.c index 08d0dc40e3a..0e8afb477ee 100644 --- a/stand/common/console.c +++ b/stand/common/console.c @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -58,6 +59,10 @@ module_verbose_set(struct env_var *ev, int flags, const void *value) return (CMD_ERROR); } module_verbose = (int)v; + if (module_verbose < MODULE_VERBOSE_TWIDDLE) { + /* A hack for now; we do not want twiddling */ + twiddle_divisor(UINT_MAX); + } env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); return (CMD_OK); diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index 62df96aa2eb..4a6c1d5f4e7 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -470,11 +470,6 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, } else if (module_verbose > MODULE_VERBOSE_SILENT) printf("%s ", filename); - if (module_verbose < MODULE_VERBOSE_TWIDDLE) { - /* A hack for now; we do not want twiddling */ - twiddle_divisor(UINT_MAX); - } - fp->f_size = __elfN(loadimage)(fp, &ef, dest); if (fp->f_size == 0 || fp->f_addr == 0) goto ioerr;