mirror of
https://github.com/rcore-os/rCore.git
synced 2024-11-22 08:06:17 +04:00
Remove k210, until we are able to test on it again
This commit is contained in:
parent
433c28bc5b
commit
3aaaa28c41
@ -9,16 +9,10 @@ pub const KERNEL_OFFSET: usize = 0xC000_0000;
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
pub const KERNEL_OFFSET: usize = 0xFFFF_FFFF_C000_0000;
|
||||
|
||||
#[cfg(feature = "board_k210")]
|
||||
pub const KERNEL_HEAP_SIZE: usize = 0x0020_0000;
|
||||
#[cfg(not(feature = "board_k210"))]
|
||||
pub const KERNEL_HEAP_SIZE: usize = 0x0080_0000;
|
||||
|
||||
pub const MEMORY_OFFSET: usize = 0x8000_0000;
|
||||
// TODO: get memory end from device tree
|
||||
#[cfg(feature = "board_k210")]
|
||||
pub const MEMORY_END: usize = 0x8060_0000;
|
||||
#[cfg(not(feature = "board_k210"))]
|
||||
pub const MEMORY_END: usize = 0x8800_0000;
|
||||
|
||||
// FIXME: rv64 `sh` and `ls` will crash if stack top > 0x80000000 ???
|
||||
|
@ -91,11 +91,11 @@ fn page_fault(stval: usize, tf: &mut TrapFrame) {
|
||||
}
|
||||
|
||||
pub fn ack(irq: usize) {
|
||||
// TODO
|
||||
// Handled in PLIC driver
|
||||
}
|
||||
|
||||
pub fn enable_irq(irq: usize) {
|
||||
// TODO
|
||||
// Handled in PLIC driver
|
||||
}
|
||||
|
||||
pub fn get_trap_num(_context: &UserContext) -> usize {
|
||||
|
@ -9,8 +9,6 @@ use riscv::register::{satp, sstatus, stval};
|
||||
/// Initialize the memory management module
|
||||
pub fn init(dtb: usize) {
|
||||
// allow user memory access
|
||||
// NOTE: In K210 priv v1.9.1, sstatus.SUM is PUM which has opposite meaning!
|
||||
#[cfg(not(feature = "board_k210"))]
|
||||
unsafe {
|
||||
sstatus::set_sum();
|
||||
}
|
||||
|
@ -55,7 +55,6 @@ pub extern "C" fn rust_main(hartid: usize, device_tree_paddr: usize) -> ! {
|
||||
// FIXME: init driver on u540
|
||||
#[cfg(not(any(feature = "board_u540")))]
|
||||
crate::drivers::init(device_tree_vaddr);
|
||||
#[cfg(not(feature = "board_k210"))]
|
||||
unsafe {
|
||||
board::init_external_interrupt();
|
||||
}
|
||||
@ -84,10 +83,8 @@ const BOOT_HART_ID: usize = 1;
|
||||
|
||||
#[cfg(target_arch = "riscv32")]
|
||||
global_asm!(include_str!("boot/entry32.asm"));
|
||||
#[cfg(all(target_arch = "riscv64", not(feature = "board_k210")))]
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
global_asm!(include_str!("boot/entry64.asm"));
|
||||
#[cfg(feature = "board_k210")]
|
||||
global_asm!(include_str!("boot/entry_k210.asm"));
|
||||
|
||||
pub fn get_sp() -> usize {
|
||||
let sp: usize;
|
||||
|
@ -1,7 +1,6 @@
|
||||
//! Define the FrameAllocator for physical memory
|
||||
//! x86_64 -- 64GB
|
||||
//! AARCH64/MIPS/RV -- 1GB
|
||||
//! K210(rv64) -- 8MB
|
||||
//! NOTICE:
|
||||
//! type FrameAlloc = bitmap_allocator::BitAllocXXX
|
||||
//! KSTACK_SIZE -- 16KB
|
||||
@ -32,21 +31,14 @@ pub type MemorySet = rcore_memory::memory_set::MemorySet<PageTableImpl>;
|
||||
pub type FrameAlloc = bitmap_allocator::BitAlloc256M;
|
||||
|
||||
// RISCV, ARM, MIPS has 1G memory
|
||||
#[cfg(all(
|
||||
any(
|
||||
target_arch = "riscv32",
|
||||
target_arch = "riscv64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "mips"
|
||||
),
|
||||
not(feature = "board_k210")
|
||||
#[cfg(any(
|
||||
target_arch = "riscv32",
|
||||
target_arch = "riscv64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "mips"
|
||||
))]
|
||||
pub type FrameAlloc = bitmap_allocator::BitAlloc1M;
|
||||
|
||||
// K210 has 8M memory
|
||||
#[cfg(feature = "board_k210")]
|
||||
pub type FrameAlloc = bitmap_allocator::BitAlloc4K;
|
||||
|
||||
pub static FRAME_ALLOCATOR: SpinNoIrqLock<FrameAlloc> = SpinNoIrqLock::new(FrameAlloc::DEFAULT);
|
||||
|
||||
/// Convert physical address to virtual address
|
||||
|
Loading…
Reference in New Issue
Block a user