()
| 70 | pub struct KernelStack(pub usize); |
| 71 | |
| 72 | pub 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 | |
| 83 | impl Drop for KernelStack { |
| 84 | fn drop(&mut self) { |
no test coverage detected