Struct x86::segmentation::Descriptor
source · [−]Expand description
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: u32
upper: u32
Implementations
sourceimpl Descriptor
impl Descriptor
pub const NULL: Descriptor = Descriptor { lower: 0, upper: 0 }
pub fn as_u64(&self) -> u64
sourcepub fn set_base_limit(&mut self, base: u32, limit: u32)
pub fn set_base_limit(&mut self, base: u32, limit: u32)
Create a new segment, TSS or LDT descriptor by setting the three base and two limit fields.
sourcepub fn set_selector_offset(&mut self, selector: SegmentSelector, offset: u32)
pub fn set_selector_offset(&mut self, selector: SegmentSelector, offset: u32)
Creates a new descriptor with selector and offset (for IDT Gate descriptors, e.g. Trap, Interrupts and Task gates)
sourcepub fn set_type(&mut self, typ: u8)
pub fn set_type(&mut self, typ: u8)
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.
sourcepub fn set_s(&mut self)
pub fn set_s(&mut self)
Specifies whether the segment descriptor is for a system segment (S flag is clear) or a code or data segment (S flag is set).
sourcepub fn set_dpl(&mut self, ring: Ring)
pub fn set_dpl(&mut self, ring: Ring)
Specifies the privilege level of the segment. The DPL is used to control access to the segment.
sourcepub fn set_p(&mut self)
pub fn set_p(&mut self)
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.
sourcepub fn set_l(&mut self)
pub fn set_l(&mut self)
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.
Trait Implementations
sourceimpl BuildDescriptor<Descriptor> for DescriptorBuilder
impl BuildDescriptor<Descriptor> for DescriptorBuilder
fn finish(&self) -> Descriptor
sourceimpl Clone for Descriptor
impl Clone for Descriptor
sourcefn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Descriptor
impl Debug for Descriptor
sourceimpl Default for Descriptor
impl Default for Descriptor
sourcefn default() -> Descriptor
fn default() -> Descriptor
Returns the “default value” for a type. Read more
sourceimpl Display for Descriptor
impl Display for Descriptor
impl Copy for Descriptor
Auto Trait Implementations
impl RefUnwindSafe for Descriptor
impl Send for Descriptor
impl Sync for Descriptor
impl Unpin for Descriptor
impl UnwindSafe for Descriptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more