Move denali to new thread spawn
This commit is contained in:
parent
c4613cf87f
commit
79e1ea2791
3 changed files with 42 additions and 57 deletions
|
|
@ -3,9 +3,10 @@
|
|||
|
||||
extern crate alloc;
|
||||
|
||||
use mammoth::{define_entry, zion::z_err_t};
|
||||
use alloc::sync::Arc;
|
||||
use mammoth::{define_entry, sync::Mutex, zion::z_err_t};
|
||||
|
||||
use denali::ahci::AhciController;
|
||||
use denali::ahci::{spawn_irq_thread, AhciController};
|
||||
|
||||
define_entry!();
|
||||
|
||||
|
|
@ -19,12 +20,13 @@ extern "C" fn main() -> z_err_t {
|
|||
.get_ahci_info()
|
||||
.expect("Failed to get ahci info");
|
||||
|
||||
let ahci_controller = AhciController::new(
|
||||
let ahci_controller = Arc::new(Mutex::new(AhciController::new(
|
||||
mammoth::mem::MemoryRegion::from_cap(mammoth::cap::Capability::take(ahci_info.ahci_region))
|
||||
.unwrap(),
|
||||
);
|
||||
)));
|
||||
|
||||
ahci_controller.join().unwrap();
|
||||
let thread = spawn_irq_thread(ahci_controller.clone());
|
||||
|
||||
thread.join();
|
||||
0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue