mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:47:34 +00:00
Kernel: Fix invalid jump in case RDRAND fails
If RDRAND doesn't give us data, we want to try again, not jump to some low address like 0x80 :^)
This commit is contained in:
parent
a51adf27bf
commit
57b86fd082
1 changed files with 2 additions and 2 deletions
|
@ -35,9 +35,9 @@ static u32 random32()
|
||||||
if (g_cpu_supports_rdrand) {
|
if (g_cpu_supports_rdrand) {
|
||||||
u32 value = 0;
|
u32 value = 0;
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"1%=:\n"
|
"1:\n"
|
||||||
"rdrand %0\n"
|
"rdrand %0\n"
|
||||||
"jnc 1%=\n"
|
"jnc 1b\n"
|
||||||
: "=r"(value));
|
: "=r"(value));
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue