mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +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: 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