pub struct Star;
Expand description

Syscall Register: STAR

Implementations§

source§

impl Star

source

pub fn read_raw() -> (u16, u16)

Available on crate feature instructions only.

Read the Ring 0 and Ring 3 segment bases. The remaining fields are ignored because they are not valid for long mode.

§Returns
  • Field 1 (SYSRET): The CS selector is set to this field + 16. SS.Sel is set to this field + 8. Because SYSRET always returns to CPL 3, the RPL bits 1:0 should be initialized to 11b.
  • Field 2 (SYSCALL): This field is copied directly into CS.Sel. SS.Sel is set to this field + 8. Because SYSCALL always switches to CPL 0, the RPL bits 33:32 should be initialized to 00b.
source

pub fn read( ) -> (SegmentSelector, SegmentSelector, SegmentSelector, SegmentSelector)

Available on crate feature instructions only.

Read the Ring 0 and Ring 3 segment bases. Returns

  • CS Selector SYSRET
  • SS Selector SYSRET
  • CS Selector SYSCALL
  • SS Selector SYSCALL
source

pub unsafe fn write_raw(sysret: u16, syscall: u16)

Available on crate feature instructions only.

Write the Ring 0 and Ring 3 segment bases. The remaining fields are ignored because they are not valid for long mode.

§Parameters
  • sysret: The CS selector is set to this field + 16. SS.Sel is set to this field + 8. Because SYSRET always returns to CPL 3, the RPL bits 1:0 should be initialized to 11b.
  • syscall: This field is copied directly into CS.Sel. SS.Sel is set to this field + 8. Because SYSCALL always switches to CPL 0, the RPL bits 33:32 should be initialized to 00b.
§Safety

Unsafe because this can cause system instability if passed in the wrong values for the fields.

source

pub fn write( cs_sysret: SegmentSelector, ss_sysret: SegmentSelector, cs_syscall: SegmentSelector, ss_syscall: SegmentSelector ) -> Result<(), InvalidStarSegmentSelectors>

Available on crate feature instructions only.

Write the Ring 0 and Ring 3 segment bases. The remaining fields are ignored because they are not valid for long mode. This function will fail if the segment selectors are not in the correct offset of each other or if the segment selectors do not have correct privileges.

source§

impl Star

source

pub const MSR: Msr = _

The underlying model specific register.

Trait Implementations§

source§

impl Debug for Star

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Star

§

impl RefUnwindSafe for Star

§

impl Send for Star

§

impl Sync for Star

§

impl Unpin for Star

§

impl UnwindSafe for Star

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.