runtime: remove support for building without RTIO

This commit is contained in:
Sebastien Bourdeauducq 2018-09-10 23:09:02 +08:00
parent 19a14b68b1
commit 2fff96802b
3 changed files with 5 additions and 19 deletions

View File

@ -1,7 +1,6 @@
use kernel_proto as kern; use kernel_proto as kern;
use sched::{Io, Error as SchedError}; use sched::{Io, Error as SchedError};
use session::{kern_acknowledge, kern_send, Error}; use session::{kern_acknowledge, kern_send, Error};
#[cfg(has_rtio_core)]
use rtio_mgt; use rtio_mgt;
#[cfg(has_drtio)] #[cfg(has_drtio)]
@ -292,25 +291,21 @@ mod spi {
pub fn process_kern_hwreq(io: &Io, request: &kern::Message) -> Result<bool, Error<SchedError>> { pub fn process_kern_hwreq(io: &Io, request: &kern::Message) -> Result<bool, Error<SchedError>> {
match request { match request {
#[cfg(has_rtio_core)]
&kern::RtioInitRequest => { &kern::RtioInitRequest => {
info!("resetting RTIO"); info!("resetting RTIO");
rtio_mgt::init_core(false); rtio_mgt::init_core(false);
kern_acknowledge() kern_acknowledge()
} }
#[cfg(has_rtio_core)]
&kern::DrtioLinkStatusRequest { linkno } => { &kern::DrtioLinkStatusRequest { linkno } => {
let up = rtio_mgt::drtio::link_up(linkno); let up = rtio_mgt::drtio::link_up(linkno);
kern_send(io, &kern::DrtioLinkStatusReply { up: up }) kern_send(io, &kern::DrtioLinkStatusReply { up: up })
} }
#[cfg(has_rtio_core)]
&kern::DrtioPacketCountRequest { linkno } => { &kern::DrtioPacketCountRequest { linkno } => {
let (tx_cnt, rx_cnt) = rtio_mgt::drtio_dbg::get_packet_counts(linkno); let (tx_cnt, rx_cnt) = rtio_mgt::drtio_dbg::get_packet_counts(linkno);
kern_send(io, &kern::DrtioPacketCountReply { tx_cnt: tx_cnt, rx_cnt: rx_cnt }) kern_send(io, &kern::DrtioPacketCountReply { tx_cnt: tx_cnt, rx_cnt: rx_cnt })
} }
#[cfg(has_rtio_core)]
&kern::DrtioBufferSpaceReqCountRequest { linkno } => { &kern::DrtioBufferSpaceReqCountRequest { linkno } => {
let cnt = rtio_mgt::drtio_dbg::get_buffer_space_req_count(linkno); let cnt = rtio_mgt::drtio_dbg::get_buffer_space_req_count(linkno);
kern_send(io, &kern::DrtioBufferSpaceReqCountReply { cnt: cnt }) kern_send(io, &kern::DrtioBufferSpaceReqCountReply { cnt: cnt })

View File

@ -40,7 +40,6 @@ use proto_artiq::{mgmt_proto, moninj_proto, rpc_proto, session_proto, kernel_pro
#[cfg(has_rtio_analyzer)] #[cfg(has_rtio_analyzer)]
use proto_artiq::analyzer_proto; use proto_artiq::analyzer_proto;
#[cfg(has_rtio_core)]
mod rtio_mgt; mod rtio_mgt;
mod urc; mod urc;
@ -290,7 +289,6 @@ fn startup_ethernet() {
let mut scheduler = sched::Scheduler::new(); let mut scheduler = sched::Scheduler::new();
let io = scheduler.io(); let io = scheduler.io();
#[cfg(has_rtio_core)]
rtio_mgt::startup(&io); rtio_mgt::startup(&io);
io.spawn(4096, mgmt::thread); io.spawn(4096, mgmt::thread);

View File

@ -7,7 +7,6 @@ use board_misoc::{ident, cache, config};
use {mailbox, rpc_queue, kernel}; use {mailbox, rpc_queue, kernel};
use urc::Urc; use urc::Urc;
use sched::{ThreadHandle, Io, TcpListener, TcpStream, Error as SchedError}; use sched::{ThreadHandle, Io, TcpListener, TcpStream, Error as SchedError};
#[cfg(has_rtio_core)]
use rtio_mgt; use rtio_mgt;
use rtio_dma::Manager as DmaManager; use rtio_dma::Manager as DmaManager;
use cache::Cache; use cache::Cache;
@ -517,12 +516,9 @@ fn host_kernel_worker(io: &Io,
return Err(Error::WatchdogExpired(idx)) return Err(Error::WatchdogExpired(idx))
} }
#[cfg(has_rtio_core)] if !rtio_mgt::crg::check() {
{ host_write(stream, host::Reply::ClockFailure)?;
if !rtio_mgt::crg::check() { return Err(Error::ClockFailure)
host_write(stream, host::Reply::ClockFailure)?;
return Err(Error::ClockFailure)
}
} }
} }
@ -562,11 +558,8 @@ fn flash_kernel_worker(io: &Io,
return Err(Error::WatchdogExpired(idx)) return Err(Error::WatchdogExpired(idx))
} }
#[cfg(has_rtio_core)] if !rtio_mgt::crg::check() {
{ return Err(Error::ClockFailure)
if !rtio_mgt::crg::check() {
return Err(Error::ClockFailure)
}
} }
io.relinquish()? io.relinquish()?