Browse Source

forward: small fix on PMU counter_fw_read_hi

Signed-off-by: Zhouqi Jiang <[email protected]>
Zhouqi Jiang 1 year ago
parent
commit
8969b28a6d
2 changed files with 14 additions and 0 deletions
  1. 13 0
      src/forward.rs
  2. 1 0
      src/pmu.rs

+ 13 - 0
src/forward.rs

@@ -495,6 +495,19 @@ impl Pmu for Forward {
             }
         }
     }
+    
+    #[inline]
+    fn counter_fw_read_hi(&self, counter_idx: usize) -> SbiRet {
+        match () {
+            #[cfg(feature = "forward")]
+            () => sbi_rt::pmu_counter_fw_read_hi(counter_idx),
+            #[cfg(not(feature = "forward"))]
+            () => {
+                let _ = counter_idx;
+                unimplemented!()
+            }
+        }
+    }
 }
 
 impl Reset for Forward {

+ 1 - 0
src/pmu.rs

@@ -209,6 +209,7 @@ pub trait Pmu {
     /// |:--------------------------|:----------------------------------------------
     /// | `SbiRet::success()`       | firmware counter read successfully.
     /// | `SbiRet::invalid_param()` | `counter_idx` points to a hardware counter or an invalid counter.
+    #[inline]
     fn counter_fw_read_hi(&self, counter_idx: usize) -> SbiRet {
         match () {
             #[cfg(not(target_pointer_width = "32"))]