ahci内存越界问题修复+ mm的bug修复+在rust中解析acpi table (#384)

* bugfix: 修复了Flusher Drop的时候没有自动刷新TLB的bug

* 解决进程管理未初始化时,trap.c尝试打印pid导致错误的问题

* 设置kmalloc默认强制清0

* 修复ahci驱动的内存越界问题
* 修复mmio buddy忘记归还buddy block的问题
* 新增acpi模块,暂时能解析acpi tables
This commit is contained in:
LoGin
2023-09-17 15:41:01 +08:00
committed by GitHub
parent 1111099746
commit 7ae679ddd6
19 changed files with 234 additions and 92 deletions

View File

@ -803,7 +803,7 @@ impl<Arch, F: Debug> Debug for PageMapper<Arch, F> {
}
/// 页表刷新器的trait
pub trait Flusher<Arch> {
pub trait Flusher<Arch: MemoryManagementArch> {
/// 取消对指定的page flusher的刷新
fn consume(&mut self, flush: PageFlush<Arch>);
}
@ -811,7 +811,7 @@ pub trait Flusher<Arch> {
/// 用于刷新某个虚拟地址的刷新器。这个刷新器一经产生就必须调用flush()方法,
/// 否则会造成对页表的更改被忽略,这是不安全的
#[must_use = "The flusher must call the 'flush()', or the changes to page table will be unsafely ignored."]
pub struct PageFlush<Arch> {
pub struct PageFlush<Arch: MemoryManagementArch> {
virt: VirtAddr,
phantom: PhantomData<Arch>,
}
@ -834,6 +834,14 @@ impl<Arch: MemoryManagementArch> PageFlush<Arch> {
}
}
impl<Arch: MemoryManagementArch> Drop for PageFlush<Arch> {
fn drop(&mut self) {
unsafe {
MMArch::invalidate_page(self.virt);
}
}
}
/// 用于刷新整个页表的刷新器。这个刷新器一经产生就必须调用flush()方法,
/// 否则会造成对页表的更改被忽略,这是不安全的
#[must_use = "The flusher must call the 'flush()', or the changes to page table will be unsafely ignored."]