runtime: fix warnings on nondrtio systems

This commit is contained in:
mwojcik 2022-03-29 10:04:39 +08:00
parent a79bef2243
commit 433a9cdaf1
2 changed files with 5 additions and 2 deletions

View File

@ -159,7 +159,7 @@ async fn write_exception_string(stream: &TcpStream, s: CSlice<'static, u8>) -> R
Ok(()) Ok(())
} }
async fn handle_run_kernel(stream: Option<&TcpStream>, control: &Rc<RefCell<kernel::Control>>, up_destinations: &Rc<RefCell<[bool; drtio_routing::DEST_COUNT]>>) -> Result<()> { async fn handle_run_kernel(stream: Option<&TcpStream>, control: &Rc<RefCell<kernel::Control>>, _up_destinations: &Rc<RefCell<[bool; drtio_routing::DEST_COUNT]>>) -> Result<()> {
control.borrow_mut().tx.async_send(kernel::Message::StartRequest).await; control.borrow_mut().tx.async_send(kernel::Message::StartRequest).await;
loop { loop {
let reply = control.borrow_mut().rx.async_recv().await; let reply = control.borrow_mut().rx.async_recv().await;
@ -290,8 +290,9 @@ async fn handle_run_kernel(stream: Option<&TcpStream>, control: &Rc<RefCell<kern
let result = DMA_RECORD_STORE.lock().get(&name).map(|v| v.clone()); let result = DMA_RECORD_STORE.lock().get(&name).map(|v| v.clone());
control.borrow_mut().tx.async_send(kernel::Message::DmaGetReply(result)).await; control.borrow_mut().tx.async_send(kernel::Message::DmaGetReply(result)).await;
}, },
#[cfg(has_drtio)]
kernel::Message::UpDestinationsRequest(destination) => { kernel::Message::UpDestinationsRequest(destination) => {
let result = up_destinations.borrow()[destination as usize]; let result = _up_destinations.borrow()[destination as usize];
control.borrow_mut().tx.async_send(kernel::Message::UpDestinationsReply(result)).await; control.borrow_mut().tx.async_send(kernel::Message::UpDestinationsReply(result)).await;
} }
_ => { _ => {

View File

@ -48,7 +48,9 @@ pub enum Message {
DmaGetRequest(String), DmaGetRequest(String),
DmaGetReply(Option<(Vec<u8>, i64)>), DmaGetReply(Option<(Vec<u8>, i64)>),
#[cfg(has_drtio)]
UpDestinationsRequest(i32), UpDestinationsRequest(i32),
#[cfg(has_drtio)]
UpDestinationsReply(bool), UpDestinationsReply(bool),
} }