xref: /DragonOS/kernel/src/arch/x86_64/rand.rs (revision c635d8a9cfe25bc11779f323ef0c7d7a0f597d4a)
1 use core::arch::x86_64::_rdtsc;
2 
3 pub fn rand() -> usize {
4     return unsafe { (_rdtsc() * _rdtsc() + 998244353_u64 * _rdtsc()) as usize };
5 }
6