mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 14:55:07 +00:00

QEMU VM shutdown code is really x86 specific, so let's ensure we only use it when compiling a Kernel for x86 machines.
21 lines
505 B
C++
21 lines
505 B
C++
/*
|
|
* 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);
|
|
}
|
|
|
|
}
|