1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

Kernel: Abstracts x86 reboot and shutdown specific methods

We move QEMU and VirtualBox shutdown sequences to a separate file, as
well as moving the i8042 reboot code sequence too to another file.

This allows us to abstract specific methods from the power state node
code of the SysFS filesystem, to allow other architectures to put their
methods there too in the future.
This commit is contained in:
Liav A 2022-09-02 10:17:55 +03:00 committed by Linus Groh
parent 0a220a413f
commit 9252a892bb
7 changed files with 56 additions and 13 deletions

View file

@ -7,7 +7,7 @@
#include <AK/Format.h>
#include <Kernel/Arch/Processor.h>
#if ARCH(I386) || ARCH(X86_64)
# include <Kernel/Arch/x86/common/QEMUShutdown.h>
# include <Kernel/Arch/x86/common/Shutdown.h>
#endif
#include <Kernel/CommandLine.h>
#include <Kernel/KSyms.h>
@ -20,6 +20,7 @@ namespace Kernel {
{
#if ARCH(I386) || ARCH(X86_64)
qemu_shutdown();
virtualbox_shutdown();
#endif
// Note: If we failed to invoke platform shutdown, we need to halt afterwards
// to ensure no further execution on any CPU still happens.