feat(panic): funMessages in panic

feat(rand): also implemented rand
This commit is contained in:
karina
2026-04-30 13:09:59 +04:00
parent fa6e8dfe7c
commit b519e69fbd
3 changed files with 40 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
#pragma once
#include <Types.h>
#include <Arch/Timer.h>
enum {
kRandSeed = 0x9E3779B97F4A7C15ULL,
kRandMultiplier = 0xBF58476D1CE4E5B9ULL,
kRandIncrement = 0x94D049BB133111EBULL,
};
static inline UInt64 Rand() {
static _Atomic UInt64 sequence = 0;
UInt64 z = (TimerGetCounter() + kRandSeed + (++sequence));
z = (z ^ (z >> 30)) * kRandMultiplier;
z = (z ^ (z >> 27)) * kRandIncrement;
return z ^ (z >> 31);
}