diff --git a/arch/x86_64/init.c b/arch/x86_64/init.c index a4e6d98..903c93b 100644 --- a/arch/x86_64/init.c +++ b/arch/x86_64/init.c @@ -20,6 +20,8 @@ #include #include +#undef HARDWARE_RNG + #define PTR32(x) ((void *)((uintptr_t)(x))) /* the physical address of the start of the memblock heap. @@ -125,17 +127,21 @@ int ml_init(uintptr_t arg) reserve_end = bsp.mod_base + bsp.mod_size; } +#if defined(HARDWARE_RNG) if (ml_hwrng_available()) { printk("cpu: ardware RNG available"); uint64_t seed = ml_hwrng_generate(); printk("cpu: RNG seed=%zx", seed); init_random(seed); } else { +#endif printk("cpu: hardware RNG unavailable"); uint64_t seed = 0xeddc4c8a679dc23f; printk("cpu: RNG seed=%zx", seed); init_random(seed); +#if defined(HARDWARE_RNG) } +#endif early_vm_init(reserve_end);