pub struct ThreadStack {
pub bottom: VirtualAddress,
pub top: VirtualAddress,
pub sp: VirtualAddress,
pub guard_size: usize,
}Expand description
Stack management for threads
Fields§
§bottom: VirtualAddressStack bottom (lowest address)
top: VirtualAddressStack top (highest address)
sp: VirtualAddressCurrent stack pointer
guard_size: usizeGuard page size
Implementations§
Source§impl ThreadStack
impl ThreadStack
Sourcepub fn new(size: usize) -> Result<Self, KernelError>
pub fn new(size: usize) -> Result<Self, KernelError>
Create a new thread stack
Sourcepub fn usable_size(&self) -> usize
pub fn usable_size(&self) -> usize
Get usable stack size (excluding guard page)
Sourcepub fn contains(&self, addr: VirtualAddress) -> bool
pub fn contains(&self, addr: VirtualAddress) -> bool
Check if address is within stack
Sourcepub fn in_guard_page(&self, addr: VirtualAddress) -> bool
pub fn in_guard_page(&self, addr: VirtualAddress) -> bool
Check if address is in guard page