MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / kernel_stack_position

Function kernel_stack_position

os/src/task/id.rs:64–68  ·  view source on GitHub ↗

Return (bottom, top) of a kernel stack in kernel space.

(kstack_id: usize)

Source from the content-addressed store, hash-verified

62
63/// Return (bottom, top) of a kernel stack in kernel space.
64pub fn kernel_stack_position(kstack_id: usize) -> (usize, usize) {
65 let top = TRAMPOLINE - kstack_id * (KERNEL_STACK_SIZE + PAGE_SIZE);
66 let bottom = top - KERNEL_STACK_SIZE;
67 (bottom, top)
68}
69
70pub struct KernelStack(pub usize);
71

Callers 3

kstack_allocFunction · 0.85
dropMethod · 0.85
get_topMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected