mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-15 23:37:32 +03:00
Kernel/riscv64: Implement support for "panic=shutdown" cmdline option
This commit is contained in:
parent
8547813b6d
commit
e4244f7469
Notes:
sideshowbarker
2024-07-18 04:46:35 +09:00
Author: https://github.com/spholz Commit: https://github.com/SerenityOS/serenity/commit/e4244f7469 Pull-request: https://github.com/SerenityOS/serenity/pull/22586
@ -10,6 +10,8 @@
|
||||
# include <Kernel/Arch/x86_64/Shutdown.h>
|
||||
#elif ARCH(AARCH64)
|
||||
# include <Kernel/Arch/aarch64/RPi/Watchdog.h>
|
||||
#elif ARCH(RISCV64)
|
||||
# include <Kernel/Arch/riscv64/SBI.h>
|
||||
#endif
|
||||
#include <Kernel/Boot/CommandLine.h>
|
||||
#include <Kernel/KSyms.h>
|
||||
@ -25,6 +27,11 @@ namespace Kernel {
|
||||
virtualbox_shutdown();
|
||||
#elif ARCH(AARCH64)
|
||||
RPi::Watchdog::the().system_shutdown();
|
||||
#elif ARCH(RISCV64)
|
||||
auto ret = SBI::SystemReset::system_reset(SBI::SystemReset::ResetType::Shutdown, SBI::SystemReset::ResetReason::SystemFailure);
|
||||
dbgln("SBI: Failed to shut down: {}", ret);
|
||||
dbgln("SBI: Attempting to shut down using the legacy extension...");
|
||||
SBI::Legacy::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.
|
||||
|
Loading…
Reference in New Issue
Block a user