[][src]Struct x86_64::structures::gdt::DescriptorFlags

pub struct DescriptorFlags { /* fields omitted */ }

Flags for a GDT descriptor. Not all flags are valid for all descriptor types.

Implementations

impl DescriptorFlags[src]

pub const ACCESSED: DescriptorFlags[src]

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[src]

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[src]

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[src]

This flag must be set for code segments and unset for data segments.

pub const USER_SEGMENT: DescriptorFlags[src]

This flag must be set for user segments (in contrast to system segments).

pub const DPL_RING_3: DescriptorFlags[src]

The DPL for this descriptor is Ring 3. In 64-bit mode, ignored for data segments.

pub const PRESENT: DescriptorFlags[src]

Must be set for any segment, causes a segment not present exception if not set.

pub const AVAILABLE: DescriptorFlags[src]

Available for use by the Operating System

pub const LONG_MODE: DescriptorFlags[src]

Must be set for 64-bit code segments, unset otherwise.

pub const DEFAULT_SIZE: DescriptorFlags[src]

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[src]

Limit field is scaled by 4096 bytes. In 64-bit mode, ignored for all segments.

pub const LIMIT_0_15: DescriptorFlags[src]

Bits 0..=15 of the limit field (ignored in 64-bit mode)

pub const LIMIT_16_19: DescriptorFlags[src]

Bits 16..=19 of the limit field (ignored in 64-bit mode)

pub const BASE_0_23: DescriptorFlags[src]

Bits 0..=23 of the base field (ignored in 64-bit mode, except for fs and gs)

pub const BASE_24_31: DescriptorFlags[src]

Bits 24..=31 of the base field (ignored in 64-bit mode, except for fs and gs)

pub const fn empty() -> DescriptorFlags[src]

Returns an empty set of flags

pub const fn all() -> DescriptorFlags[src]

Returns the set containing all flags.

pub const fn bits(&self) -> u64[src]

Returns the raw value of the flags currently stored.

pub fn from_bits(bits: u64) -> Option<DescriptorFlags>[src]

Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.

pub const fn from_bits_truncate(bits: u64) -> DescriptorFlags[src]

Convert from underlying bit representation, dropping any bits that do not correspond to flags.

pub const unsafe fn from_bits_unchecked(bits: u64) -> DescriptorFlags[src]

Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).

pub const fn is_empty(&self) -> bool[src]

Returns true if no flags are currently stored.

pub const fn is_all(&self) -> bool[src]

Returns true if all flags are currently set.

pub const fn intersects(&self, other: DescriptorFlags) -> bool[src]

Returns true if there are flags common to both self and other.

pub const fn contains(&self, other: DescriptorFlags) -> bool[src]

Returns true all of the flags in other are contained within self.

pub fn insert(&mut self, other: DescriptorFlags)[src]

Inserts the specified flags in-place.

pub fn remove(&mut self, other: DescriptorFlags)[src]

Removes the specified flags in-place.

pub fn toggle(&mut self, other: DescriptorFlags)[src]

Toggles the specified flags in-place.

pub fn set(&mut self, other: DescriptorFlags, value: bool)[src]

Inserts or removes the specified flags depending on the passed value.

impl DescriptorFlags[src]

The following constants define default values for common GDT entries. They are all "flat" segments, meaning they can access the entire address space. These values all set WRITABLE and ACCESSED. They also match the values loaded by the syscall/sysret and sysenter/sysexit instructions.

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: Self[src]

A kernel data segment (64-bit or flat 32-bit)

pub const KERNEL_CODE32: Self[src]

A flat 32-bit kernel code segment

pub const KERNEL_CODE64: Self[src]

A 64-bit kernel code segment

pub const USER_DATA: Self[src]

A user data segment (64-bit or flat 32-bit)

pub const USER_CODE32: Self[src]

A flat 32-bit user code segment

pub const USER_CODE64: Self[src]

A 64-bit user code segment

Trait Implementations

impl Binary for DescriptorFlags[src]

impl BitAnd<DescriptorFlags> for DescriptorFlags[src]

type Output = DescriptorFlags

The resulting type after applying the & operator.

fn bitand(self, other: DescriptorFlags) -> DescriptorFlags[src]

Returns the intersection between the two sets of flags.

impl BitAndAssign<DescriptorFlags> for DescriptorFlags[src]

fn bitand_assign(&mut self, other: DescriptorFlags)[src]

Disables all flags disabled in the set.

impl BitOr<DescriptorFlags> for DescriptorFlags[src]

type Output = DescriptorFlags

The resulting type after applying the | operator.

fn bitor(self, other: DescriptorFlags) -> DescriptorFlags[src]

Returns the union of the two sets of flags.

impl BitOrAssign<DescriptorFlags> for DescriptorFlags[src]

fn bitor_assign(&mut self, other: DescriptorFlags)[src]

Adds the set of flags.

impl BitXor<DescriptorFlags> for DescriptorFlags[src]

type Output = DescriptorFlags

The resulting type after applying the ^ operator.

fn bitxor(self, other: DescriptorFlags) -> DescriptorFlags[src]

Returns the left flags, but with all the right flags toggled.

impl BitXorAssign<DescriptorFlags> for DescriptorFlags[src]

fn bitxor_assign(&mut self, other: DescriptorFlags)[src]

Toggles the set of flags.

impl Clone for DescriptorFlags[src]

impl Copy for DescriptorFlags[src]

impl Debug for DescriptorFlags[src]

impl Eq for DescriptorFlags[src]

impl Extend<DescriptorFlags> for DescriptorFlags[src]

impl FromIterator<DescriptorFlags> for DescriptorFlags[src]

impl Hash for DescriptorFlags[src]

impl LowerHex for DescriptorFlags[src]

impl Not for DescriptorFlags[src]

type Output = DescriptorFlags

The resulting type after applying the ! operator.

fn not(self) -> DescriptorFlags[src]

Returns the complement of this set of flags.

impl Octal for DescriptorFlags[src]

impl Ord for DescriptorFlags[src]

impl PartialEq<DescriptorFlags> for DescriptorFlags[src]

impl PartialOrd<DescriptorFlags> for DescriptorFlags[src]

impl StructuralEq for DescriptorFlags[src]

impl StructuralPartialEq for DescriptorFlags[src]

impl Sub<DescriptorFlags> for DescriptorFlags[src]

type Output = DescriptorFlags

The resulting type after applying the - operator.

fn sub(self, other: DescriptorFlags) -> DescriptorFlags[src]

Returns the set difference of the two sets of flags.

impl SubAssign<DescriptorFlags> for DescriptorFlags[src]

fn sub_assign(&mut self, other: DescriptorFlags)[src]

Disables all flags enabled in the set.

impl UpperHex for DescriptorFlags[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.