#[repr(packed)]
pub struct Descriptor { pub lower: u32, pub upper: u32, }
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: u32upper: u32

Implementations

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

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

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.

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

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

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.

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

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.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.