diff --git a/Kernel/Library/Panic.cpp b/Kernel/Library/Panic.cpp index b77de7883e..3f3dec925c 100644 --- a/Kernel/Library/Panic.cpp +++ b/Kernel/Library/Panic.cpp @@ -10,6 +10,8 @@ # include #elif ARCH(AARCH64) # include +#elif ARCH(RISCV64) +# include #endif #include #include @@ -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.