Struct DescriptorFlags
pub struct DescriptorFlags(<DescriptorFlags as PublicFlags>::Internal);Expand description
Flags for a GDT descriptor. Not all flags are valid for all descriptor types.
Tuple Fields§
§0: <DescriptorFlags as PublicFlags>::InternalImplementations§
§impl DescriptorFlags
impl DescriptorFlags
pub const ACCESSED: DescriptorFlags
pub const ACCESSED: DescriptorFlags
Set by the processor if this segment has been accessed. Only cleared by software. Setting this bit in software prevents GDT writes on first use.
pub const WRITABLE: DescriptorFlags
pub const WRITABLE: DescriptorFlags
For 32-bit data segments, sets the segment as writable. For 32-bit code segments, sets the segment as readable. In 64-bit mode, ignored for all segments.
pub const CONFORMING: DescriptorFlags
pub const CONFORMING: DescriptorFlags
For code segments, sets the segment as “conforming”, influencing the privilege checks that occur on control transfers. For 32-bit data segments, sets the segment as “expand down”. In 64-bit mode, ignored for data segments.
pub const EXECUTABLE: DescriptorFlags
pub const EXECUTABLE: DescriptorFlags
This flag must be set for code segments and unset for data segments.
pub const USER_SEGMENT: DescriptorFlags
pub const USER_SEGMENT: DescriptorFlags
This flag must be set for user segments (in contrast to system segments).
pub const DPL_RING_3: DescriptorFlags
pub const DPL_RING_3: DescriptorFlags
These two bits encode the Descriptor Privilege Level (DPL) for this descriptor. If both bits are set, the DPL is Ring 3, if both are unset, the DPL is Ring 0.
pub const PRESENT: DescriptorFlags
pub const PRESENT: DescriptorFlags
Must be set for any segment, causes a segment not present exception if not set.
pub const AVAILABLE: DescriptorFlags
pub const AVAILABLE: DescriptorFlags
Available for use by the Operating System
pub const LONG_MODE: DescriptorFlags
pub const LONG_MODE: DescriptorFlags
Must be set for 64-bit code segments, unset otherwise.
pub const DEFAULT_SIZE: DescriptorFlags
pub const DEFAULT_SIZE: DescriptorFlags
Use 32-bit (as opposed to 16-bit) operands. If LONG_MODE is set,
this must be unset. In 64-bit mode, ignored for data segments.
pub const GRANULARITY: DescriptorFlags
pub const GRANULARITY: DescriptorFlags
Limit field is scaled by 4096 bytes. In 64-bit mode, ignored for all segments.
pub const LIMIT_0_15: DescriptorFlags
pub const LIMIT_0_15: DescriptorFlags
Bits 0..=15 of the limit field (ignored in 64-bit mode)
pub const LIMIT_16_19: DescriptorFlags
pub const LIMIT_16_19: DescriptorFlags
Bits 16..=19 of the limit field (ignored in 64-bit mode)
pub const BASE_0_23: DescriptorFlags
pub const BASE_0_23: DescriptorFlags
Bits 0..=23 of the base field (ignored in 64-bit mode, except for fs and gs)
pub const BASE_24_31: DescriptorFlags
pub const BASE_24_31: DescriptorFlags
Bits 24..=31 of the base field (ignored in 64-bit mode, except for fs and gs)
§impl DescriptorFlags
impl DescriptorFlags
pub const fn empty() -> DescriptorFlags
pub const fn empty() -> DescriptorFlags
Get a flags value with all bits unset.
pub const fn all() -> DescriptorFlags
pub const fn all() -> DescriptorFlags
Get a flags value with all known bits set.
pub const fn bits(&self) -> u64
pub const fn bits(&self) -> u64
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
pub const fn from_bits(bits: u64) -> Option<DescriptorFlags>
pub const fn from_bits(bits: u64) -> Option<DescriptorFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
pub const fn from_bits_truncate(bits: u64) -> DescriptorFlags
pub const fn from_bits_truncate(bits: u64) -> DescriptorFlags
Convert from a bits value, unsetting any unknown bits.
pub const fn from_bits_retain(bits: u64) -> DescriptorFlags
pub const fn from_bits_retain(bits: u64) -> DescriptorFlags
Convert from a bits value exactly.
pub fn from_name(name: &str) -> Option<DescriptorFlags>
pub fn from_name(name: &str) -> Option<DescriptorFlags>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
pub const fn intersects(&self, other: DescriptorFlags) -> bool
pub const fn intersects(&self, other: DescriptorFlags) -> bool
Whether any set bits in other are also set in self.
pub const fn contains(&self, other: DescriptorFlags) -> bool
pub const fn contains(&self, other: DescriptorFlags) -> bool
Whether all set bits in other are also set in self.
pub fn insert(&mut self, other: DescriptorFlags)
pub fn insert(&mut self, other: DescriptorFlags)
The bitwise or (|) of the bits in self and other.
pub fn remove(&mut self, other: DescriptorFlags)
pub fn remove(&mut self, other: DescriptorFlags)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
pub fn toggle(&mut self, other: DescriptorFlags)
pub fn toggle(&mut self, other: DescriptorFlags)
The bitwise exclusive-or (^) of the bits in self and other.
pub fn set(&mut self, other: DescriptorFlags, value: bool)
pub fn set(&mut self, other: DescriptorFlags, value: bool)
Call insert when value is true or remove when value is false.
pub const fn intersection(self, other: DescriptorFlags) -> DescriptorFlags
pub const fn intersection(self, other: DescriptorFlags) -> DescriptorFlags
The bitwise and (&) of the bits in self and other.
pub const fn union(self, other: DescriptorFlags) -> DescriptorFlags
pub const fn union(self, other: DescriptorFlags) -> DescriptorFlags
The bitwise or (|) of the bits in self and other.
pub const fn difference(self, other: DescriptorFlags) -> DescriptorFlags
pub const fn difference(self, other: DescriptorFlags) -> DescriptorFlags
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
pub const fn symmetric_difference(
self,
other: DescriptorFlags,
) -> DescriptorFlags
pub const fn symmetric_difference( self, other: DescriptorFlags, ) -> DescriptorFlags
The bitwise exclusive-or (^) of the bits in self and other.
pub const fn complement(self) -> DescriptorFlags
pub const fn complement(self) -> DescriptorFlags
The bitwise negation (!) of the bits in self, truncating the result.
§impl DescriptorFlags
impl DescriptorFlags
pub const fn iter(&self) -> Iter<DescriptorFlags> ⓘ
pub const fn iter(&self) -> Iter<DescriptorFlags> ⓘ
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
pub const fn iter_names(&self) -> IterNames<DescriptorFlags> ⓘ
pub const fn iter_names(&self) -> IterNames<DescriptorFlags> ⓘ
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
§impl DescriptorFlags
impl DescriptorFlags
In short, these values disable segmentation, permission checks, and access tracking at the GDT level. Kernels using these values should use paging to implement this functionality.
pub const KERNEL_DATA: DescriptorFlags
pub const KERNEL_DATA: DescriptorFlags
A kernel data segment (64-bit or flat 32-bit)
pub const KERNEL_CODE32: DescriptorFlags
pub const KERNEL_CODE32: DescriptorFlags
A flat 32-bit kernel code segment
pub const KERNEL_CODE64: DescriptorFlags
pub const KERNEL_CODE64: DescriptorFlags
A 64-bit kernel code segment
pub const USER_DATA: DescriptorFlags
pub const USER_DATA: DescriptorFlags
A user data segment (64-bit or flat 32-bit)
pub const USER_CODE32: DescriptorFlags
pub const USER_CODE32: DescriptorFlags
A flat 32-bit user code segment
pub const USER_CODE64: DescriptorFlags
pub const USER_CODE64: DescriptorFlags
A 64-bit user code segment
Trait Implementations§
§impl Binary for DescriptorFlags
impl Binary for DescriptorFlags
§impl BitAnd for DescriptorFlags
impl BitAnd for DescriptorFlags
§fn bitand(self, other: DescriptorFlags) -> DescriptorFlags
fn bitand(self, other: DescriptorFlags) -> DescriptorFlags
The bitwise and (&) of the bits in self and other.
§type Output = DescriptorFlags
type Output = DescriptorFlags
& operator.§impl BitAndAssign for DescriptorFlags
impl BitAndAssign for DescriptorFlags
§fn bitand_assign(&mut self, other: DescriptorFlags)
fn bitand_assign(&mut self, other: DescriptorFlags)
The bitwise and (&) of the bits in self and other.
§impl BitOr for DescriptorFlags
impl BitOr for DescriptorFlags
§fn bitor(self, other: DescriptorFlags) -> DescriptorFlags
fn bitor(self, other: DescriptorFlags) -> DescriptorFlags
The bitwise or (|) of the bits in self and other.
§type Output = DescriptorFlags
type Output = DescriptorFlags
| operator.§impl BitOrAssign for DescriptorFlags
impl BitOrAssign for DescriptorFlags
§fn bitor_assign(&mut self, other: DescriptorFlags)
fn bitor_assign(&mut self, other: DescriptorFlags)
The bitwise or (|) of the bits in self and other.
§impl BitXor for DescriptorFlags
impl BitXor for DescriptorFlags
§fn bitxor(self, other: DescriptorFlags) -> DescriptorFlags
fn bitxor(self, other: DescriptorFlags) -> DescriptorFlags
The bitwise exclusive-or (^) of the bits in self and other.
§type Output = DescriptorFlags
type Output = DescriptorFlags
^ operator.§impl BitXorAssign for DescriptorFlags
impl BitXorAssign for DescriptorFlags
§fn bitxor_assign(&mut self, other: DescriptorFlags)
fn bitxor_assign(&mut self, other: DescriptorFlags)
The bitwise exclusive-or (^) of the bits in self and other.
§impl Clone for DescriptorFlags
impl Clone for DescriptorFlags
§fn clone(&self) -> DescriptorFlags
fn clone(&self) -> DescriptorFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DescriptorFlags
§impl Debug for DescriptorFlags
impl Debug for DescriptorFlags
impl Eq for DescriptorFlags
§impl Extend<DescriptorFlags> for DescriptorFlags
impl Extend<DescriptorFlags> for DescriptorFlags
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = DescriptorFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = DescriptorFlags>,
The bitwise or (|) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)§impl Flags for DescriptorFlags
impl Flags for DescriptorFlags
§const FLAGS: &'static [Flag<DescriptorFlags>]
const FLAGS: &'static [Flag<DescriptorFlags>]
§fn from_bits_retain(bits: u64) -> DescriptorFlags
fn from_bits_retain(bits: u64) -> DescriptorFlags
§fn all_named() -> DescriptorFlags
fn all_named() -> DescriptorFlags
§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self> ⓘ
fn iter_names(&self) -> IterNames<Self> ⓘ
§fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
Self::FLAGS].§fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in self and other.§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in self and other.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert] when value is true or [Flags::remove] when value is false.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in self and other.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in self and other.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in self, truncating the result.§impl FromIterator<DescriptorFlags> for DescriptorFlags
impl FromIterator<DescriptorFlags> for DescriptorFlags
§fn from_iter<T>(iterator: T) -> DescriptorFlagswhere
T: IntoIterator<Item = DescriptorFlags>,
fn from_iter<T>(iterator: T) -> DescriptorFlagswhere
T: IntoIterator<Item = DescriptorFlags>,
The bitwise or (|) of the bits in each flags value.
§impl Hash for DescriptorFlags
impl Hash for DescriptorFlags
§impl IntoIterator for DescriptorFlags
impl IntoIterator for DescriptorFlags
§type Item = DescriptorFlags
type Item = DescriptorFlags
§type IntoIter = Iter<DescriptorFlags>
type IntoIter = Iter<DescriptorFlags>
§fn into_iter(self) -> <DescriptorFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <DescriptorFlags as IntoIterator>::IntoIter
§impl LowerHex for DescriptorFlags
impl LowerHex for DescriptorFlags
§impl Not for DescriptorFlags
impl Not for DescriptorFlags
§fn not(self) -> DescriptorFlags
fn not(self) -> DescriptorFlags
The bitwise negation (!) of the bits in self, truncating the result.
§type Output = DescriptorFlags
type Output = DescriptorFlags
! operator.§impl Octal for DescriptorFlags
impl Octal for DescriptorFlags
§impl Ord for DescriptorFlags
impl Ord for DescriptorFlags
§fn cmp(&self, other: &DescriptorFlags) -> Ordering
fn cmp(&self, other: &DescriptorFlags) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for DescriptorFlags
impl PartialEq for DescriptorFlags
§impl PartialOrd for DescriptorFlags
impl PartialOrd for DescriptorFlags
impl StructuralPartialEq for DescriptorFlags
§impl Sub for DescriptorFlags
impl Sub for DescriptorFlags
§fn sub(self, other: DescriptorFlags) -> DescriptorFlags
fn sub(self, other: DescriptorFlags) -> DescriptorFlags
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
§type Output = DescriptorFlags
type Output = DescriptorFlags
- operator.§impl SubAssign for DescriptorFlags
impl SubAssign for DescriptorFlags
§fn sub_assign(&mut self, other: DescriptorFlags)
fn sub_assign(&mut self, other: DescriptorFlags)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Auto Trait Implementations§
impl Freeze for DescriptorFlags
impl RefUnwindSafe for DescriptorFlags
impl Send for DescriptorFlags
impl Sync for DescriptorFlags
impl Unpin for DescriptorFlags
impl UnsafeUnpin for DescriptorFlags
impl UnwindSafe for DescriptorFlags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more