Browse Source

lib: add missing inline hints

luojia65 2 years ago
parent
commit
6e4063776e
3 changed files with 12 additions and 0 deletions
  1. 4 0
      src/hsm.rs
  2. 1 0
      src/ipi.rs
  3. 7 0
      src/rfence.rs

+ 4 - 0
src/hsm.rs

@@ -206,6 +206,7 @@ pub(crate) fn probe_hsm() -> bool {
     HSM.get().is_some()
 }
 
+#[inline]
 pub(crate) fn hart_start(hartid: usize, start_addr: usize, opaque: usize) -> SbiRet {
     if let Some(obj) = HSM.get() {
         return obj.hart_start(hartid, start_addr, opaque);
@@ -213,6 +214,7 @@ pub(crate) fn hart_start(hartid: usize, start_addr: usize, opaque: usize) -> Sbi
     SbiRet::not_supported()
 }
 
+#[inline]
 pub(crate) fn hart_stop() -> SbiRet {
     if let Some(obj) = HSM.get() {
         return obj.hart_stop();
@@ -220,6 +222,7 @@ pub(crate) fn hart_stop() -> SbiRet {
     SbiRet::not_supported()
 }
 
+#[inline]
 pub(crate) fn hart_get_status(hartid: usize) -> SbiRet {
     if let Some(obj) = HSM.get() {
         return obj.hart_get_status(hartid);
@@ -227,6 +230,7 @@ pub(crate) fn hart_get_status(hartid: usize) -> SbiRet {
     SbiRet::not_supported()
 }
 
+#[inline]
 pub(crate) fn hart_suspend(suspend_type: u32, resume_addr: usize, opaque: usize) -> SbiRet {
     if let Some(obj) = HSM.get() {
         let suspend_type = suspend_type as u32;

+ 1 - 0
src/ipi.rs

@@ -27,6 +27,7 @@ pub(crate) fn probe_ipi() -> bool {
     IPI.get().is_some()
 }
 
+#[inline]
 pub(crate) fn send_ipi(hart_mask: HartMask) -> SbiRet {
     if let Some(ipi) = IPI.get() {
         return ipi.send_ipi(hart_mask);

+ 7 - 0
src/rfence.rs

@@ -151,6 +151,7 @@ pub(crate) fn probe_rfence() -> bool {
     RFENCE.get().is_some()
 }
 
+#[inline]
 pub(crate) fn remote_fence_i(hart_mask: HartMask) -> SbiRet {
     if let Some(rfence) = RFENCE.get() {
         rfence.remote_fence_i(hart_mask)
@@ -159,6 +160,7 @@ pub(crate) fn remote_fence_i(hart_mask: HartMask) -> SbiRet {
     }
 }
 
+#[inline]
 pub(crate) fn remote_sfence_vma(hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
     if let Some(rfence) = RFENCE.get() {
         rfence.remote_sfence_vma(hart_mask, start_addr, size)
@@ -167,6 +169,7 @@ pub(crate) fn remote_sfence_vma(hart_mask: HartMask, start_addr: usize, size: us
     }
 }
 
+#[inline]
 pub(crate) fn remote_sfence_vma_asid(
     hart_mask: HartMask,
     start_addr: usize,
@@ -180,6 +183,7 @@ pub(crate) fn remote_sfence_vma_asid(
     }
 }
 
+#[inline]
 pub(crate) fn remote_hfence_gvma_vmid(
     hart_mask: HartMask,
     start_addr: usize,
@@ -193,6 +197,7 @@ pub(crate) fn remote_hfence_gvma_vmid(
     }
 }
 
+#[inline]
 pub(crate) fn remote_hfence_gvma(hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
     if let Some(rfence) = RFENCE.get() {
         rfence.remote_hfence_gvma(hart_mask, start_addr, size)
@@ -201,6 +206,7 @@ pub(crate) fn remote_hfence_gvma(hart_mask: HartMask, start_addr: usize, size: u
     }
 }
 
+#[inline]
 pub(crate) fn remote_hfence_vvma_asid(
     hart_mask: HartMask,
     start_addr: usize,
@@ -214,6 +220,7 @@ pub(crate) fn remote_hfence_vvma_asid(
     }
 }
 
+#[inline]
 pub(crate) fn remote_hfence_vvma(hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
     if let Some(rfence) = RFENCE.get() {
         rfence.remote_hfence_vvma(hart_mask, start_addr, size)