Add back x86_32 support #5

Merged
Bananymous merged 46 commits from x86_32 into main 2024-04-03 02:36:29 +03:00
1 changed files with 13 additions and 1 deletions
Showing only changes of commit d920785256 - Show all commits

View File

@ -20,7 +20,19 @@ namespace Kernel
if (ecx & CPUID::ECX_RDRND)
{
asm volatile("rdrand %0" : "=a"(s_rand_seed));
#if ARCH(x86_64)
asm volatile("rdrand %0" : "=r"(s_rand_seed));
#elif ARCH(i386)
uint32_t lo, hi;
asm volatile(
"rdrand %[lo];"
"rdrand %[hi];"
: [lo]"=r"(lo), [hi]"=r"(hi)
);
s_rand_seed = ((uint64_t)hi << 32) | lo;
#else
#error
#endif
dprintln("RNG seeded by RDRAND");
}
else