mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-20 14:16:33 +00:00
feature: 增加early io remap的fixmap功能 (#495)
允许在内存管理初始化之前,使用fixmap功能,映射一些物理内存,并记录.
This commit is contained in:
@ -11,7 +11,7 @@ pub(super) mod init;
|
||||
|
||||
pub type PageMapper = crate::mm::page::PageMapper<RiscV64MMArch, LockedFrameAllocator>;
|
||||
|
||||
/// RiscV64的内存管理架构结构体
|
||||
/// RiscV64的内存管理架构结构体(sv39)
|
||||
#[derive(Debug, Clone, Copy, Hash)]
|
||||
pub struct RiscV64MMArch;
|
||||
|
||||
@ -53,6 +53,11 @@ impl MemoryManagementArch for RiscV64MMArch {
|
||||
|
||||
const USER_STACK_START: crate::mm::VirtAddr = VirtAddr::new(0x0000_001f_ffa0_0000);
|
||||
|
||||
/// 在距离sv39的顶端还有1G的位置,设置为FIXMAP的起始地址
|
||||
const FIXMAP_START_VADDR: VirtAddr = VirtAddr::new(0xffff_ffff_8000_0000);
|
||||
/// 设置1MB的fixmap空间
|
||||
const FIXMAP_SIZE: usize = 256 * 4096;
|
||||
|
||||
unsafe fn init() {
|
||||
todo!()
|
||||
}
|
||||
|
@ -115,6 +115,10 @@ impl MemoryManagementArch for X86_64MMArch {
|
||||
const USER_BRK_START: VirtAddr = VirtAddr::new(0x700000000000);
|
||||
const USER_STACK_START: VirtAddr = VirtAddr::new(0x6ffff0a00000);
|
||||
|
||||
const FIXMAP_START_VADDR: VirtAddr = VirtAddr::new(0xffffb00000000000);
|
||||
/// 设置FIXMAP区域大小为1M
|
||||
const FIXMAP_SIZE: usize = 256 * 4096;
|
||||
|
||||
/// @brief 获取物理内存区域
|
||||
unsafe fn init() {
|
||||
extern "C" {
|
||||
|
Reference in New Issue
Block a user