1
0
Fork 0

cargo fmt

This commit is contained in:
mwojcik 2023-10-09 11:50:47 +08:00
parent 7263862fd8
commit 8eb359ee42
4 changed files with 19 additions and 12 deletions

View File

@ -81,12 +81,12 @@ pub extern "C" fn await_message(id: u32, timeout: u64, min: u8, max: u8) {
match unsafe { KERNEL_CHANNEL_0TO1.as_mut().unwrap() }.recv() { match unsafe { KERNEL_CHANNEL_0TO1.as_mut().unwrap() }.recv() {
Message::SubkernelMsgRecvReply { Message::SubkernelMsgRecvReply {
status: SubkernelStatus::NoError, status: SubkernelStatus::NoError,
count count,
} => { } => {
if min > count || count > max { if min > count || count > max {
artiq_raise!("SubkernelError", "Received more or less arguments than required") artiq_raise!("SubkernelError", "Received more or less arguments than required")
} }
}, }
Message::SubkernelMsgRecvReply { Message::SubkernelMsgRecvReply {
status: SubkernelStatus::IncorrectState, status: SubkernelStatus::IncorrectState,
.. ..

View File

@ -463,7 +463,10 @@ async fn handle_run_kernel(
control control
.borrow_mut() .borrow_mut()
.tx .tx
.async_send(kernel::Message::SubkernelMsgRecvReply { status: status, count: count }) .async_send(kernel::Message::SubkernelMsgRecvReply {
status: status,
count: count,
})
.await; .await;
if let Ok(message) = message_received { if let Ok(message) = message_received {
// receive code almost identical to RPC recv, except we are not reading from a stream // receive code almost identical to RPC recv, except we are not reading from a stream

View File

@ -294,8 +294,14 @@ pub mod drtio {
match reply { match reply {
Ok(Packet::DestinationDownReply) => { Ok(Packet::DestinationDownReply) => {
destination_set_up(routing_table, up_destinations, destination, false).await; destination_set_up(routing_table, up_destinations, destination, false).await;
remote_dma::destination_changed(aux_mutex, routing_table, timer, destination, false) remote_dma::destination_changed(
.await; aux_mutex,
routing_table,
timer,
destination,
false,
)
.await;
subkernel::destination_changed(aux_mutex, routing_table, timer, destination, false) subkernel::destination_changed(aux_mutex, routing_table, timer, destination, false)
.await; .await;
} }
@ -327,11 +333,11 @@ pub mod drtio {
); );
unsafe { SEEN_ASYNC_ERRORS |= ASYNC_ERROR_BUSY }; unsafe { SEEN_ASYNC_ERRORS |= ASYNC_ERROR_BUSY };
} }
Ok(packet) => { Ok(packet) => match process_async_packets(aux_mutex, linkno, packet).await {
match process_async_packets(aux_mutex, linkno, packet).await { Some(packet) => {
Some(packet) => error!("[DEST#{}] received unexpected aux packet: {:?}", destination, packet), error!("[DEST#{}] received unexpected aux packet: {:?}", destination, packet)
None => continue
} }
None => continue,
}, },
Err(e) => error!("[DEST#{}] communication failed ({})", destination, e), Err(e) => error!("[DEST#{}] communication failed ({})", destination, e),
} }

View File

@ -118,9 +118,7 @@ fn process_aux_packet(
drtioaux::send(0, &drtioaux::Packet::ResetAck) drtioaux::send(0, &drtioaux::Packet::ResetAck)
} }
drtioaux::Packet::DestinationStatusRequest { drtioaux::Packet::DestinationStatusRequest { destination } => {
destination,
} => {
#[cfg(has_drtio_routing)] #[cfg(has_drtio_routing)]
let hop = _routing_table.0[destination as usize][*_rank as usize]; let hop = _routing_table.0[destination as usize][*_rank as usize];
#[cfg(not(has_drtio_routing))] #[cfg(not(has_drtio_routing))]