⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ThreadStack

Struct ThreadStack 

Source
pub struct ThreadStack {
    pub bottom: VirtualAddress,
    pub top: VirtualAddress,
    pub sp: VirtualAddress,
    pub guard_size: usize,
}
Expand description

Stack management for threads

Fields§

§bottom: VirtualAddress

Stack bottom (lowest address)

§top: VirtualAddress

Stack top (highest address)

§sp: VirtualAddress

Current stack pointer

§guard_size: usize

Guard page size

Implementations§

Source§

impl ThreadStack

Source

pub fn new(size: usize) -> Result<Self, KernelError>

Create a new thread stack

Source

pub fn usable_size(&self) -> usize

Get usable stack size (excluding guard page)

Source

pub fn contains(&self, addr: VirtualAddress) -> bool

Check if address is within stack

Source

pub fn in_guard_page(&self, addr: VirtualAddress) -> bool

Check if address is in guard page

Auto Trait Implementations§

§

impl Freeze for ThreadStack

§

impl RefUnwindSafe for ThreadStack

§

impl Send for ThreadStack

§

impl Sync for ThreadStack

§

impl Unpin for ThreadStack

§

impl UnwindSafe for ThreadStack

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 = Infallible

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

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

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.