mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
Kernel: Call ACPI reboot method first if possible
Now we call ACPI reboot method first if possible, and if ACPI reboot is not available, we attempt to reboot via the keyboard controller.
This commit is contained in:
parent
87582d5e63
commit
1b8cd6db7b
Notes:
sideshowbarker
2024-07-19 08:53:27 +09:00
Author: https://github.com/supercomputer7
Commit: 1b8cd6db7b
Pull-request: https://github.com/SerenityOS/serenity/pull/1343
Reviewed-by: https://github.com/awesomekling
7 changed files with 32 additions and 19 deletions
|
@ -31,6 +31,7 @@
|
|||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Time.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/ACPI/ACPIParser.h>
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/Devices/BlockDevice.h>
|
||||
#include <Kernel/Devices/KeyboardDevice.h>
|
||||
|
@ -3990,6 +3991,10 @@ int Process::sys$reboot()
|
|||
FS::lock_all();
|
||||
dbg() << "syncing mounted filesystems...";
|
||||
FS::sync();
|
||||
if (ACPI::Parser::the().can_reboot()) {
|
||||
dbg() << "attempting reboot via ACPI";
|
||||
ACPI::Parser::the().try_acpi_reboot();
|
||||
}
|
||||
dbg() << "attempting reboot via KB Controller...";
|
||||
IO::out8(0x64, 0xFE);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue