forked from M-Labs/artiq
1
0
Fork 0

firmware: pass spawner around instead of scheduler

This commit is contained in:
Sebastien Bourdeauducq 2017-01-10 16:15:39 -06:00
parent d3d23d0d3b
commit 7af152ed22
2 changed files with 10 additions and 10 deletions

View File

@ -129,7 +129,7 @@ pub unsafe extern fn rust_main() {
network_init(); network_init();
let mut scheduler = sched::Scheduler::new(); let mut scheduler = sched::Scheduler::new();
rtio_mgt::startup(&scheduler); rtio_mgt::startup(scheduler.spawner());
scheduler.spawner().spawn(16384, session::thread); scheduler.spawner().spawn(16384, session::thread);
#[cfg(has_rtio_moninj)] #[cfg(has_rtio_moninj)]
scheduler.spawner().spawn(4096, moninj::thread); scheduler.spawner().spawn(4096, moninj::thread);

View File

@ -1,6 +1,6 @@
use config; use config;
use board::csr; use board::csr;
use sched::Scheduler; use sched::Spawner;
#[cfg(has_rtio_crg)] #[cfg(has_rtio_crg)]
pub mod crg { pub mod crg {
@ -39,11 +39,11 @@ pub mod crg {
#[cfg(has_drtio)] #[cfg(has_drtio)]
mod drtio { mod drtio {
use board::csr; use board::csr;
use sched::{Scheduler, Waiter, Spawner}; use sched::{Waiter, Spawner};
pub fn startup(scheduler: &Scheduler) { pub fn startup(spawner: &Spawner) {
scheduler.spawner().spawn(4096, link_thread); spawner.spawn(4096, link_thread);
scheduler.spawner().spawn(4096, error_thread); spawner.spawn(4096, error_thread);
} }
fn link_is_up() -> bool { fn link_is_up() -> bool {
@ -133,13 +133,13 @@ mod drtio {
#[cfg(not(has_drtio))] #[cfg(not(has_drtio))]
mod drtio { mod drtio {
use sched::Scheduler; use sched::Spawner;
pub fn startup(_scheduler: &Scheduler) {} pub fn startup(_spawner: &Spawner) {}
pub fn init() {} pub fn init() {}
} }
pub fn startup(scheduler: &Scheduler) { pub fn startup(spawner: &Spawner) {
crg::init(); crg::init();
let mut opt = [b'i']; let mut opt = [b'i'];
@ -165,7 +165,7 @@ pub fn startup(scheduler: &Scheduler) {
warn!("fix clocking and reset the device"); warn!("fix clocking and reset the device");
} }
drtio::startup(scheduler); drtio::startup(spawner);
init_core() init_core()
} }