mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user