From 615882ebd67f4e7e60fb8aa1505b1272655c4fa4 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 4 Sep 2023 22:16:28 +0200 Subject: [PATCH] Rename zero_copy -> zerocopy. --- embassy-net-driver-channel/src/lib.rs | 26 +++++++++---------- embassy-sync/src/lib.rs | 2 +- ...ro_copy_channel.rs => zerocopy_channel.rs} | 0 3 files changed, 14 insertions(+), 14 deletions(-) rename embassy-sync/src/{zero_copy_channel.rs => zerocopy_channel.rs} (100%) diff --git a/embassy-net-driver-channel/src/lib.rs b/embassy-net-driver-channel/src/lib.rs index a20760749..bf7ae5217 100644 --- a/embassy-net-driver-channel/src/lib.rs +++ b/embassy-net-driver-channel/src/lib.rs @@ -14,7 +14,7 @@ use embassy_net_driver::{Capabilities, LinkState, Medium}; use embassy_sync::blocking_mutex::raw::NoopRawMutex; use embassy_sync::blocking_mutex::Mutex; use embassy_sync::waitqueue::WakerRegistration; -use embassy_sync::zero_copy_channel; +use embassy_sync::zerocopy_channel; pub struct State { rx: [PacketBuf; N_RX], @@ -35,8 +35,8 @@ impl State { - rx: zero_copy_channel::Channel<'d, NoopRawMutex, PacketBuf>, - tx: zero_copy_channel::Channel<'d, NoopRawMutex, PacketBuf>, + rx: zerocopy_channel::Channel<'d, NoopRawMutex, PacketBuf>, + tx: zerocopy_channel::Channel<'d, NoopRawMutex, PacketBuf>, shared: Mutex>, } @@ -48,8 +48,8 @@ struct Shared { } pub struct Runner<'d, const MTU: usize> { - tx_chan: zero_copy_channel::Receiver<'d, NoopRawMutex, PacketBuf>, - rx_chan: zero_copy_channel::Sender<'d, NoopRawMutex, PacketBuf>, + tx_chan: zerocopy_channel::Receiver<'d, NoopRawMutex, PacketBuf>, + rx_chan: zerocopy_channel::Sender<'d, NoopRawMutex, PacketBuf>, shared: &'d Mutex>, } @@ -59,11 +59,11 @@ pub struct StateRunner<'d> { } pub struct RxRunner<'d, const MTU: usize> { - rx_chan: zero_copy_channel::Sender<'d, NoopRawMutex, PacketBuf>, + rx_chan: zerocopy_channel::Sender<'d, NoopRawMutex, PacketBuf>, } pub struct TxRunner<'d, const MTU: usize> { - tx_chan: zero_copy_channel::Receiver<'d, NoopRawMutex, PacketBuf>, + tx_chan: zerocopy_channel::Receiver<'d, NoopRawMutex, PacketBuf>, } impl<'d, const MTU: usize> Runner<'d, MTU> { @@ -244,8 +244,8 @@ pub fn new<'d, const MTU: usize, const N_RX: usize, const N_TX: usize>( let state_uninit: *mut MaybeUninit> = (&mut state.inner as *mut MaybeUninit>).cast(); let state = unsafe { &mut *state_uninit }.write(StateInner { - rx: zero_copy_channel::Channel::new(&mut state.rx[..]), - tx: zero_copy_channel::Channel::new(&mut state.tx[..]), + rx: zerocopy_channel::Channel::new(&mut state.rx[..]), + tx: zerocopy_channel::Channel::new(&mut state.tx[..]), shared: Mutex::new(RefCell::new(Shared { link_state: LinkState::Down, hardware_address, @@ -283,8 +283,8 @@ impl PacketBuf { } pub struct Device<'d, const MTU: usize> { - rx: zero_copy_channel::Receiver<'d, NoopRawMutex, PacketBuf>, - tx: zero_copy_channel::Sender<'d, NoopRawMutex, PacketBuf>, + rx: zerocopy_channel::Receiver<'d, NoopRawMutex, PacketBuf>, + tx: zerocopy_channel::Sender<'d, NoopRawMutex, PacketBuf>, shared: &'d Mutex>, caps: Capabilities, } @@ -329,7 +329,7 @@ impl<'d, const MTU: usize> embassy_net_driver::Driver for Device<'d, MTU> { } pub struct RxToken<'a, const MTU: usize> { - rx: zero_copy_channel::Receiver<'a, NoopRawMutex, PacketBuf>, + rx: zerocopy_channel::Receiver<'a, NoopRawMutex, PacketBuf>, } impl<'a, const MTU: usize> embassy_net_driver::RxToken for RxToken<'a, MTU> { @@ -346,7 +346,7 @@ impl<'a, const MTU: usize> embassy_net_driver::RxToken for RxToken<'a, MTU> { } pub struct TxToken<'a, const MTU: usize> { - tx: zero_copy_channel::Sender<'a, NoopRawMutex, PacketBuf>, + tx: zerocopy_channel::Sender<'a, NoopRawMutex, PacketBuf>, } impl<'a, const MTU: usize> embassy_net_driver::TxToken for TxToken<'a, MTU> { diff --git a/embassy-sync/src/lib.rs b/embassy-sync/src/lib.rs index 48a7b13f6..8a9f841ee 100644 --- a/embassy-sync/src/lib.rs +++ b/embassy-sync/src/lib.rs @@ -17,4 +17,4 @@ pub mod pipe; pub mod pubsub; pub mod signal; pub mod waitqueue; -pub mod zero_copy_channel; +pub mod zerocopy_channel; diff --git a/embassy-sync/src/zero_copy_channel.rs b/embassy-sync/src/zerocopy_channel.rs similarity index 100% rename from embassy-sync/src/zero_copy_channel.rs rename to embassy-sync/src/zerocopy_channel.rs