Skip to main content

sbi_spec/
fwft.rs

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