ipi.rs 631 B

1234567891011121314151617181920
  1. use sbi_spec::binary::{HartMask, SbiRet};
  2. /// Inter-processor interrupt support.
  3. pub trait Ipi {
  4. /// Send an inter-processor interrupt to all the harts defined in `hart_mask`.
  5. ///
  6. /// Inter-processor interrupts manifest at the receiving harts as the supervisor software interrupts.
  7. ///
  8. /// # Return value
  9. ///
  10. /// Should return `SbiRet::success()` if IPI was sent to all the targeted harts successfully.
  11. fn send_ipi(&self, hart_mask: HartMask) -> SbiRet;
  12. }
  13. impl<T: Ipi> Ipi for &T {
  14. #[inline]
  15. fn send_ipi(&self, hart_mask: HartMask) -> SbiRet {
  16. T::send_ipi(self, hart_mask)
  17. }
  18. }