summaryrefslogtreecommitdiff
path: root/src/kernel/sbi.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/sbi.cc')
-rw-r--r--src/kernel/sbi.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kernel/sbi.cc b/src/kernel/sbi.cc
index 442d219..9570d74 100644
--- a/src/kernel/sbi.cc
+++ b/src/kernel/sbi.cc
@@ -1,4 +1,5 @@
#include "common/types.h"
+#include "kernel/sbi.h"
namespace SBI
{
@@ -31,4 +32,17 @@ namespace SBI
{
sbi_call(0x54494D45, 0, stime_value, 0, 0);
}
+
+ void sbi_shutdown()
+ {
+ sbi_call(0x53525354, 0, 0, 0, 0);
+ sbi_call(0x08, 0, 0, 0, 0);
+ while (1)
+ ;
+ }
+
+ void sbi_reboot()
+ {
+ sbi_call(SBI_EID_SRST, SBI_FID_SRST_RESET, SBI_SRST_TYPE_COLD_REBOOT, SBI_SRST_REASON_NONE, 0);
+ }
} \ No newline at end of file