diff --git a/kernel/src/arch/aarch64/mod.rs b/kernel/src/arch/aarch64/mod.rs index 54b1a26b..6de4a918 100644 --- a/kernel/src/arch/aarch64/mod.rs +++ b/kernel/src/arch/aarch64/mod.rs @@ -103,15 +103,17 @@ pub fn spin_loop() -> ! { } } +static mut A_REAL_RANDOM_U64_I_PROMISE: u64 = 0; + pub fn hardware_random_u64() -> u64 { if let Some(rng) = aarch64_cpu::asm::random::ArmRng::new() { if let Some(rnd) = rng.rndr() { - rnd - } else { - panic!("RNG failure :(") + return rnd; } - } else { - panic!("RNDR failure :(((") + } + unsafe { + A_REAL_RANDOM_U64_I_PROMISE += 1; + A_REAL_RANDOM_U64_I_PROMISE } }