4
0

fwft.rs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //! Chapter 18. Firmware Features Extension (EID #0x46574654 "FWFT").
  2. /// Extension ID for Firmware Features Extension.
  3. #[doc(alias = "SBI_EXT_FWFT")]
  4. pub const EID_FWFT: usize = crate::eid_from_str("FWFT") as _;
  5. pub use fid::*;
  6. /// Declared in §18.3.
  7. mod fid {
  8. /// Set the firmware function of the request based on Value and Flags parameters.
  9. ///
  10. /// Declared in §18.1.
  11. #[doc(alias = "SBI_EXT_FWFT_SET")]
  12. pub const SET: usize = 0;
  13. /// Return to the firmware function configuration value.
  14. ///
  15. /// Declared in §18.2.
  16. #[doc(alias = "SBI_EXT_FWFT_GET")]
  17. pub const GET: usize = 1;
  18. }
  19. /// FWFT Feature Types.
  20. ///
  21. /// Declared in §18.
  22. pub mod feature_type {
  23. /// Control misaligned access exception delegation.
  24. ///
  25. /// Declared in §18.
  26. pub const MISALIGNED_EXC_DELEG: usize = 0;
  27. /// Control landing pad support.
  28. ///
  29. /// Declared in §18.
  30. pub const LANDING_PAD: usize = 1;
  31. /// Control shadow stack support.
  32. ///
  33. /// Declared in §18.
  34. pub const SHADOW_STACK: usize = 2;
  35. /// Control double trap support.
  36. ///
  37. /// Declared in §18.
  38. pub const DOUBLE_TRAP: usize = 3;
  39. /// Control hardware updating of PTE A/D bits.
  40. ///
  41. /// Declared in §18.
  42. pub const PTE_AD_HW_UPDATING: usize = 4;
  43. /// Control the pointer masking tag length.
  44. ///
  45. /// Declared in §18.
  46. pub const POINTER_MASKING_PMLEN: usize = 5;
  47. }
  48. /// Firmware Features Set.
  49. ///
  50. /// Declared in §18.1.
  51. pub mod flags {
  52. use bitflags::bitflags;
  53. bitflags! {
  54. #[derive(Clone, Copy, PartialEq, Eq)]
  55. /// Declared in Table 94.
  56. pub struct SetFlags: usize {
  57. /// If provided, once set, the feature value can no longer be modified.
  58. const LOCK = 1 << 0;
  59. }
  60. }
  61. }