[][src]Struct x86::segmentation::Descriptor

#[repr(packed)]
pub struct Descriptor { pub lower: u32, pub upper: u32, }

Entry for IDT, GDT or LDT. Provides size and location of a segment.

See Intel 3a, Section 3.4.5 "Segment Descriptors", and Section 3.5.2

Fields

lower: u32upper: u32

Methods

impl Descriptor[src]

pub const NULL: Descriptor[src]

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

pub fn set_base_limit(&mut self, base: u32, limit: u32)[src]

Create a new segment, TSS or LDT descriptor by setting the three base and two limit fields.

pub fn set_selector_offset(&mut self, selector: SegmentSelector, offset: u32)[src]

Creates a new descriptor with selector and offset (for IDT Gate descriptors, e.g. Trap, Interrupts and Task gates)

pub fn set_type(&mut self, typ: u8)[src]

Set the type of the descriptor (bits 8-11). Indicates the segment or gate type and specifies the kinds of access that can be made to the segment and the direction of growth. The interpretation of this field depends on whether the descriptor type flag specifies an application (code or data) descriptor or a system descriptor.

pub fn set_s(&mut self)[src]

Specifies whether the segment descriptor is for a system segment (S flag is clear) or a code or data segment (S flag is set).

pub fn set_dpl(&mut self, ring: Ring)[src]

Specifies the privilege level of the segment. The DPL is used to control access to the segment.

pub fn set_p(&mut self)[src]

Set Present bit. Indicates whether the segment is present in memory (set) or not present (clear). If this flag is clear, the processor generates a segment-not-present exception (#NP) when a segment selector that points to the segment descriptor is loaded into a segment register.

pub fn set_avl(&mut self)[src]

Set AVL bit. System software can use this bit to store information.

pub fn set_l(&mut self)[src]

Set L In IA-32e mode, bit 21 of the second doubleword of the segment descriptor indicates whether a code segment contains native 64-bit code. A value of 1 indicates instructions in this code segment are executed in 64-bit mode. A value of 0 indicates the instructions in this code segment are executed in compatibility mode. If L-bit is set, then D-bit must be cleared.

pub fn set_db(&mut self)[src]

Set D/B. Performs different functions depending on whether the segment descriptor is an executable code segment, an expand-down data segment, or a stack segment.

pub fn set_g(&mut self)[src]

Set G bit Determines the scaling of the segment limit field. When the granularity flag is clear, the segment limit is interpreted in byte units; when flag is set, the segment limit is interpreted in 4-KByte units.

Trait Implementations

impl BuildDescriptor<Descriptor> for DescriptorBuilder[src]

impl Copy for Descriptor[src]

impl Clone for Descriptor[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Descriptor[src]

impl Debug for Descriptor[src]

impl Default for Descriptor[src]

Auto Trait Implementations

impl Send for Descriptor

impl Sync for Descriptor

Blanket Implementations

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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