/rust/pin-init/src/ |
A D | alloc.rs | 40 let init = unsafe { in pin_init() 46 Self::try_pin_init(init) in pin_init() 55 fn init(init: impl Init<T>) -> Result<Self, AllocError> { in init() method 57 let init = unsafe { in init() 63 Self::try_init(init) in init() 86 try_new_uninit!(Box).write_pin_init(init) in try_pin_init() 94 try_new_uninit!(Box).write_init(init) in try_init() 112 unsafe { init.__pinned_init(slot)? }; in try_pin_init() 130 unsafe { init.__init(slot)? }; in try_init() 143 unsafe { init.__init(slot)? }; in write_init() [all …]
|
A D | lib.rs | 887 macro_rules! init { macro 1013 unsafe { data.$field(ptr, init) }.ok(); 1328 let init = move |slot: *mut [T; N]| { 1331 let init = make_init(i); 1336 if let Err(e) = unsafe { init.__init(ptr) } { 1347 unsafe { init_from_closure(init) } 1371 let init = move |slot: *mut [T; N]| { 1374 let init = make_init(i); 1379 if let Err(e) = unsafe { init.__pinned_init(ptr) } { 1390 unsafe { pin_init_from_closure(init) } [all …]
|
A D | __internal.rs | 171 pub fn init<E>(self: Pin<&mut Self>, init: impl PinInit<T, E>) -> Result<Pin<&mut T>, E> { in init() method 182 unsafe { init.__pinned_init(this.value.as_mut_ptr())? }; in init() 203 slot.as_mut().init(crate::init!(Foo { in stack_init_reuse() 210 slot.as_mut().init(crate::init!(Foo { in stack_init_reuse()
|
A D | macros.rs | 1006 init: impl $crate::PinInit<$p_type, E>, 1009 unsafe { $crate::PinInit::__pinned_init(init, slot) } 1017 init: impl $crate::Init<$type, E>, 1020 unsafe { $crate::Init::__init(init, slot) } 1145 let init = $crate::__internal::$data::make_closure::<_, __InitOk, $err>( 1188 let init = move |slot| -> ::core::result::Result<(), $err> { 1189 init(slot).map(|__InitOk| ()) 1192 let init = unsafe { $crate::$construct_closure::<_, $err>(init) }; 1193 init 1212 let init = $val; [all …]
|
/rust/kernel/ |
A D | init.rs | 147 fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Self::PinnedSelf, E> in try_pin_init() 155 fn pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> error::Result<Self::PinnedSelf> in pin_init() 160 let init = unsafe { in pin_init() 161 pin_init_from_closure(|slot| init.__pinned_init(slot).map_err(|e| Error::from(e))) in pin_init() 163 Self::try_pin_init(init, flags) in pin_init() 167 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in try_init() 172 fn init<E>(init: impl Init<T, E>, flags: Flags) -> error::Result<Self> in init() method 177 let init = unsafe { in init() 178 init_from_closure(|slot| init.__pinned_init(slot).map_err(|e| Error::from(e))) in init() 180 Self::try_init(init, flags) in init()
|
A D | prelude.rs | 27 pub use pin_init::{init, pin_data, pin_init, pinned_drop, InPlaceWrite, Init, PinInit, Zeroable}; 46 pub use super::init::InPlaceInit;
|
A D | lib.rs | 92 pub mod init; module 151 fn init(module: &'static ThisModule) -> error::Result<Self>; in init() method 159 fn init(module: &'static ThisModule) -> impl pin_init::PinInit<Self, error::Error>; in init() method 163 fn init(module: &'static ThisModule) -> impl pin_init::PinInit<Self, error::Error> { in init() method 165 let m = <Self as Module>::init(module)?; in init()
|
A D | driver.rs | 115 fn init(
|
A D | workqueue.rs | 339 let init = pin_init!(ClosureWork { in try_spawn() 344 self.enqueue(KBox::pin_init(init, flags).map_err(|_| AllocError)?); in try_spawn()
|
A D | kunit.rs | 296 init: None,
|
A D | cpufreq.rs | 739 fn init(policy: &mut Policy) -> Result<Self::PData>; in init() method 922 init: Some(Self::init_callback), 1073 let data = T::init(policy)?; in init_callback()
|
A D | configfs.rs | 358 Ok(init) => init, in make_group()
|
/rust/pin-init/examples/ |
A D | big_struct_in_place.rs | 24 init!(ManagedBuf { buf <- init_zeroed() }) in new() 32 let buf: Box<BigStruct> = Box::init(init!(BigStruct { in main()
|
A D | static_init.rs | 28 init: Cell<Option<I>>, field 37 pub const fn new(init: I) -> Self { in new() 40 init: Cell::new(Some(init)), in new() 62 match self.init.take() { in deref() 79 let init = CMutex::new(0); in __pinned_init() 81 unsafe { init.__pinned_init(slot) } in __pinned_init()
|
A D | pthread_mutex.rs | 68 let init = |slot: *mut UnsafeCell<libc::pthread_mutex_t>| { in new() 99 unsafe { pin_init_from_closure(init) } in new()
|
/rust/kernel/sync/ |
A D | arc.rs | 23 init::InPlaceInit, 215 UniqueArc::try_pin_init(init, flags).map(|u| u.into()) in try_pin_init() 219 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in try_init() 223 UniqueArc::try_init(init, flags).map(|u| u.into()) in try_init() 730 UniqueArc::new_uninit(flags)?.write_pin_init(init) in try_pin_init() 738 UniqueArc::new_uninit(flags)?.write_init(init) in try_init() 749 unsafe { init.__init(slot)? }; in write_init() 758 unsafe { init.__pinned_init(slot)? }; in write_pin_init() 818 match unsafe { init.__init(self.as_mut_ptr()) } { in init_with() 828 init: impl PinInit<T, E>, in pin_init_with() [all …]
|
A D | lock.rs | 53 unsafe fn init( in init() method 137 B::init(slot, name.as_char_ptr(), key.as_ptr()) in new()
|
/rust/pin-init/ |
A D | CONTRIBUTING.md | 1 # Contributing to `pin-init` 3 Thanks for showing interest in contributing to `pin-init`! This document outlines the guidelines for 4 contributing to `pin-init`. 25 problems or just have questions related to `pin-init` in the Linux kernel, you can also ask your 33 `pin-init` is used by the Linux kernel and all commits are synchronized to it. For this reason, the 34 same requirements for commits apply to `pin-init`. See [the kernel's documentation] for details. The 39 Contributions to `pin-init` ideally go through the [GitHub repository], because that repository runs 44 [GitHub repository]: https://github.com/Rust-for-Linux/pin-init
|
A D | README.md | 1 [](https://crates.io/crates/pin-init) 2 [](https://docs.rs/pin-init/) 3 …://deps.rs/repo/github/Rust-for-Linux/pin-init/status.svg)](https://deps.rs/repo/github/Rust-for-L… 4  7 # `pin-init` 114 To declare an init macro/function you just return an [`impl PinInit<T, E>`]: 128 buffer: Box::init(pin_init::init_zeroed())?, 226 [stack]: https://docs.rs/pin-init/latest/pin_init/macro.stack_pin_init.html 227 [`impl PinInit<Foo>`]: https://docs.rs/pin-init/latest/pin_init/trait.PinInit.html 228 [`impl PinInit<T, E>`]: https://docs.rs/pin-init/latest/pin_init/trait.PinInit.html [all …]
|
/rust/kernel/alloc/ |
A D | kbox.rs | 20 use crate::init::InPlaceInit; 361 fn write_init<E>(mut self, init: impl Init<T, E>) -> Result<Self::Initialized, E> { in write_init() 365 unsafe { init.__init(slot)? }; in write_init() 370 fn write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> { in write_pin_init() 374 unsafe { init.__pinned_init(slot)? }; in write_pin_init() 387 fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>, E> in try_pin_init() 391 Box::<_, A>::new_uninit(flags)?.write_pin_init(init) in try_pin_init() 395 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in try_init() 399 Box::<_, A>::new_uninit(flags)?.write_init(init) in try_init()
|
/rust/kernel/sync/lock/ |
A D | global.rs | 62 pub unsafe fn init(&'static self) { in init() method 71 B::Backend::init( in init() 282 let init: $valuety = $value; 287 unsafe { $crate::sync::lock::GlobalLock::new(init) }
|
A D | mutex.rs | 105 unsafe fn init( in init() method
|
A D | spinlock.rs | 104 unsafe fn init( in init() method
|
/rust/kernel/list/ |
A D | arc.rs | 183 pub fn pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Self, E> in pin_init() 187 Ok(Self::from(UniqueArc::try_pin_init(init, flags)?)) in pin_init() 194 pub fn init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in init() method 198 Ok(Self::from(UniqueArc::try_init(init, flags)?)) in init()
|
/rust/ |
A D | Makefile | 133 rustdoc-pin_init_internal: $(src)/pin-init/internal/src/lib.rs \
|