Преглед на файлове

lib: add missing #[inline] tags for functions in trait implementations

Signed-off-by: Zhouqi Jiang <[email protected]>
Zhouqi Jiang преди 1 година
родител
ревизия
c7ce73bb84
променени са 3 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 4 0
      src/cppc.rs
  2. 1 0
      src/hsm.rs
  3. 4 0
      src/rfence.rs

+ 4 - 0
src/cppc.rs

@@ -116,15 +116,19 @@ pub trait Cppc {
 }
 
 impl<T: Cppc> Cppc for &T {
+    #[inline]
     fn probe(&self, reg_id: u32) -> SbiRet {
         T::probe(self, reg_id)
     }
+    #[inline]
     fn read(&self, reg_id: u32) -> SbiRet {
         T::read(self, reg_id)
     }
+    #[inline]
     fn read_hi(&self, reg_id: u32) -> SbiRet {
         T::read_hi(self, reg_id)
     }
+    #[inline]
     fn write(&self, reg_id: u32, val: u64) -> SbiRet {
         T::write(self, reg_id, val)
     }

+ 1 - 0
src/hsm.rs

@@ -192,6 +192,7 @@ pub trait Hsm {
     /// | `SbiRet::not_supported()`   | `suspend_type` is valid but not implemented.
     /// | `SbiRet::invalid_address()` | `resume_addr` is not valid, possibly due to the following reasons: it is not a valid physical address, or executable access to the address is prohibited by a physical memory protection mechanism or H-extension G-stage for supervisor-mode.
     /// | `SbiRet::failed()`          | The suspend request failed for unspecified or unknown other reasons.
+    #[inline]
     fn hart_suspend(&self, suspend_type: u32, resume_addr: usize, opaque: usize) -> SbiRet {
         let _ = (suspend_type, resume_addr, opaque);
         SbiRet::not_supported()

+ 4 - 0
src/rfence.rs

@@ -58,6 +58,7 @@ pub trait Rfence {
     /// | `SbiRet::success()`         | Remote fence was sent to all the targeted harts successfully.
     /// | `SbiRet::not_supported()`   | This function is not supported as it is not implemented or one of the target hart doesn’t support hypervisor extension.
     /// | `SbiRet::invalid_address()` | `start_addr` or `size` is not valid.
+    #[inline]
     fn remote_hfence_gvma_vmid(
         &self,
         hart_mask: HartMask,
@@ -83,6 +84,7 @@ pub trait Rfence {
     /// | `SbiRet::success()`         | Remote fence was sent to all the targeted harts successfully.
     /// | `SbiRet::not_supported()`   | This function is not supported as it is not implemented or one of the target hart does not support hypervisor extension.
     /// | `SbiRet::invalid_address()` | `start_addr` or `size` is not valid.
+    #[inline]
     fn remote_hfence_gvma(&self, hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
         let _ = (hart_mask, start_addr, size);
         SbiRet::not_supported()
@@ -103,6 +105,7 @@ pub trait Rfence {
     /// | `SbiRet::success()`         | Remote fence was sent to all the targeted harts successfully.
     /// | `SbiRet::not_supported()`   | This function is not supported as it is not implemented or one of the target hart does not support hypervisor extension.
     /// | `SbiRet::invalid_address()` | `start_addr` or `size` is not valid.
+    #[inline]
     fn remote_hfence_vvma_asid(
         &self,
         hart_mask: HartMask,
@@ -128,6 +131,7 @@ pub trait Rfence {
     /// | `SbiRet::success()`         | Remote fence was sent to all the targeted harts successfully.
     /// | `SbiRet::not_supported()`   | This function is not supported as it is not implemented or one of the target hart doesn’t support hypervisor extension.
     /// | `SbiRet::invalid_address()` | `start_addr` or `size` is not valid.
+    #[inline]
     fn remote_hfence_vvma(&self, hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
         let _ = (hart_mask, start_addr, size);
         SbiRet::not_supported()