pub struct Bar<'a, const SIZE: usize = 0> { /* private fields */ }Expand description
A PCI BAR to perform I/O-Operations on.
I/O backend assumes that the device is little-endian and will automatically convert from little-endian to CPU endianness.
§Invariants
Bar always holds an IoRaw instance that holds a valid pointer to the start of the I/O
memory mapped PCI BAR and its size.
Implementations§
Source§impl<'a, const SIZE: usize> Bar<'a, SIZE>
impl<'a, const SIZE: usize> Bar<'a, SIZE>
Sourcepub fn into_devres(self) -> Result<Devres<Bar<'static, SIZE>>>
pub fn into_devres(self) -> Result<Devres<Bar<'static, SIZE>>>
Consume the Bar and register it as a device-managed resource.
The returned Devres<Bar<'static, SIZE>> can outlive the original lifetime 'a. Access
to the BAR is revoked when the device is unbound.
Methods from Deref<Target = Mmio<SIZE>>§
Sourcepub fn relaxed(&self) -> &RelaxedMmio<SIZE>
pub fn relaxed(&self) -> &RelaxedMmio<SIZE>
Returns a RelaxedMmio reference that performs relaxed I/O operations.
Relaxed accessors do not provide ordering guarantees with respect to DMA or memory accesses and can be used when such ordering is not required.
§Examples
use kernel::io::{
Io,
Mmio,
RelaxedMmio,
};
fn do_io(io: &Mmio<0x100>) {
// The access is performed using `readl_relaxed` instead of `readl`.
let v = io.relaxed().read32(0x10);
}
Trait Implementations§
Auto Trait Implementations§
impl<'a, const SIZE: usize = 0> !RefUnwindSafe for Bar<'a, SIZE>
impl<'a, const SIZE: usize = 0> !UnwindSafe for Bar<'a, SIZE>
impl<'a, const SIZE: usize> Freeze for Bar<'a, SIZE>
impl<'a, const SIZE: usize> Send for Bar<'a, SIZE>
impl<'a, const SIZE: usize> Sync for Bar<'a, SIZE>
impl<'a, const SIZE: usize> Unpin for Bar<'a, SIZE>
impl<'a, const SIZE: usize> UnsafeUnpin for Bar<'a, SIZE>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more