Struct GateDescriptor

Source
#[repr(transparent)]
struct GateDescriptor(u128);
Expand description

Raw value of a Gate Descriptor.

See Gate Descriptors section on AMD64 Architecture Programmer’s Manual Volume 2 for more details.

Tuple Fields§

§0: u128

Implementations§

Source§

impl GateDescriptor

Source

const OFFSET1_BITS: usize = 16usize

Source

const OFFSET1_OFFSET: usize = 0usize

Source

const SELECTOR_BITS: usize = 16usize

Source

const SELECTOR_OFFSET: usize = 16usize

Source

const IST_BITS: usize = 3usize

Source

const IST_OFFSET: usize = 32usize

Source

const TY_BITS: usize = 4usize

Source

const TY_OFFSET: usize = 40usize

Source

const DPL_BITS: usize = 2usize

Source

const DPL_OFFSET: usize = 45usize

Source

const P_BITS: usize = 1usize

Source

const P_OFFSET: usize = 47usize

Source

const OFFSET2_BITS: usize = 48usize

Source

const OFFSET2_OFFSET: usize = 48usize

Source

const fn new() -> Self

Creates a new default initialized bitfield.

Source

const fn from_bits(bits: u128) -> Self

Convert from bits.

Source

const fn into_bits(self) -> u128

Convert into bits.

Source

const fn offset1(&self) -> u16

Bits: 0..16

Source

const fn with_offset1_checked(self, value: u16) -> Result<Self, ()>

Bits: 0..16

Source

const fn with_offset1(self, value: u16) -> Self

Bits: 0..16

Source

const fn set_offset1(&mut self, value: u16)

Bits: 0..16

Source

const fn set_offset1_checked(&mut self, value: u16) -> Result<(), ()>

Bits: 0..16

Source

const fn selector(&self) -> SegmentSelector

Bits: 16..32

Source

const fn with_selector_checked(self, value: SegmentSelector) -> Result<Self, ()>

Bits: 16..32

Source

const fn with_selector(self, value: SegmentSelector) -> Self

Bits: 16..32

Source

const fn set_selector(&mut self, value: SegmentSelector)

Bits: 16..32

Source

const fn set_selector_checked( &mut self, value: SegmentSelector, ) -> Result<(), ()>

Bits: 16..32

Source

const fn ist(&self) -> u8

Bits: 32..35

Source

const fn with_ist_checked(self, value: u8) -> Result<Self, ()>

Bits: 32..35

Source

const fn with_ist(self, value: u8) -> Self

Bits: 32..35

Source

const fn set_ist(&mut self, value: u8)

Bits: 32..35

Source

const fn set_ist_checked(&mut self, value: u8) -> Result<(), ()>

Bits: 32..35

Source

const fn ty(&self) -> u8

Bits: 40..44

Source

const fn with_ty_checked(self, value: u8) -> Result<Self, ()>

Bits: 40..44

Source

const fn with_ty(self, value: u8) -> Self

Bits: 40..44

Source

const fn set_ty(&mut self, value: u8)

Bits: 40..44

Source

const fn set_ty_checked(&mut self, value: u8) -> Result<(), ()>

Bits: 40..44

Source

const fn dpl(&self) -> Dpl

Bits: 45..47

Source

const fn with_dpl_checked(self, value: Dpl) -> Result<Self, ()>

Bits: 45..47

Source

const fn with_dpl(self, value: Dpl) -> Self

Bits: 45..47

Source

const fn set_dpl(&mut self, value: Dpl)

Bits: 45..47

Source

const fn set_dpl_checked(&mut self, value: Dpl) -> Result<(), ()>

Bits: 45..47

Source

const fn p(&self) -> bool

Bits: 47..48

Source

const fn with_p_checked(self, value: bool) -> Result<Self, ()>

Bits: 47..48

Source

const fn with_p(self, value: bool) -> Self

Bits: 47..48

Source

const fn set_p(&mut self, value: bool)

Bits: 47..48

Source

const fn set_p_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 47..48

Source

const fn offset2(&self) -> u64

Bits: 48..96

Source

const fn with_offset2_checked(self, value: u64) -> Result<Self, ()>

Bits: 48..96

Source

const fn with_offset2(self, value: u64) -> Self

Bits: 48..96

Source

const fn set_offset2(&mut self, value: u64)

Bits: 48..96

Source

const fn set_offset2_checked(&mut self, value: u64) -> Result<(), ()>

Bits: 48..96

Trait Implementations§

Source§

impl Clone for GateDescriptor

Source§

fn clone(&self) -> GateDescriptor

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GateDescriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GateDescriptor

Source§

fn default() -> Self

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

impl From<GateDescriptor> for u128

Source§

fn from(v: GateDescriptor) -> u128

Converts to this type from the input type.
Source§

impl From<u128> for GateDescriptor

Source§

fn from(v: u128) -> Self

Converts to this type from the input type.
Source§

impl Copy for GateDescriptor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.