Home
last modified time | relevance | path

Searched refs:UnsafeCell (Results 1 – 19 of 19) sorted by relevance

/linux/rust/kernel/
H A Dtypes.rs7 cell::UnsafeCell,
333 value: UnsafeCell<MaybeUninit<T>>, in new()
344 value: UnsafeCell::new(MaybeUninit::new(value)), in uninit()
352 value: UnsafeCell::new(MaybeUninit::uninit()), in zeroed()
360 value: UnsafeCell::new(MaybeUninit::zeroed()),
404 UnsafeCell::get(&self.value).cast::<T>() in cast_into()
412 UnsafeCell::raw_get(this.cast::<UnsafeCell<MaybeUninit<T>>>()).cast::<T>()
H A Dconfigfs.rs120 use core::cell::UnsafeCell;
683 UnsafeCell<[*mut kernel::ffi::c_void; N]>,
700 Self(UnsafeCell::new([core::ptr::null_mut(); N]), PhantomData) in new()
H A Dcpufreq.rs28 cell::UnsafeCell,
917 pub struct Registration<T: Driver>(KBox<UnsafeCell<bindings::cpufreq_driver>>, PhantomData<T>);
1053 let mut drv = KBox::new(UnsafeCell::new(Self::VTABLE), GFP_KERNEL)?; in new_foreign_owned()
/linux/rust/zerocopy/src/
H A Dimpls.rs13 cell::{Cell, UnsafeCell},
447 … unsafe impl<$($tyvar)?> TransmuteFrom<$atomic, Valid, Valid> for core::cell::UnsafeCell<$prim> {}
449 … unsafe impl<$($tyvar)?> TransmuteFrom<core::cell::UnsafeCell<$prim>, Valid, Valid> for $atomic {}
839 impl_for_transmute_from!(T: ?Sized + FromZeros => FromZeros for UnsafeCell<T>[T]);
840 impl_for_transmute_from!(T: ?Sized + FromBytes => FromBytes for UnsafeCell<T>[T]);
841 impl_for_transmute_from!(T: ?Sized + IntoBytes => IntoBytes for UnsafeCell<T>[T]);
849 const _: () = unsafe { unsafe_impl!(T: ?Sized + Unaligned => Unaligned for UnsafeCell<T>) };
850 assert_unaligned!(UnsafeCell<()>, UnsafeCell<u8>);
853 unsafe impl<T: TryFromBytes + ?Sized> TryFromBytes for UnsafeCell<T> { implementation
1493 Box<UnsafeCell<NotZerocopy>>, in test_impls()
[all …]
H A Dmacros.rs1309 let x: usize = transmute!(UnsafeCell::new(1usize)); in test_transmute()
1311 let x: UnsafeCell<usize> = transmute!(1usize); in test_transmute()
1313 let x: UnsafeCell<isize> = transmute!(UnsafeCell::new(1usize)); in test_transmute()
1443 let x: Result<usize, _> = try_transmute!(UnsafeCell::new(1usize)); in test_try_transmute()
1445 let x: Result<UnsafeCell<usize>, _> = try_transmute!(1usize); in test_try_transmute()
1447 let x: Result<UnsafeCell<isize>, _> = try_transmute!(UnsafeCell::new(1usize)); in test_try_transmute()
H A Dlib.rs373 cell::{Cell, UnsafeCell},
1154 unsafe_impl_known_layout!(T: ?Sized + KnownLayout => #[repr(T)] UnsafeCell<T>);
/linux/rust/pin-init/examples/
H A Dpthread_mutex.rs12 cell::UnsafeCell,
24 raw: UnsafeCell<libc::pthread_mutex_t>,
25 data: UnsafeCell<T>,
66 fn init_raw() -> impl PinInit<UnsafeCell<libc::pthread_mutex_t>, Error> { in new()
67 let init = |slot: *mut UnsafeCell<libc::pthread_mutex_t>| { in new()
68 // we can cast, because `UnsafeCell` has the same layout as T. in new()
101 data: UnsafeCell::new(data), in new()
H A Dstatic_init.rs8 cell::{Cell, UnsafeCell},
26 cell: UnsafeCell<MaybeUninit<T>>,
38 cell: UnsafeCell::new(MaybeUninit::uninit()), in new()
H A Dmutex.rs8 cell::{Cell, UnsafeCell},
72 data: UnsafeCell<T>,
82 data <- UnsafeCell::pin_init(val), in new()
/linux/rust/zerocopy/src/pointer/
H A Dtransmute.rs14 cell::{Cell, UnsafeCell},
450 const _: () = unsafe { unsafe_impl_for_transparent_wrapper!(pub T: ?Sized => UnsafeCell<T>) };
474 impl_transitive_transmute_from!(T: ?Sized => Cell<T> => T => UnsafeCell<T>);
475 impl_transitive_transmute_from!(T: ?Sized => UnsafeCell<T> => T => Cell<T>);
517 test_size_eq::<Cell<u8>, UnsafeCell<u8>>(Cell::new(0u8)); in test_transmute_coverage()
520 test_size_eq::<UnsafeCell<u8>, Cell<u8>>(UnsafeCell::new(0u8)); in test_transmute_coverage()
H A Dptr.rs809 use core::cell::UnsafeCell;
1202 impl<'a, T, I> Ptr<'a, UnsafeCell<T>, I>
1221 define_cast!(unsafe { Cast<T: ?Sized> = UnsafeCell<T> => T }); in get_mut()
H A Dinner.rs71 _marker: PhantomData<&'a core::cell::UnsafeCell<T>>,
/linux/rust/kernel/sync/
H A Dset_once.rs9 use core::{cell::UnsafeCell, mem::MaybeUninit};
45 value: UnsafeCell<MaybeUninit<T>>,
61 value: UnsafeCell::new(MaybeUninit::uninit()), in new()
H A Dlocked_by.rs7 use core::{cell::UnsafeCell, mem::size_of, ptr};
80 data: UnsafeCell<T>,
109 data: UnsafeCell::new(data), in new()
H A Dlock.rs13 use core::{cell::UnsafeCell, marker::PhantomPinned, pin::Pin};
119 pub(crate) data: UnsafeCell<T>,
137 data <- UnsafeCell::pin_init(t), in new()
/linux/rust/kernel/sync/lock/
H A Dglobal.rs14 cell::UnsafeCell,
51 data: UnsafeCell::new(data), in new()
127 value: UnsafeCell<T>,
154 value: UnsafeCell::new(val),
/linux/rust/kernel/sync/atomic/
H A Dinternal.rs12 use core::cell::UnsafeCell;
82 pub struct AtomicRepr<T: AtomicImpl>(UnsafeCell<T>);
87 Self(UnsafeCell::new(v))
96 // GUARANTEE: `self.0` is an `UnsafeCell<T>`, therefore the pointer returned by `.get()`
/linux/rust/pin-init/src/
H A Dlib.rs275 cell::UnsafeCell,
1649 {<T: ?Sized + Zeroable>} UnsafeCell<T>,
1774 impl<T> Wrapper<T> for UnsafeCell<T> { implementation
/linux/rust/pin-init/
H A DREADME.md164 cell::UnsafeCell,
189 foo: UnsafeCell<MaybeUninit<bindings::foo>>,
202 let foo = UnsafeCell::raw_get(foo).cast::<bindings::foo>();