浏览代码

Merge pull request #38 from luojia65/main

fix: small fix on reset module
Luo Jia 2 年之前
父节点
当前提交
9a09791294
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      Cargo.toml
  2. 2 1
      src/reset.rs

+ 1 - 1
Cargo.toml

@@ -16,7 +16,7 @@ categories = ["os", "embedded", "hardware-support", "no-std"]
 edition = "2021"
 
 [dependencies]
-riscv = { git = "[email protected]:rust-embedded/riscv.git", commit = "e38a68d" }
+riscv = { git = "https://github.com/rust-embedded/riscv", commit = "e38a68d" }
 # todo: change to a release version when the fix is released
 # riscv = "0.8"
 sbi-spec = "0.0.2"

+ 2 - 1
src/reset.rs

@@ -41,6 +41,7 @@ pub trait Reset: Send + Sync {
     /// Legacy extension's reset function
     ///
     /// Puts all the harts to shut down state from supervisor point of view. This SBI call doesn’t return.
+    #[cfg(feature = "legacy")]
     fn legacy_reset(&self) -> ! {
         use sbi_spec::srst::{RESET_REASON_NO_REASON, RESET_TYPE_SHUTDOWN};
         // By default, this function redirects to `system_reset`.
@@ -53,7 +54,7 @@ use crate::util::AmoOnceRef;
 
 static RESET: AmoOnceRef<dyn Reset> = AmoOnceRef::new();
 
-#[doc(hidden)]
+/// Init SRST module
 pub fn init_reset(reset: &'static dyn Reset) {
     if !RESET.try_call_once(reset) {
         panic!("load sbi module when already loaded")