Struct CfmwsWindowRestrictions
pub struct CfmwsWindowRestrictions(/* private fields */);Expand description
CFMWS window restrictions bitfield.
Re-exported from cxl_spec so existing vm_topology::cxl users remain
source-compatible.
CFMWS window restrictions bitfield.
Implementations§
§impl CfmwsWindowRestrictions
impl CfmwsWindowRestrictions
pub const fn new() -> CfmwsWindowRestrictions
pub const fn new() -> CfmwsWindowRestrictions
Creates a new default initialized bitfield.
pub const fn from_bits(bits: u16) -> CfmwsWindowRestrictions
pub const fn from_bits(bits: u16) -> CfmwsWindowRestrictions
Convert from bits.
pub const fn device_coherent(&self) -> bool
pub const fn device_coherent(&self) -> bool
Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).
Bits: 0..1
pub const fn with_device_coherent_checked(
self,
value: bool,
) -> Result<CfmwsWindowRestrictions, ()>
pub const fn with_device_coherent_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>
Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).
Bits: 0..1
pub const fn with_device_coherent(self, value: bool) -> CfmwsWindowRestrictions
pub const fn with_device_coherent(self, value: bool) -> CfmwsWindowRestrictions
Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).
Bits: 0..1
pub const fn set_device_coherent(&mut self, value: bool)
pub const fn set_device_coherent(&mut self, value: bool)
Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).
Bits: 0..1
pub const fn set_device_coherent_checked(
&mut self,
value: bool,
) -> Result<(), ()>
pub const fn set_device_coherent_checked( &mut self, value: bool, ) -> Result<(), ()>
Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).
Bits: 0..1
pub const fn host_only_coherent(&self) -> bool
pub const fn host_only_coherent(&self) -> bool
Bit 1: Host-only Coherent (HDM-H).
Bits: 1..2
pub const fn with_host_only_coherent_checked(
self,
value: bool,
) -> Result<CfmwsWindowRestrictions, ()>
pub const fn with_host_only_coherent_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>
Bit 1: Host-only Coherent (HDM-H).
Bits: 1..2
pub const fn with_host_only_coherent(
self,
value: bool,
) -> CfmwsWindowRestrictions
pub const fn with_host_only_coherent( self, value: bool, ) -> CfmwsWindowRestrictions
Bit 1: Host-only Coherent (HDM-H).
Bits: 1..2
pub const fn set_host_only_coherent(&mut self, value: bool)
pub const fn set_host_only_coherent(&mut self, value: bool)
Bit 1: Host-only Coherent (HDM-H).
Bits: 1..2
pub const fn set_host_only_coherent_checked(
&mut self,
value: bool,
) -> Result<(), ()>
pub const fn set_host_only_coherent_checked( &mut self, value: bool, ) -> Result<(), ()>
Bit 1: Host-only Coherent (HDM-H).
Bits: 1..2
pub const fn with_volatile_checked(
self,
value: bool,
) -> Result<CfmwsWindowRestrictions, ()>
pub const fn with_volatile_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>
Bit 2: Window is configured for volatile memory.
Bits: 2..3
pub const fn with_volatile(self, value: bool) -> CfmwsWindowRestrictions
pub const fn with_volatile(self, value: bool) -> CfmwsWindowRestrictions
Bit 2: Window is configured for volatile memory.
Bits: 2..3
pub const fn set_volatile(&mut self, value: bool)
pub const fn set_volatile(&mut self, value: bool)
Bit 2: Window is configured for volatile memory.
Bits: 2..3
pub const fn set_volatile_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_volatile_checked(&mut self, value: bool) -> Result<(), ()>
Bit 2: Window is configured for volatile memory.
Bits: 2..3
pub const fn persistent(&self) -> bool
pub const fn persistent(&self) -> bool
Bit 3: Window is configured for persistent memory.
Bits: 3..4
pub const fn with_persistent_checked(
self,
value: bool,
) -> Result<CfmwsWindowRestrictions, ()>
pub const fn with_persistent_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>
Bit 3: Window is configured for persistent memory.
Bits: 3..4
pub const fn with_persistent(self, value: bool) -> CfmwsWindowRestrictions
pub const fn with_persistent(self, value: bool) -> CfmwsWindowRestrictions
Bit 3: Window is configured for persistent memory.
Bits: 3..4
pub const fn set_persistent(&mut self, value: bool)
pub const fn set_persistent(&mut self, value: bool)
Bit 3: Window is configured for persistent memory.
Bits: 3..4
pub const fn set_persistent_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_persistent_checked(&mut self, value: bool) -> Result<(), ()>
Bit 3: Window is configured for persistent memory.
Bits: 3..4
pub const fn fixed_device_configuration(&self) -> bool
pub const fn fixed_device_configuration(&self) -> bool
Bit 4: Fixed Device Configuration.
Bits: 4..5
pub const fn with_fixed_device_configuration_checked(
self,
value: bool,
) -> Result<CfmwsWindowRestrictions, ()>
pub const fn with_fixed_device_configuration_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>
Bit 4: Fixed Device Configuration.
Bits: 4..5
pub const fn with_fixed_device_configuration(
self,
value: bool,
) -> CfmwsWindowRestrictions
pub const fn with_fixed_device_configuration( self, value: bool, ) -> CfmwsWindowRestrictions
Bit 4: Fixed Device Configuration.
Bits: 4..5
pub const fn set_fixed_device_configuration(&mut self, value: bool)
pub const fn set_fixed_device_configuration(&mut self, value: bool)
Bit 4: Fixed Device Configuration.
Bits: 4..5
pub const fn set_fixed_device_configuration_checked(
&mut self,
value: bool,
) -> Result<(), ()>
pub const fn set_fixed_device_configuration_checked( &mut self, value: bool, ) -> Result<(), ()>
Bit 4: Fixed Device Configuration.
Bits: 4..5
pub const fn with_bi_checked(
self,
value: bool,
) -> Result<CfmwsWindowRestrictions, ()>
pub const fn with_bi_checked( self, value: bool, ) -> Result<CfmwsWindowRestrictions, ()>
Bit 5: Back-Invalidate (BI) enabled.
Bits: 5..6
pub const fn with_bi(self, value: bool) -> CfmwsWindowRestrictions
pub const fn with_bi(self, value: bool) -> CfmwsWindowRestrictions
Bit 5: Back-Invalidate (BI) enabled.
Bits: 5..6
pub const fn set_bi_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_bi_checked(&mut self, value: bool) -> Result<(), ()>
Bit 5: Back-Invalidate (BI) enabled.
Bits: 5..6
§impl CfmwsWindowRestrictions
impl CfmwsWindowRestrictions
pub const NONE: CfmwsWindowRestrictions
pub const NONE: CfmwsWindowRestrictions
No restrictions set.
pub const DEVICE_COHERENT: CfmwsWindowRestrictions
pub const DEVICE_COHERENT: CfmwsWindowRestrictions
Bit 0: Device Coherent (HDM-D / HDM-DB when BI is set).
pub const HOST_ONLY_COHERENT: CfmwsWindowRestrictions
pub const HOST_ONLY_COHERENT: CfmwsWindowRestrictions
Bit 1: Host-only Coherent (HDM-H).
pub const VOLATILE: CfmwsWindowRestrictions
pub const VOLATILE: CfmwsWindowRestrictions
Bit 2: Window is configured for volatile memory.
pub const PERSISTENT: CfmwsWindowRestrictions
pub const PERSISTENT: CfmwsWindowRestrictions
Bit 3: Window is configured for persistent memory.
pub const FIXED_DEVICE_CONFIGURATION: CfmwsWindowRestrictions
pub const FIXED_DEVICE_CONFIGURATION: CfmwsWindowRestrictions
Bit 4: Fixed Device Configuration.
pub const BI: CfmwsWindowRestrictions
pub const BI: CfmwsWindowRestrictions
Bit 5: Back-Invalidate (BI) enabled.
pub const VALID_BITS_MASK: u16
pub const VALID_BITS_MASK: u16
Mask of all currently defined CFMWS window restriction bits.
pub const fn try_from_bits(bits: u16) -> Option<CfmwsWindowRestrictions>
pub const fn try_from_bits(bits: u16) -> Option<CfmwsWindowRestrictions>
Creates a restrictions value from a raw 16-bit bitmap.
Returns None when any reserved bit (15:6) is set.
pub const fn is_valid_bits(bits: u16) -> bool
pub const fn is_valid_bits(bits: u16) -> bool
Returns true if bits only contains currently defined restriction bits.
pub const fn contains(self, other: CfmwsWindowRestrictions) -> bool
pub const fn contains(self, other: CfmwsWindowRestrictions) -> bool
True when all bits in other are present in self.
Trait Implementations§
§impl BitOr for CfmwsWindowRestrictions
impl BitOr for CfmwsWindowRestrictions
§type Output = CfmwsWindowRestrictions
type Output = CfmwsWindowRestrictions
| operator.§fn bitor(
self,
rhs: CfmwsWindowRestrictions,
) -> <CfmwsWindowRestrictions as BitOr>::Output
fn bitor( self, rhs: CfmwsWindowRestrictions, ) -> <CfmwsWindowRestrictions as BitOr>::Output
| operation. Read more§impl BitOrAssign for CfmwsWindowRestrictions
impl BitOrAssign for CfmwsWindowRestrictions
§fn bitor_assign(&mut self, rhs: CfmwsWindowRestrictions)
fn bitor_assign(&mut self, rhs: CfmwsWindowRestrictions)
|= operation. Read more§impl Clone for CfmwsWindowRestrictions
impl Clone for CfmwsWindowRestrictions
§fn clone(&self) -> CfmwsWindowRestrictions
fn clone(&self) -> CfmwsWindowRestrictions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more