1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +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

@ -1,21 +0,0 @@
/*
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/x86/IO.h>
#include <Kernel/Arch/x86/common/QEMUShutdown.h>
namespace Kernel {
void qemu_shutdown()
{
// Note: This will invoke QEMU Shutdown, but for other platforms (or emulators),
// this has no effect on the system.
// We also try the Bochs/Old QEMU shutdown method, if the first didn't work.
IO::out16(0x604, 0x2000);
IO::out16(0xb004, 0x2000);
}
}