From 7af152ed229aab6f62b1a03243ffec779355e767 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 10 Jan 2017 16:15:39 -0600 Subject: [PATCH] firmware: pass spawner around instead of scheduler --- artiq/firmware/runtime/lib.rs | 2 +- artiq/firmware/runtime/rtio_mgt.rs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/artiq/firmware/runtime/lib.rs b/artiq/firmware/runtime/lib.rs index 71d215814..b7316b35c 100644 --- a/artiq/firmware/runtime/lib.rs +++ b/artiq/firmware/runtime/lib.rs @@ -129,7 +129,7 @@ pub unsafe extern fn rust_main() { network_init(); let mut scheduler = sched::Scheduler::new(); - rtio_mgt::startup(&scheduler); + rtio_mgt::startup(scheduler.spawner()); scheduler.spawner().spawn(16384, session::thread); #[cfg(has_rtio_moninj)] scheduler.spawner().spawn(4096, moninj::thread); diff --git a/artiq/firmware/runtime/rtio_mgt.rs b/artiq/firmware/runtime/rtio_mgt.rs index bc0d62e23..309f87fe6 100644 --- a/artiq/firmware/runtime/rtio_mgt.rs +++ b/artiq/firmware/runtime/rtio_mgt.rs @@ -1,6 +1,6 @@ use config; use board::csr; -use sched::Scheduler; +use sched::Spawner; #[cfg(has_rtio_crg)] pub mod crg { @@ -39,11 +39,11 @@ pub mod crg { #[cfg(has_drtio)] mod drtio { use board::csr; - use sched::{Scheduler, Waiter, Spawner}; + use sched::{Waiter, Spawner}; - pub fn startup(scheduler: &Scheduler) { - scheduler.spawner().spawn(4096, link_thread); - scheduler.spawner().spawn(4096, error_thread); + pub fn startup(spawner: &Spawner) { + spawner.spawn(4096, link_thread); + spawner.spawn(4096, error_thread); } fn link_is_up() -> bool { @@ -133,13 +133,13 @@ mod drtio { #[cfg(not(has_drtio))] mod drtio { - use sched::Scheduler; + use sched::Spawner; - pub fn startup(_scheduler: &Scheduler) {} + pub fn startup(_spawner: &Spawner) {} pub fn init() {} } -pub fn startup(scheduler: &Scheduler) { +pub fn startup(spawner: &Spawner) { crg::init(); let mut opt = [b'i']; @@ -165,7 +165,7 @@ pub fn startup(scheduler: &Scheduler) { warn!("fix clocking and reset the device"); } - drtio::startup(scheduler); + drtio::startup(spawner); init_core() }