1pub const USER_STACK_SIZE: usize = 4096 * 2;
4pub const KERNEL_STACK_SIZE: usize = 4096 * 2;
5pub const KERNEL_HEAP_SIZE: usize = 0x30_0000;
6pub const PAGE_SIZE: usize = 0x1000;
7pub const PAGE_SIZE_BITS: usize = 0xc;
8
9pub const TRAMPOLINE: usize = usize::MAX - PAGE_SIZE + 1;
10pub const TRAP_CONTEXT: usize = TRAMPOLINE - PAGE_SIZE;
11pub fn kernel_stack_position(app_id: usize) -> (usize, usize) {
13 let top = TRAMPOLINE - app_id * (KERNEL_STACK_SIZE + PAGE_SIZE);
14 let bottom = top - KERNEL_STACK_SIZE;
15 (bottom, top)
16}
17
18pub use crate::board::{MEMORY_END, MMIO};