forked from AbleOS/ableos
amazing random driver update
This commit is contained in:
parent
c2183d5138
commit
e577572299
|
@ -103,15 +103,17 @@ pub fn spin_loop() -> ! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static mut A_REAL_RANDOM_U64_I_PROMISE: u64 = 0;
|
||||||
|
|
||||||
pub fn hardware_random_u64() -> u64 {
|
pub fn hardware_random_u64() -> u64 {
|
||||||
if let Some(rng) = aarch64_cpu::asm::random::ArmRng::new() {
|
if let Some(rng) = aarch64_cpu::asm::random::ArmRng::new() {
|
||||||
if let Some(rnd) = rng.rndr() {
|
if let Some(rnd) = rng.rndr() {
|
||||||
rnd
|
return rnd;
|
||||||
} else {
|
|
||||||
panic!("RNG failure :(")
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
panic!("RNDR failure :(((")
|
unsafe {
|
||||||
|
A_REAL_RANDOM_U64_I_PROMISE += 1;
|
||||||
|
A_REAL_RANDOM_U64_I_PROMISE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue