1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00: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:
Liav A 2020-03-03 19:28:37 +02:00 committed by Andreas Kling
parent 87582d5e63
commit 1b8cd6db7b
7 changed files with 32 additions and 19 deletions

View file

@ -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);