pub trait Segment {
    // Required methods
    fn get_reg() -> SegmentSelector;
    unsafe fn set_reg(sel: SegmentSelector);
}
Expand description

An x86 segment

Segment registers on x86 are 16-bit SegmentSelectors, which index into the GlobalDescriptorTable. The corresponding GDT entry is used to configure the segment itself. Note that most segmentation functionality is disabled in 64-bit mode. See the individual segments for more information.

Required Methods§

source

fn get_reg() -> SegmentSelector

Returns the current value of the segment register.

source

unsafe fn set_reg(sel: SegmentSelector)

Reload the segment register. Depending on the segment, this may also reconfigure the corresponding segment.

Safety

This function is unsafe because the caller must ensure that sel is a valid segment descriptor, and that reconfiguring the segment will not cause undefined behavior.

Object Safety§

This trait is not object safe.

Implementors§