mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-26 11:23:37 +04:00
40 lines
1.4 KiB
Rust
40 lines
1.4 KiB
Rust
pub const USER_STACK_SIZE: usize = 4096 * 2;
|
|
pub const KERNEL_STACK_SIZE: usize = 4096 * 2;
|
|
pub const KERNEL_HEAP_SIZE: usize = 0x20_0000;
|
|
pub const MEMORY_END: usize = 0x80800000;
|
|
pub const PAGE_SIZE: usize = 0x1000;
|
|
pub const PAGE_SIZE_BITS: usize = 0xc;
|
|
|
|
pub const TRAMPOLINE: usize = usize::MAX - PAGE_SIZE + 1;
|
|
pub const TRAP_CONTEXT: usize = TRAMPOLINE - PAGE_SIZE;
|
|
|
|
#[cfg(feature = "board_k210")]
|
|
pub const CLOCK_FREQ: usize = 403000000 / 62;
|
|
|
|
#[cfg(feature = "board_qemu")]
|
|
pub const CLOCK_FREQ: usize = 12500000;
|
|
|
|
#[cfg(feature = "board_qemu")]
|
|
pub const MMIO: &[(usize, usize)] = &[
|
|
(0x10000000, 0x10000),
|
|
];
|
|
|
|
#[cfg(feature = "board_k210")]
|
|
pub const MMIO: &[(usize, usize)] = &[
|
|
// we don't need clint in S priv when running
|
|
// we only need claim/complete for target0 after initializing
|
|
(0x0C00_0000, 0x3000), /* PLIC */
|
|
(0x0C20_0000, 0x1000), /* PLIC */
|
|
(0x3800_0000, 0x1000), /* UARTHS */
|
|
(0x3800_1000, 0x1000), /* GPIOHS */
|
|
(0x5020_0000, 0x1000), /* GPIO */
|
|
(0x5024_0000, 0x1000), /* SPI_SLAVE */
|
|
(0x502B_0000, 0x1000), /* FPIOA */
|
|
(0x502D_0000, 0x1000), /* TIMER0 */
|
|
(0x502E_0000, 0x1000), /* TIMER1 */
|
|
(0x502F_0000, 0x1000), /* TIMER2 */
|
|
(0x5044_0000, 0x1000), /* SYSCTL */
|
|
(0x5200_0000, 0x1000), /* SPI0 */
|
|
(0x5300_0000, 0x1000), /* SPI1 */
|
|
(0x5400_0000, 0x1000), /* SPI2 */
|
|
]; |