mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-20 22:36:31 +00:00
使得DragonOS kernel 能为riscv64编译通过(尚未能启动) (#457)
* 使得DragonOS kernel 能为riscv64编译通过(尚未能启动) * 修正了系统调用号声明不正确的问题,同时添加了编译配置文档
This commit is contained in:
@ -6,7 +6,6 @@ use alloc::vec::Vec;
|
||||
use hashbrown::HashMap;
|
||||
|
||||
use crate::{
|
||||
arch::mm::LowAddressRemapping,
|
||||
include::bindings::bindings::{gfp_t, PAGE_U_S},
|
||||
kerror,
|
||||
libs::{align::page_align_up, spinlock::SpinLock},
|
||||
@ -120,12 +119,6 @@ pub unsafe extern "C" fn kfree(vaddr: usize) -> usize {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn rs_unmap_at_low_addr() -> usize {
|
||||
LowAddressRemapping::unmap_at_low_address(true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// @brief 创建一块mmio区域,并将vma绑定到initial_mm
|
||||
///
|
||||
/// @param size mmio区域的大小(字节)
|
||||
|
@ -150,6 +150,7 @@ extern char _bss;
|
||||
extern char _ebss;
|
||||
extern char _end;
|
||||
|
||||
#if ARCH(I386) || ARCH(X86_64)
|
||||
/**
|
||||
* @brief 读取CR3寄存器的值(存储了页目录的基地址)
|
||||
*
|
||||
@ -163,6 +164,8 @@ unsigned long *get_CR3()
|
||||
return tmp;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* vm_area_struct中的vm_flags的可选值
|
||||
* 对应的结构体请见mm-types.h
|
||||
|
@ -480,7 +480,7 @@ impl MmioBuddyMemPool {
|
||||
return Err(SystemError::EPERM);
|
||||
}
|
||||
// 计算前导0
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
#[cfg(any(target_arch = "x86_64", target_arch = "riscv64"))]
|
||||
let mut size_exp: u32 = 63 - size.leading_zeros();
|
||||
// kdebug!("create_mmio: size_exp: {}", size_exp);
|
||||
// 记录最终申请的空间大小
|
||||
|
@ -149,6 +149,7 @@ impl InnerAddressSpace {
|
||||
/// # Returns
|
||||
///
|
||||
/// 返回克隆后的,新的地址空间的Arc指针
|
||||
#[inline(never)]
|
||||
pub fn try_clone(&mut self) -> Result<Arc<AddressSpace>, SystemError> {
|
||||
let irq_guard = unsafe { CurrentIrqArch::save_and_disable_irq() };
|
||||
let new_addr_space = AddressSpace::new(false)?;
|
||||
|
Reference in New Issue
Block a user