diff --git a/kernel/Makefile b/kernel/Makefile index 3513f3ff..e82a5bae 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -91,7 +91,7 @@ ifeq ($(BOARD), qemu) qemu_opts += \ -drive format=qcow2,file=$(USER_QCOW2),media=disk,cache=writeback,id=sfsimg,if=none \ -device ahci,id=ahci0 \ - -device ide-drive,drive=sfsimg,bus=ahci0.0 + -device ide-hd,drive=sfsimg,bus=ahci0.0 endif ifeq ($(PCI_PASSTHRU), ) qemu_net_opts += \ diff --git a/kernel/src/memory.rs b/kernel/src/memory.rs index 50927ef0..064186ed 100644 --- a/kernel/src/memory.rs +++ b/kernel/src/memory.rs @@ -21,7 +21,6 @@ use bitmap_allocator::BitAlloc; use buddy_system_allocator::Heap; use core::mem; use core::mem::size_of; -use lazy_static::*; use log::*; pub use rcore_memory::memory_set::{handler::*, MemoryArea, MemoryAttr}; use rcore_memory::*; diff --git a/kernel/src/sync/mutex.rs b/kernel/src/sync/mutex.rs index 590f0b33..21b210e4 100644 --- a/kernel/src/sync/mutex.rs +++ b/kernel/src/sync/mutex.rs @@ -147,14 +147,14 @@ impl Mutex { pub fn ensure_support(&self) { let initialization = self.support_initialization.load(Ordering::Relaxed); - if (initialization == 2) { + if initialization == 2 { return; }; - if (initialization == 1 + if initialization == 1 || self .support_initialization .compare_and_swap(0, 1, Ordering::Acquire) - != 0) + != 0 { // Wait for another thread to initialize while self.support_initialization.load(Ordering::Acquire) == 1 {