123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- use crate::hart_mask::HartMask;
- use sbi_spec::binary::SbiRet;
- pub trait Rfence: Send + Sync {
-
-
-
-
-
- fn remote_fence_i(&self, hart_mask: HartMask) -> SbiRet;
-
-
-
-
-
-
-
-
-
-
-
- fn remote_sfence_vma(&self, hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet;
-
-
-
-
-
-
-
-
-
-
-
-
- fn remote_sfence_vma_asid(
- &self,
- hart_mask: HartMask,
- start_addr: usize,
- size: usize,
- asid: usize,
- ) -> SbiRet;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- fn remote_hfence_gvma_vmid(
- &self,
- hart_mask: HartMask,
- start_addr: usize,
- size: usize,
- vmid: usize,
- ) -> SbiRet {
- let _ = (hart_mask, start_addr, size, vmid);
- SbiRet::not_supported()
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- fn remote_hfence_gvma(&self, hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
- let _ = (hart_mask, start_addr, size);
- SbiRet::not_supported()
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- fn remote_hfence_vvma_asid(
- &self,
- hart_mask: HartMask,
- start_addr: usize,
- size: usize,
- asid: usize,
- ) -> SbiRet {
- let _ = (hart_mask, start_addr, size, asid);
- SbiRet::not_supported()
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- fn remote_hfence_vvma(&self, hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
- let _ = (hart_mask, start_addr, size);
- SbiRet::not_supported()
- }
- }
- impl<T: Rfence> Rfence for &T {
- #[inline]
- fn remote_fence_i(&self, hart_mask: HartMask) -> SbiRet {
- T::remote_fence_i(self, hart_mask)
- }
- #[inline]
- fn remote_sfence_vma(&self, hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
- T::remote_sfence_vma(self, hart_mask, start_addr, size)
- }
- #[inline]
- fn remote_sfence_vma_asid(
- &self,
- hart_mask: HartMask,
- start_addr: usize,
- size: usize,
- asid: usize,
- ) -> SbiRet {
- T::remote_sfence_vma_asid(self, hart_mask, start_addr, size, asid)
- }
- #[inline]
- fn remote_hfence_gvma_vmid(
- &self,
- hart_mask: HartMask,
- start_addr: usize,
- size: usize,
- vmid: usize,
- ) -> SbiRet {
- T::remote_hfence_gvma_vmid(self, hart_mask, start_addr, size, vmid)
- }
- #[inline]
- fn remote_hfence_gvma(&self, hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
- T::remote_hfence_gvma(self, hart_mask, start_addr, size)
- }
- #[inline]
- fn remote_hfence_vvma_asid(
- &self,
- hart_mask: HartMask,
- start_addr: usize,
- size: usize,
- asid: usize,
- ) -> SbiRet {
- T::remote_hfence_vvma_asid(self, hart_mask, start_addr, size, asid)
- }
- #[inline]
- fn remote_hfence_vvma(&self, hart_mask: HartMask, start_addr: usize, size: usize) -> SbiRet {
- T::remote_hfence_vvma(self, hart_mask, start_addr, size)
- }
- }
|