]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
riscv: always initialize the static kernel environment
authormhorne <mhorne@FreeBSD.org>
Fri, 20 Nov 2020 15:21:10 +0000 (15:21 +0000)
committermhorne <mhorne@FreeBSD.org>
Fri, 20 Nov 2020 15:21:10 +0000 (15:21 +0000)
commitc472031cf2d05808b2d13cc1f4d747f452ecd99b
tree8aba75a43cb95f60cae6941c769a23e11071e46a
parentf23271115b41e34ff62df926a6228818717dff8b
riscv: always initialize the static kernel environment

Ensure we initialize the static environment when not booting via
loader(8), and provide a static buffer if this is the case. This fixes
two issues.

First, performing the initialization ensures that kenv variables set in
the kernel's config file are honored. Previously, any new or overridden
values were ignored.

Second, providing the static buffer allows variables to be set in the
device tree's bootargs property of the chosen node. This can be set by
u-boot or by QEMU's '-append' flag. Attempting to this prior to this
change resulted in an early panic, since the static environment had no
buffer backing it.

Submitted by: syrinx (earlier version)
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D25034
sys/riscv/riscv/machdep.c