Lines Matching +full:io +full:- +full:sync
1 // SPDX-License-Identifier: GPL-2.0
21 sync::{
56 /// io::{
57 /// Io,
75 /// unsafe fn new(paddr: usize) -> Result<Self>{
97 /// fn deref(&self) -> &Self::Target {
102 /// # fn no_run(dev: &Device<Bound>) -> Result<(), Error> {
127 pub fn new<E>(dev: &Device<Bound>, data: impl PinInit<T, E>) -> Result<Self>
136 // - `dev.as_raw()` is a pointer to a valid bound device.
137 // - `data` is guaranteed to be a valid for the duration of the lifetime of `Self`.
138 // - `devm_add_action()` is guaranteed not to call `callback` for the entire lifetime of
158 fn data(&self) -> &Revocable<T> {
171 fn remove_action(&self) -> bool {
173 // - `self.dev` is a valid `Device`,
174 // - the `action` and `data` pointers are the exact same ones as given to
186 pub fn device(&self) -> &Device {
207 /// io::{
208 /// Io,
214 /// fn from_core(dev: &pci::Device<Core>, devres: Devres<pci::Bar<0x4>>) -> Result {
226 pub fn access<'a>(&'a self, dev: &'a Device<Bound>) -> Result<&'a T> {
238 pub fn try_access(&self) -> Option<RevocableGuard<'_, T>> {
243 pub fn try_access_with<R, F: FnOnce(&T) -> R>(&self, f: F) -> Option<R> {
248 pub fn try_access_with_guard<'a>(&'a self, guard: &'a rcu::Guard) -> Option<&'a T> {
256 // SAFETY: `Devres` can be shared with any task, if `T: Sync`.
257 unsafe impl<T: Send + Sync> Sync for Devres<T> {}
276 fn register_foreign<P>(dev: &Device<Bound>, data: P) -> Result
289 // - `dev.as_raw()` is a pointer to a valid and bound device.
290 // - `ptr` is a valid pointer the `ForeignOwnable` devres takes ownership of.
315 /// fn new() -> Self {
328 /// fn from_bound_context(dev: &Device<Bound>) -> Result {
332 pub fn register<T, E>(dev: &Device<Bound>, data: impl PinInit<T, E>, flags: Flags) -> Result