diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index 550d440cddc1..841bfeda891e 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -130,6 +130,8 @@ cpuset_t all_harts; extern int *end; +static char static_kenv[PAGE_SIZE]; + static void cpu_startup(void *dummy) { @@ -836,6 +838,8 @@ parse_metadata(void) kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); if (kern_envp != NULL) init_static_kenv(kern_envp, 0); + else + init_static_kenv(static_kenv, sizeof(static_kenv)); #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t);