another temporary

master
dzy 6 years ago
parent 0dbffbc0fa
commit ed3fb6d423

@ -1 +1 @@
Subproject commit 03033e9570079f85476280de4e155ef21d6c9e8b Subproject commit 82562ff04c4f269f6bf23eee363fb4e2b8536b8f

@ -181,7 +181,7 @@ ifeq ($(arch), riscv32)
$(shell rustc --print sysroot)/lib/rustlib/src/rust/src/libcore/sync/atomic.rs \ $(shell rustc --print sysroot)/lib/rustlib/src/rust/src/libcore/sync/atomic.rs \
src/arch/riscv32/atomic.patch src/arch/riscv32/atomic.patch
endif endif
@CC=$(cc) LOG=trace cargo xbuild $(build_args) @CC=$(cc) cargo xbuild $(build_args)
endif endif

@ -17,19 +17,19 @@ then
exit 1 exit 1
fi fi
if ! [[ ${RV32} = 1 ]]; then if [[ ${RV32} = 1 ]]; then
TARGET_ARCH=riscv32
COMPILER_RT_CFLAGS="-march=rv32ia -mabi=ilp32 -O3"
SFSIMG_CFLAGS="-march=rv32ia -mabi=ilp32"
RISCV_PK_CONFIGURE_FLAGS="--with-arch=rv32imac --disable-fp-emulation --host=riscv32-unknown-elf"
UCORE_USER_IMAGE="../user/img/ucore-rv32.img"
else
TARGET_ARCH=riscv64 TARGET_ARCH=riscv64
export LOG=trace export LOG=trace
COMPILER_RT_CFLAGS="-march=rv64ia -mabi=lp64 -O3" COMPILER_RT_CFLAGS="-march=rv64ia -mabi=lp64 -O3"
SFSIMG_CFLAGS="-march=rv64ia -mabi=lp64" SFSIMG_CFLAGS="-march=rv64ia -mabi=lp64"
RISCV_PK_CONFIGURE_FLAGS="--with-arch=rv64imac --disable-fp-emulation --host=riscv64-unknown-elf" RISCV_PK_CONFIGURE_FLAGS="--with-arch=rv64imac --disable-fp-emulation --host=riscv64-unknown-elf"
UCORE_USER_IMAGE="../user/img/ucore-riscv64.img" UCORE_USER_IMAGE="../user/img/ucore-riscv64.img"
else
TARGET_ARCH=riscv32
COMPILER_RT_CFLAGS="-march=rv32ia -mabi=ilp32 -O3"
SFSIMG_CFLAGS="-march=rv32ia -mabi=ilp32"
RISCV_PK_CONFIGURE_FLAGS="--with-arch=rv32imac --disable-fp-emulation --host=riscv32-unknown-elf"
UCORE_USER_IMAGE="../user/img/ucore-rv32.img"
fi fi
LLC=llc LLC=llc
RUST_SRC_PATH=$(rustc --print sysroot)/lib/rustlib/src/rust/src RUST_SRC_PATH=$(rustc --print sysroot)/lib/rustlib/src/rust/src

@ -12,8 +12,12 @@ pub const RECURSIVE_INDEX: usize = 0x1fd;
// root_table[0776] points to root_table itself as leaf page // root_table[0776] points to root_table itself as leaf page
#[cfg(target_arch = "riscv32")] #[cfg(target_arch = "riscv32")]
pub const KERNEL_P2_INDEX: usize = 0x8000_0000 >> 22; pub const KERN_VA_BASE: usize = 0;
#[cfg(target_arch = "riscv64")]
pub const KERN_VA_BASE: usize = 0xFFFF_FFFF_0000_0000;
#[cfg(target_arch = "riscv32")]
pub const KERNEL_P2_INDEX: usize = 0x8000_0000 >> 22;
#[cfg(feature = "board_k210")] #[cfg(feature = "board_k210")]
pub const KERNEL_HEAP_SIZE: usize = 0x0010_0000; pub const KERNEL_HEAP_SIZE: usize = 0x0010_0000;
#[cfg(not(feature = "board_k210"))] #[cfg(not(feature = "board_k210"))]

@ -3,7 +3,7 @@ use riscv::{addr::*, register::sstatus};
use ucore_memory::PAGE_SIZE; use ucore_memory::PAGE_SIZE;
use log::*; use log::*;
use crate::memory::{active_table, FRAME_ALLOCATOR, init_heap, MemoryArea, MemoryAttr, MemorySet, MEMORY_ALLOCATOR}; use crate::memory::{active_table, FRAME_ALLOCATOR, init_heap, MemoryArea, MemoryAttr, MemorySet, MEMORY_ALLOCATOR};
use crate::consts::{MEMORY_OFFSET, MEMORY_END}; use crate::consts::{MEMORY_OFFSET, MEMORY_END, KERN_VA_BASE};
use riscv::register::satp; use riscv::register::satp;
#[cfg(feature = "no_mmu")] #[cfg(feature = "no_mmu")]
@ -48,7 +48,7 @@ fn init_frame_allocator() {
// TODO: delete debug code // TODO: delete debug code
let mut ba = FRAME_ALLOCATOR.lock(); let mut ba = FRAME_ALLOCATOR.lock();
let range = to_range((end as usize) - 0xFFFF_FFFF_0000_0000 + PAGE_SIZE, MEMORY_END); let range = to_range((end as usize) - KERN_VA_BASE + PAGE_SIZE, MEMORY_END);
info!("FrameAllocator insert {} .. {}", range.start, range.end); info!("FrameAllocator insert {} .. {}", range.start, range.end);
ba.insert(range); ba.insert(range);
info!("FrameAllocator init end"); info!("FrameAllocator init end");

@ -1 +1 @@
Subproject commit 11fe816ca3b7745268e9322c51cd115d6059654e Subproject commit f4ec45a908005331149af5816247dcb89fbd4654
Loading…
Cancel
Save