Run denali server thread.
This commit is contained in:
parent
10e536acab
commit
a5cdd23f0b
7 changed files with 104 additions and 19 deletions
|
|
@ -11,7 +11,8 @@ use mammoth::{
|
|||
zion::z_err_t,
|
||||
};
|
||||
|
||||
use denali::ahci::{identify_ports, spawn_irq_thread, AhciController};
|
||||
use denali::ahci::{self, identify_ports, spawn_irq_thread, AhciController};
|
||||
use denali::{denali_server::DenaliServerImpl, AsyncDenaliServer};
|
||||
|
||||
define_entry!();
|
||||
|
||||
|
|
@ -29,14 +30,25 @@ extern "C" fn main() -> z_err_t {
|
|||
ahci_info.ahci_region,
|
||||
)));
|
||||
|
||||
let mut executor = Executor::new();
|
||||
let executor = Arc::new(Mutex::new(Executor::new()));
|
||||
|
||||
executor.spawn(Task::new(identify_ports(ahci_controller.clone())));
|
||||
executor
|
||||
.clone()
|
||||
.lock()
|
||||
.spawn(Task::new(identify_ports(ahci_controller.clone())));
|
||||
|
||||
let thread = spawn_irq_thread(ahci_controller.clone());
|
||||
|
||||
executor.run();
|
||||
let denali_server =
|
||||
Arc::new(AsyncDenaliServer::new(DenaliServerImpl::new(ahci_controller.clone())).unwrap());
|
||||
|
||||
let server_thread = yunq::server::spawn_async_server_thread(denali_server, executor.clone());
|
||||
|
||||
executor.clone().lock().run();
|
||||
|
||||
thread.join().expect("Failed to wait on irq thread.");
|
||||
server_thread
|
||||
.join()
|
||||
.expect("Failed to wait on server thread.");
|
||||
0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue