Skip to main content

GsInfo

Struct GsInfo 

Source
#[repr(C, align(64))]
pub struct GsInfo { self_ptr: AtomicU64, kernel_stack_top: AtomicU64, user_rsp: AtomicU64, }
Expand description

A per-CPU struct which each CPU’s GS kernel reg points to in order to handle syscall entry

Fields§

§self_ptr: AtomicU64§kernel_stack_top: AtomicU64§user_rsp: AtomicU64

Implementations§

Source§

impl GsInfo

Source

pub const fn new() -> Self

Construct a new zeroed instance of GsInfo

Source

pub unsafe fn init(&'static self)

Initialize the given GsInfo

§Safety

The caller must guarantee the following:

  • This method is called exactly once on the CPU which owns the given GsInfo
  • This method is called before the first jump to userspace on the CPU which owns the given GsInfo
Source

pub unsafe fn set_kernel_stack_top(&self, kernel_stack_top: VirtAddr)

Set the kernel stack top of the given GsInfo

§Safety

The caller must ensure that kernel_stack_top is a valid pointer to a valid, mapped kernel stack

Source

pub fn self_ptr(&self) -> u64

Getter for GsInfo::self_ptr

Source

pub fn kernel_stack_top(&self) -> u64

Getter for GsInfo::kernel_stack_top

Source

pub fn user_rsp(&self) -> u64

Getter for GsInfo::user_rsp

Auto Trait Implementations§

§

impl !Freeze for GsInfo

§

impl RefUnwindSafe for GsInfo

§

impl Send for GsInfo

§

impl Sync for GsInfo

§

impl Unpin for GsInfo

§

impl UnsafeUnpin for GsInfo

§

impl UnwindSafe for GsInfo

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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.
§

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

Performs the conversion.