Revert "新的内存管理模块 (#301)" (#302)

This reverts commit d8ad0a5e77.
This commit is contained in:
LoGin
2023-07-22 16:24:55 +08:00
committed by GitHub
parent d8ad0a5e77
commit bb5f098a86
124 changed files with 5151 additions and 8278 deletions

View File

@ -41,14 +41,14 @@ impl InterruptArch for X86_64InterruptArch {
fn is_irq_enabled() -> bool {
let rflags: u64;
unsafe {
asm!("pushfq; pop {}", out(reg) rflags, options(nomem, preserves_flags));
asm!("pushfq; pop {}", out(reg) rflags);
}
return rflags & (1 << 9) != 0;
}
unsafe fn save_and_disable_irq() -> IrqFlagsGuard {
compiler_fence(Ordering::SeqCst);
let rflags = local_irq_save();
let rflags = local_irq_save() as u64;
let flags = IrqFlags::new(rflags);
let guard = IrqFlagsGuard::new(flags);
compiler_fence(Ordering::SeqCst);
@ -57,7 +57,7 @@ impl InterruptArch for X86_64InterruptArch {
unsafe fn restore_irq(flags: IrqFlags) {
compiler_fence(Ordering::SeqCst);
local_irq_restore(flags.flags());
local_irq_restore(flags.flags() as usize);
compiler_fence(Ordering::SeqCst);
}
}