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.
This commit is contained in:
Simon J. Gerraty 2022-02-23 21:26:41 -08:00
parent fcb164742b
commit e692517517
2 changed files with 5 additions and 5 deletions

View file

@ -27,6 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <stand.h>
#include <string.h>
@ -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);

View file

@ -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;