mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +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
Notes:
sideshowbarker
2024-07-19 06:18:51 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/57b86fd082c
1 changed files with 2 additions and 2 deletions
|
@ -35,9 +35,9 @@ static u32 random32()
|
|||
if (g_cpu_supports_rdrand) {
|
||||
u32 value = 0;
|
||||
asm volatile(
|
||||
"1%=:\n"
|
||||
"1:\n"
|
||||
"rdrand %0\n"
|
||||
"jnc 1%=\n"
|
||||
"jnc 1b\n"
|
||||
: "=r"(value));
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue