28 lines
656 B
C++
28 lines
656 B
C++
#include "opensbi/extensions/srst.h"
|
|
|
|
namespace drivers {
|
|
namespace opensbi::srst {
|
|
|
|
namespace {
|
|
enum class ExtensionId {
|
|
SRST = 0x53525354
|
|
};
|
|
|
|
enum class FunctionId {
|
|
SYSTEM_RESET
|
|
};
|
|
}
|
|
|
|
SbiRet system_reset(
|
|
ResetType reset_type,
|
|
ResetReason reset_reason) {
|
|
return ecall(
|
|
static_cast<sbiword_t>(ExtensionId::SRST),
|
|
static_cast<sbiword_t>(FunctionId::SYSTEM_RESET),
|
|
static_cast<uint32_t>(reset_type),
|
|
static_cast<uint32_t>(reset_reason));
|
|
}
|
|
|
|
} // End namespace opensbi::srst
|
|
} // End namespace drivers
|
|
|