浏览代码

Small fix

luojia65 4 年之前
父节点
当前提交
1ac8e9f86b
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 10 0
      platform/k210/src/main.rs
  2. 1 1
      rustsbi/src/reset.rs

+ 10 - 0
platform/k210/src/main.rs

@@ -177,6 +177,16 @@ fn main() -> ! {
         use rustsbi::init_timer;
         init_timer(Timer);
 
+        struct Reset;
+        impl rustsbi::Reset for Reset {
+            fn reset(&self) -> ! {
+                println!("[rustsbi] todo: shutdown all harts on k210; program halt");
+                loop {}
+            }
+        }
+        use rustsbi::init_reset;
+        init_reset(Reset);
+
         use k210_hal::plic::Priority;
         use k210_hal::pac::Interrupt;
         use k210_hal::gpiohs::Edge;

+ 1 - 1
rustsbi/src/reset.rs

@@ -23,5 +23,5 @@ pub(crate) fn reset() -> ! {
     if let Some(obj) = &*RESET.lock() {
         obj.reset();
     }
-    panic!("no reset handler available; this is okay if your platform didn't declared a reset handler")
+    panic!("no reset handler available; this is okay if your platform didn't declare a reset handler")
 }