Move AHCI controller to async.

This commit is contained in:
Drew Galbraith 2025-02-01 01:29:26 -08:00
parent c97d39c36b
commit caa1b9c952
3 changed files with 191 additions and 127 deletions

View file

@ -4,9 +4,14 @@
extern crate alloc;
use alloc::sync::Arc;
use mammoth::{define_entry, sync::Mutex, zion::z_err_t};
use mammoth::{
define_entry,
sync::Mutex,
task::{Executor, Task},
zion::z_err_t,
};
use denali::ahci::{spawn_irq_thread, AhciController};
use denali::ahci::{identify_ports, spawn_irq_thread, AhciController};
define_entry!();
@ -24,8 +29,14 @@ extern "C" fn main() -> z_err_t {
ahci_info.ahci_region,
)));
let mut executor = Executor::new();
executor.spawn(Task::new(identify_ports(ahci_controller.clone())));
let thread = spawn_irq_thread(ahci_controller.clone());
executor.run();
thread.join().expect("Failed to wait on irq thread.");
0
}