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

Function kstack_alloc

os/src/task/id.rs:72–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70pub struct KernelStack(pub usize);
71
72pub fn kstack_alloc() -> KernelStack {
73 let kstack_id = KSTACK_ALLOCATOR.exclusive_access().alloc();
74 let (kstack_bottom, kstack_top) = kernel_stack_position(kstack_id);
75 KERNEL_SPACE.exclusive_access().insert_framed_area(
76 kstack_bottom.into(),
77 kstack_top.into(),
78 MapPermission::R | MapPermission::W,
79 );
80 KernelStack(kstack_id)
81}
82
83impl Drop for KernelStack {
84 fn drop(&mut self) {

Callers 1

newMethod · 0.85

Calls 5

kernel_stack_positionFunction · 0.85
KernelStackClass · 0.85
exclusive_accessMethod · 0.80
insert_framed_areaMethod · 0.80
allocMethod · 0.45

Tested by

no test coverage detected