mod.rs 772 B

1234567891011121314151617181920212223242526272829303132333435
  1. use rustsbi::RustSBI;
  2. pub mod console;
  3. pub mod hsm;
  4. pub mod ipi;
  5. pub mod reset;
  6. pub mod rfence;
  7. pub mod extensions;
  8. pub mod fifo;
  9. pub mod hart_context;
  10. pub mod logger;
  11. pub mod trap;
  12. pub mod trap_stack;
  13. use console::{ConsoleDevice, SbiConsole};
  14. use hsm::SbiHsm;
  15. use ipi::{IpiDevice, SbiIpi};
  16. use reset::{ResetDevice, SbiReset};
  17. use rfence::SbiRFence;
  18. #[derive(RustSBI, Default)]
  19. #[rustsbi(dynamic)]
  20. pub struct SBI<'a, C: ConsoleDevice, I: IpiDevice, R: ResetDevice> {
  21. #[rustsbi(console)]
  22. pub console: Option<SbiConsole<'a, C>>,
  23. #[rustsbi(ipi, timer)]
  24. pub ipi: Option<SbiIpi<'a, I>>,
  25. #[rustsbi(hsm)]
  26. pub hsm: Option<SbiHsm>,
  27. #[rustsbi(reset)]
  28. pub reset: Option<SbiReset<'a, R>>,
  29. #[rustsbi(fence)]
  30. pub rfence: Option<SbiRFence>,
  31. }