diff options
author | Liav A <liavalb@gmail.com> | 2022-09-02 09:45:30 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-09-20 18:43:05 +0100 |
commit | 4555cac63974914c52f711acd2f64ac02e0e9df8 (patch) | |
tree | c09b1b36aea0e6f1547b15e1aa7c68c2ffee694e /Kernel/Panic.cpp | |
parent | d3601aedc5a8126a80da4fabc8c841d1fad13b57 (diff) | |
download | serenity-4555cac63974914c52f711acd2f64ac02e0e9df8.zip |
Kernel: Move QEMU shutdown code to the x86 subdirectory
QEMU VM shutdown code is really x86 specific, so let's ensure we only
use it when compiling a Kernel for x86 machines.
Diffstat (limited to 'Kernel/Panic.cpp')
-rw-r--r-- | Kernel/Panic.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Kernel/Panic.cpp b/Kernel/Panic.cpp index f2f20accc6..ca36075151 100644 --- a/Kernel/Panic.cpp +++ b/Kernel/Panic.cpp @@ -6,7 +6,9 @@ #include <AK/Format.h> #include <Kernel/Arch/Processor.h> -#include <Kernel/Arch/x86/IO.h> +#if ARCH(I386) || ARCH(X86_64) +# include <Kernel/Arch/x86/common/QEMUShutdown.h> +#endif #include <Kernel/CommandLine.h> #include <Kernel/KSyms.h> #include <Kernel/Panic.h> @@ -16,11 +18,11 @@ namespace Kernel { [[noreturn]] static void __shutdown() { - // Note: This will invoke QEMU Shutdown, but for other platforms (or emulators), - // this has no effect on the system, so we still need to halt afterwards. - // We also try the Bochs/Old QEMU shutdown method, if the first didn't work. - IO::out16(0x604, 0x2000); - IO::out16(0xb004, 0x2000); +#if ARCH(I386) || ARCH(X86_64) + qemu_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. Processor::halt(); } |