diff --git a/src/libboard_artiq/src/cxp_camera_setup.rs b/src/libboard_artiq/src/cxp_camera_setup.rs index 79978a1b..39229e37 100644 --- a/src/libboard_artiq/src/cxp_camera_setup.rs +++ b/src/libboard_artiq/src/cxp_camera_setup.rs @@ -6,7 +6,7 @@ use log::debug; use crate::{cxp_ctrl::Error as CtrlErr, cxp_packet::{read_u32, read_u64, reset_tag, send_test_packet, write_bytes_no_ack, write_u32, write_u64}, - cxp_phys::{rx, tx, CXPSpeed}, + cxp_phys::{CXPSpeed, rx, tx}, pl::csr}; // Bootstrap registers address diff --git a/src/libboard_artiq/src/cxp_grabber.rs b/src/libboard_artiq/src/cxp_grabber.rs index 74d6458a..68ad3db7 100644 --- a/src/libboard_artiq/src/cxp_grabber.rs +++ b/src/libboard_artiq/src/cxp_grabber.rs @@ -3,7 +3,7 @@ use libcortex_a9::mutex::Mutex; use log::{error, info}; #[cfg(has_cxp_led)] -use crate::cxp_led::{update_led, LEDState}; +use crate::cxp_led::{LEDState, update_led}; use crate::{cxp_camera_setup::{camera_setup, discover_camera, master_channel_ready}, pl::csr}; diff --git a/src/libboard_artiq/src/cxp_packet.rs b/src/libboard_artiq/src/cxp_packet.rs index df40cacd..2ebb90c2 100644 --- a/src/libboard_artiq/src/cxp_packet.rs +++ b/src/libboard_artiq/src/cxp_packet.rs @@ -4,7 +4,7 @@ use byteorder::{ByteOrder, NetworkEndian}; use io::Cursor; use libboard_zynq::{time::Milliseconds, timer::GlobalTimer}; -use crate::{cxp_ctrl::{Error, RXCTRLPacket, TXCTRLPacket, CTRL_PACKET_MAXSIZE, DATA_MAXSIZE}, +use crate::{cxp_ctrl::{CTRL_PACKET_MAXSIZE, DATA_MAXSIZE, Error, RXCTRLPacket, TXCTRLPacket}, mem::mem, pl::csr}; diff --git a/src/libboard_artiq/src/drtioaux.rs b/src/libboard_artiq/src/drtioaux.rs index b522dada..66226ee3 100644 --- a/src/libboard_artiq/src/drtioaux.rs +++ b/src/libboard_artiq/src/drtioaux.rs @@ -2,11 +2,11 @@ use core::{arch::asm, slice}; use byteorder::NativeEndian; use core_io::{Error as IoError, ErrorKind as IoErrorKind}; -use io::{proto::{ProtoRead, ProtoWrite}, - Cursor}; +use io::{Cursor, + proto::{ProtoRead, ProtoWrite}}; use libboard_zynq::{time::Milliseconds, timer::GlobalTimer}; -pub use crate::drtioaux_proto::{Packet, MAX_PACKET}; +pub use crate::drtioaux_proto::{MAX_PACKET, Packet}; use crate::{drtioaux_proto::Error as ProtocolError, mem::mem::DRTIOAUX_MEM, pl::csr::DRTIOAUX}; #[derive(Debug)] diff --git a/src/libboard_artiq/src/drtioaux_async.rs b/src/libboard_artiq/src/drtioaux_async.rs index b4636c6d..7b595ab0 100644 --- a/src/libboard_artiq/src/drtioaux_async.rs +++ b/src/libboard_artiq/src/drtioaux_async.rs @@ -2,14 +2,14 @@ use core::slice; use byteorder::NativeEndian; use core_io::{Error as IoError, ErrorKind as IoErrorKind}; -use io::{proto::{ProtoRead, ProtoWrite}, - Cursor}; +use io::{Cursor, + proto::{ProtoRead, ProtoWrite}}; use libasync::{block_async, task}; use libboard_zynq::{time::Milliseconds, timer::GlobalTimer}; use void::Void; -pub use crate::drtioaux_proto::{Packet, MAX_PACKET}; -use crate::{drtioaux::{copy_work_buffer, has_rx_error, Error}, +pub use crate::drtioaux_proto::{MAX_PACKET, Packet}; +use crate::{drtioaux::{Error, copy_work_buffer, has_rx_error}, mem::mem::DRTIOAUX_MEM, pl::csr::DRTIOAUX}; diff --git a/src/libdyld/src/file.rs b/src/libdyld/src/file.rs index e67f5de8..24ca1f0a 100644 --- a/src/libdyld/src/file.rs +++ b/src/libdyld/src/file.rs @@ -2,7 +2,7 @@ use core::{mem, ops::{Deref, Range}, ptr}; -use super::{elf::*, Arch}; +use super::{Arch, elf::*}; fn read_unaligned(data: &[u8], offset: usize) -> Option { if data.len() < offset + mem::size_of::() { diff --git a/src/libdyld/src/image.rs b/src/libdyld/src/image.rs index f1270200..05f49f16 100644 --- a/src/libdyld/src/image.rs +++ b/src/libdyld/src/image.rs @@ -1,9 +1,9 @@ -use alloc::alloc::{alloc_zeroed, dealloc, Layout, LayoutError}; +use alloc::alloc::{Layout, LayoutError, alloc_zeroed, dealloc}; use core::{mem, ops::{Deref, DerefMut, Range}, slice}; -use super::{elf::*, Error}; +use super::{Error, elf::*}; pub struct DynamicSection { pub strtab: Range, diff --git a/src/libdyld/src/reloc.rs b/src/libdyld/src/reloc.rs index 90b21fde..17df325b 100644 --- a/src/libdyld/src/reloc.rs +++ b/src/libdyld/src/reloc.rs @@ -4,7 +4,7 @@ use libcortex_a9::{asm::{dsb, isb}, cache::{bpiall, dcci_slice, iciallu}}; use log::trace; -use super::{elf::*, image::Image, Arch, Error, Library}; +use super::{Arch, Error, Library, elf::*, image::Image}; pub trait Relocatable { fn offset(&self) -> usize; diff --git a/src/libksupport/src/cxp.rs b/src/libksupport/src/cxp.rs index 64ebe5f2..f9af1617 100644 --- a/src/libksupport/src/cxp.rs +++ b/src/libksupport/src/cxp.rs @@ -4,7 +4,7 @@ use core::fmt; use byteorder::{ByteOrder, NetworkEndian}; use cslice::CMutSlice; -use libboard_artiq::{cxp_ctrl::{Error as CtrlErr, DATA_MAXSIZE}, +use libboard_artiq::{cxp_ctrl::{DATA_MAXSIZE, Error as CtrlErr}, cxp_grabber::{camera_connected, with_tag}, cxp_packet::{read_bytes, read_u32, write_u32}}; use log::info; diff --git a/src/libksupport/src/kernel/cache.rs b/src/libksupport/src/kernel/cache.rs index 09b85b1d..2e0919e6 100644 --- a/src/libksupport/src/kernel/cache.rs +++ b/src/libksupport/src/kernel/cache.rs @@ -3,7 +3,7 @@ use core::mem::{forget, transmute}; use cslice::{AsCSlice, CSlice}; -use super::{Message, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0}; +use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, Message}; pub extern "C" fn get(key: CSlice) -> &CSlice<'static, i32> { let key = String::from_utf8(key.as_ref().to_vec()).unwrap(); diff --git a/src/libksupport/src/kernel/control.rs b/src/libksupport/src/kernel/control.rs index fcd35dcc..b45b3903 100644 --- a/src/libksupport/src/kernel/control.rs +++ b/src/libksupport/src/kernel/control.rs @@ -3,7 +3,7 @@ use core::mem::{forget, replace}; use libcortex_a9::sync_channel::{Receiver, Sender}; use libsupport_zynq::boot::Core1; -use super::{Message, CHANNEL_0TO1, CHANNEL_1TO0, CHANNEL_SEM, INIT_LOCK}; +use super::{CHANNEL_0TO1, CHANNEL_1TO0, CHANNEL_SEM, INIT_LOCK, Message}; use crate::irq::restart_core1; pub struct Control { diff --git a/src/libksupport/src/kernel/core1.rs b/src/libksupport/src/kernel/core1.rs index 232fe731..3bb9c327 100644 --- a/src/libksupport/src/kernel/core1.rs +++ b/src/libksupport/src/kernel/core1.rs @@ -4,7 +4,7 @@ use alloc::borrow::ToOwned; use core::{cell::UnsafeCell, mem, ptr}; use cslice::CSlice; -use dyld::{elf::EXIDX_Entry, Library}; +use dyld::{Library, elf::EXIDX_Entry}; use libboard_zynq::{gic, mpcore}; use libcortex_a9::{asm::{dsb, isb}, cache::{bpiall, dcci_slice, iciallu}, @@ -12,8 +12,8 @@ use libcortex_a9::{asm::{dsb, isb}, use libsupport_zynq::ram; use log::{debug, error, info}; -use super::{api::resolve, dma, rpc::rpc_send_async, Message, CHANNEL_0TO1, CHANNEL_1TO0, CHANNEL_SEM, INIT_LOCK, - KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, KERNEL_IMAGE}; +use super::{CHANNEL_0TO1, CHANNEL_1TO0, CHANNEL_SEM, INIT_LOCK, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, + KERNEL_IMAGE, Message, api::resolve, dma, rpc::rpc_send_async}; use crate::{eh_artiq, get_async_errors}; // linker symbols diff --git a/src/libksupport/src/kernel/dma.rs b/src/libksupport/src/kernel/dma.rs index 75e10373..b81a9a82 100644 --- a/src/libksupport/src/kernel/dma.rs +++ b/src/libksupport/src/kernel/dma.rs @@ -3,7 +3,7 @@ use core::{mem, ptr}; use cslice::CSlice; -use super::{rtio, Message, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, KERNEL_IMAGE}; +use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, KERNEL_IMAGE, Message, rtio}; use crate::{artiq_raise, pl::csr}; #[repr(C)] diff --git a/src/libksupport/src/kernel/i2c.rs b/src/libksupport/src/kernel/i2c.rs index 0b489ba1..9a6fdda2 100644 --- a/src/libksupport/src/kernel/i2c.rs +++ b/src/libksupport/src/kernel/i2c.rs @@ -3,7 +3,7 @@ use core::mem::MaybeUninit; use libboard_zynq::i2c::{Error, I2c}; #[cfg(has_drtio)] -use super::{Message, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0}; +use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, Message}; use crate::artiq_raise; static mut I2C_BUS: MaybeUninit = MaybeUninit::uninit(); diff --git a/src/libksupport/src/kernel/mod.rs b/src/libksupport/src/kernel/mod.rs index 3eea5ae0..e2ac82bd 100644 --- a/src/libksupport/src/kernel/mod.rs +++ b/src/libksupport/src/kernel/mod.rs @@ -3,7 +3,7 @@ use core::ptr; use libcortex_a9::{mutex::Mutex, semaphore::Semaphore, sync_channel}; -use crate::{eh_artiq, RPCException}; +use crate::{RPCException, eh_artiq}; mod control; pub use control::Control; diff --git a/src/libksupport/src/kernel/rpc.rs b/src/libksupport/src/kernel/rpc.rs index b74feeb4..2c92926a 100644 --- a/src/libksupport/src/kernel/rpc.rs +++ b/src/libksupport/src/kernel/rpc.rs @@ -4,7 +4,7 @@ use alloc::vec::Vec; use cslice::CSlice; -use super::{Message, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0}; +use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, Message}; use crate::{eh_artiq, rpc::send_args}; fn rpc_send_common(is_async: bool, service: u32, tag: &CSlice, data: *const *const ()) { diff --git a/src/libksupport/src/kernel/rtio_acp.rs b/src/libksupport/src/kernel/rtio_acp.rs index fd670c56..577d900f 100644 --- a/src/libksupport/src/kernel/rtio_acp.rs +++ b/src/libksupport/src/kernel/rtio_acp.rs @@ -1,11 +1,11 @@ -use core::sync::atomic::{fence, Ordering}; +use core::sync::atomic::{Ordering, fence}; use cslice::CSlice; use libcortex_a9::asm; use vcell::VolatileCell; #[cfg(has_drtio)] -use super::{Message, KERNEL_CHANNEL_1TO0}; +use super::{KERNEL_CHANNEL_1TO0, Message}; use crate::{artiq_raise, pl::csr, resolve_channel_name, rtio_core}; pub const RTIO_O_STATUS_WAIT: i32 = 1; diff --git a/src/libksupport/src/kernel/rtio_csr.rs b/src/libksupport/src/kernel/rtio_csr.rs index 91dc3f1c..8d7cee81 100644 --- a/src/libksupport/src/kernel/rtio_csr.rs +++ b/src/libksupport/src/kernel/rtio_csr.rs @@ -3,7 +3,7 @@ use core::ptr::{read_volatile, write_volatile}; use cslice::CSlice; #[cfg(has_drtio)] -use super::{Message, KERNEL_CHANNEL_1TO0}; +use super::{KERNEL_CHANNEL_1TO0, Message}; use crate::{artiq_raise, pl::csr, resolve_channel_name, rtio_core}; pub const RTIO_O_STATUS_WAIT: u8 = 1; diff --git a/src/libksupport/src/kernel/subkernel.rs b/src/libksupport/src/kernel/subkernel.rs index deae464f..7bcc7f4d 100644 --- a/src/libksupport/src/kernel/subkernel.rs +++ b/src/libksupport/src/kernel/subkernel.rs @@ -2,7 +2,7 @@ use alloc::vec::Vec; use cslice::CSlice; -use super::{rtio::now_mu, Message, SubkernelStatus, KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0}; +use super::{KERNEL_CHANNEL_0TO1, KERNEL_CHANNEL_1TO0, Message, SubkernelStatus, rtio::now_mu}; use crate::{artiq_raise, eh_artiq, rpc::send_args}; pub extern "C" fn load_run(id: u32, destination: u8, run: bool) { diff --git a/src/libksupport/src/rpc.rs b/src/libksupport/src/rpc.rs index d3148b3e..d1d8f46c 100644 --- a/src/libksupport/src/rpc.rs +++ b/src/libksupport/src/rpc.rs @@ -6,7 +6,7 @@ use cslice::{CMutSlice, CSlice}; use io::{ProtoRead, ProtoWrite}; use log::trace; -use self::tag::{split_tag, Tag, TagIterator}; +use self::tag::{Tag, TagIterator, split_tag}; #[inline] pub fn round_up(val: usize, power_of_two: usize) -> usize { diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index ad5ed206..ed4ffc7c 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -21,7 +21,7 @@ use libboard_zynq::{self as zynq, time::Instant, wire::IpCidr}, timer::GlobalTimer}; -use libconfig::{net_settings, Config}; +use libconfig::{Config, net_settings}; use libcortex_a9::{mutex::Mutex, semaphore::Semaphore, sync_channel::{Receiver, Sender}}; diff --git a/src/runtime/src/mgmt.rs b/src/runtime/src/mgmt.rs index 57621eb7..aa9e3f7f 100644 --- a/src/runtime/src/mgmt.rs +++ b/src/runtime/src/mgmt.rs @@ -138,7 +138,7 @@ mod remote_coremgmt { use core_io::Read; use io::ProtoWrite; use libboard_artiq::{drtioaux_async, - drtioaux_proto::{Packet, MASTER_PAYLOAD_MAX_SIZE}}; + drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, Packet}}; use super::*; diff --git a/src/runtime/src/moninj.rs b/src/runtime/src/moninj.rs index 1889a376..113ee3a4 100644 --- a/src/runtime/src/moninj.rs +++ b/src/runtime/src/moninj.rs @@ -1,7 +1,7 @@ use alloc::{collections::BTreeMap, rc::Rc}; use core::{cell::RefCell, fmt}; -use futures::{pin_mut, select_biased, FutureExt}; +use futures::{FutureExt, pin_mut, select_biased}; use libasync::{block_async, nb, smoltcp::TcpStream, task}; use libboard_artiq::drtio_routing; use libboard_zynq::{smoltcp, time::Milliseconds, timer::GlobalTimer}; diff --git a/src/runtime/src/rtio_clocking.rs b/src/runtime/src/rtio_clocking.rs index 2c77d5c7..7295f86f 100644 --- a/src/runtime/src/rtio_clocking.rs +++ b/src/runtime/src/rtio_clocking.rs @@ -4,11 +4,11 @@ use embedded_hal::blocking::delay::DelayMs; use ksupport::kernel::i2c; #[cfg(not(feature = "target_ebaz4205"))] use libboard_artiq::pl; -#[cfg(has_si5324)] -use libboard_artiq::si5324; #[cfg(has_si549)] use libboard_artiq::si549; #[cfg(has_si5324)] +use libboard_artiq::si5324; +#[cfg(has_si5324)] use libboard_zynq::i2c::I2c; use libboard_zynq::timer::GlobalTimer; use libconfig::Config; diff --git a/src/runtime/src/rtio_mgt.rs b/src/runtime/src/rtio_mgt.rs index 821b9d0f..56b24562 100644 --- a/src/runtime/src/rtio_mgt.rs +++ b/src/runtime/src/rtio_mgt.rs @@ -15,15 +15,15 @@ pub mod drtio { use embedded_hal::blocking::delay::DelayMs; #[cfg(has_drtio_eem)] use embedded_hal::blocking::delay::DelayUs; - use ksupport::{kernel::Message as KernelMessage, resolve_channel_name, ASYNC_ERROR_BUSY, ASYNC_ERROR_COLLISION, - ASYNC_ERROR_SEQUENCE_ERROR, SEEN_ASYNC_ERRORS}; + use ksupport::{ASYNC_ERROR_BUSY, ASYNC_ERROR_COLLISION, ASYNC_ERROR_SEQUENCE_ERROR, SEEN_ASYNC_ERRORS, + kernel::Message as KernelMessage, resolve_channel_name}; use libasync::{delay, task}; #[cfg(has_drtio_eem)] use libboard_artiq::drtio_eem; use libboard_artiq::{drtioaux::Error as DrtioError, drtioaux_async, drtioaux_async::Packet, - drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE}}; + drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, PayloadStatus}}; use libboard_zynq::time::Milliseconds; use log::{error, info, warn}; diff --git a/src/runtime/src/subkernel.rs b/src/runtime/src/subkernel.rs index 3663c454..5304a1ba 100644 --- a/src/runtime/src/subkernel.rs +++ b/src/runtime/src/subkernel.rs @@ -2,7 +2,7 @@ use alloc::{collections::BTreeMap, rc::Rc, vec::Vec}; use libasync::task; use libboard_artiq::{drtio_routing::RoutingTable, - drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE}}; + drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, PayloadStatus}}; use libboard_zynq::{time::Milliseconds, timer::GlobalTimer}; use libcortex_a9::mutex::Mutex; use log::{error, warn}; diff --git a/src/satman/src/dma.rs b/src/satman/src/dma.rs index cbbc3a6b..f2c23a07 100644 --- a/src/satman/src/dma.rs +++ b/src/satman/src/dma.rs @@ -3,7 +3,7 @@ use core::mem; use ksupport::kernel::DmaRecorder; use libboard_artiq::{drtio_routing::RoutingTable, - drtioaux_proto::{Packet, PayloadStatus, MASTER_PAYLOAD_MAX_SIZE}, + drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, Packet, PayloadStatus}, pl::csr}; use libcortex_a9::cache::dcci_slice; diff --git a/src/satman/src/main.rs b/src/satman/src/main.rs index 81fbbab5..c9bec2fd 100644 --- a/src/satman/src/main.rs +++ b/src/satman/src/main.rs @@ -35,10 +35,10 @@ use libboard_artiq::drtio_eem; use libboard_artiq::grabber; #[cfg(feature = "target_kasli_soc")] use libboard_artiq::io_expander; -#[cfg(has_si5324)] -use libboard_artiq::si5324; #[cfg(has_si549)] use libboard_artiq::si549; +#[cfg(has_si5324)] +use libboard_artiq::si5324; use libboard_artiq::{drtio_routing, drtioaux, drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, SAT_PAYLOAD_MAX_SIZE}, identifier_read, logger, diff --git a/src/satman/src/mgmt.rs b/src/satman/src/mgmt.rs index 615f2aa3..585508cb 100644 --- a/src/satman/src/mgmt.rs +++ b/src/satman/src/mgmt.rs @@ -7,7 +7,7 @@ use io::ProtoRead; use libboard_artiq::{drtioaux_proto::SAT_PAYLOAD_MAX_SIZE, logger::{BufferLogger, LogBufferRef}}; use libconfig::Config; -use log::{debug, error, info, warn, LevelFilter}; +use log::{LevelFilter, debug, error, info, warn}; use crate::routing::{SliceMeta, Sliceable}; diff --git a/src/satman/src/routing.rs b/src/satman/src/routing.rs index 2ea1ac53..b71e50bd 100644 --- a/src/satman/src/routing.rs +++ b/src/satman/src/routing.rs @@ -4,7 +4,7 @@ use core::cmp::min; #[cfg(has_drtio_routing)] use libboard_artiq::pl::csr; use libboard_artiq::{drtio_routing, drtioaux, - drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE, SAT_PAYLOAD_MAX_SIZE}}; + drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, PayloadStatus, SAT_PAYLOAD_MAX_SIZE}}; pub struct SliceMeta { pub destination: u8, diff --git a/src/satman/src/subkernel.rs b/src/satman/src/subkernel.rs index 9f34cf51..3dc0f511 100644 --- a/src/satman/src/subkernel.rs +++ b/src/satman/src/subkernel.rs @@ -11,7 +11,7 @@ use io::{Cursor, ProtoWrite}; use ksupport::{eh_artiq, kernel, kernel::rtio, rpc}; use libboard_artiq::{drtio_routing::RoutingTable, drtioaux, - drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE}, + drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, PayloadStatus}, pl::csr}; use libboard_zynq::{time::Milliseconds, timer::GlobalTimer}; use libcortex_a9::sync_channel::Receiver;