| /linux/rust/kernel/num/ |
| H A D | bounded.rs | 37 /// Returns `true` if `value` can be represented with at most `N` bits in a `T`. 39 fn fits_within<T: Integer>(value: T, num_bits: u32) -> bool { in fits_within() argument 40 fits_within!(value, T, num_bits) in fits_within() 53 /// - `N` is less than or equal to `T::BITS`. 230 pub struct Bounded<T: Integer, const N: u32>(T); 274 impl<T, const N: u32> Bounded<T, N> 276 T 390 get(self) -> T get() argument 408 extend<const M: u32>(self) -> Bounded<T, M> extend() argument 439 try_shrink<const M: u32>(self) -> Option<Bounded<T, M>> try_shrink() argument 515 try_into_bounded(self) -> Option<Bounded<T, N>> try_into_bounded() argument 524 try_into_bounded(self) -> Option<Bounded<T, N>> try_into_bounded() argument 596 add(self, rhs: Bounded<T, M>) -> Self::Output add() argument 608 bitand(self, rhs: Bounded<T, M>) -> Self::Output bitand() argument 620 bitor(self, rhs: Bounded<T, M>) -> Self::Output bitor() argument 632 bitxor(self, rhs: Bounded<T, M>) -> Self::Output bitxor() argument 644 div(self, rhs: Bounded<T, M>) -> Self::Output div() argument 656 mul(self, rhs: Bounded<T, M>) -> Self::Output mul() argument 668 rem(self, rhs: Bounded<T, M>) -> Self::Output rem() argument 680 sub(self, rhs: Bounded<T, M>) -> Self::Output sub() argument 906 impl<T> AtLeastXBits<32> for T where T: AtLeastXBits<64> {} global() implementation 916 impl<T> AtLeastXBits<16> for T where T: AtLeastXBits<32> {} global() implementation 924 impl<T> AtLeastXBits<8> for T where T: AtLeastXBits<16> {} global() implementation 980 impl<T> FitsInXBits<16> for T where T: FitsInXBits<8> {} global() implementation 985 impl<T> FitsInXBits<32> for T where T: FitsInXBits<16> {} global() implementation 993 impl<T> FitsInXBits<64> for T where T: FitsInXBits<32> {} global() implementation 1047 from(value: Bounded<T, 1>) -> Self from() argument [all...] |
| /linux/tools/debugging/ |
| H A D | kernel-chktaint | 48 T=$taint 55 if [ `expr $T % 2` -eq 0 ]; then 62 T=`expr $T / 2` 63 if [ `expr $T % 2` -eq 0 ]; then 70 T=`expr $T / 2` 71 if [ `expr $T % 2` -eq 0 ]; then 78 T=`expr $T / [all...] |
| /linux/drivers/net/wireguard/selftest/ |
| H A D | counter.c | 24 #define T(n, v) do { \ in wg_packet_counter_selftest() macro 34 /* 1 */ T(0, true); in wg_packet_counter_selftest() 35 /* 2 */ T(1, true); in wg_packet_counter_selftest() 36 /* 3 */ T(1, false); in wg_packet_counter_selftest() 37 /* 4 */ T(9, true); in wg_packet_counter_selftest() 38 /* 5 */ T(8, true); in wg_packet_counter_selftest() 39 /* 6 */ T(7, true); in wg_packet_counter_selftest() 40 /* 7 */ T(7, false); in wg_packet_counter_selftest() 41 /* 8 */ T(T_LIM, true); in wg_packet_counter_selftest() 42 /* 9 */ T(T_LIM - 1, true); in wg_packet_counter_selftest() [all …]
|
| /linux/rust/kernel/alloc/ |
| H A D | kbox.rs | 25 /// The kernel's [`Box`] type -- a heap allocation for a single value of type `T`. 81 pub struct Box<#[pointee] T: ?Sized, A: Allocator>(NonNull<T>, PhantomData<A>); 93 pub type KBox<T> = Box<T, super::allocator::Kmalloc>; 105 pub type VBox<T> = Box<T, super::allocator::Vmalloc>; 117 pub type KVBox<T> = Box<T, super::allocator::KVmalloc>; 121 unsafe impl<T, 203 into_raw(b: Self) -> *mut T into_raw() argument 211 leak<'a>(b: Self) -> &'a mut T leak() argument 230 assume_init(self) -> Box<T, A> assume_init() argument 240 write(mut self, value: T) -> Box<T, A> write() argument 256 new(x: T, flags: Flags) -> Result<Self, AllocError> new() argument 275 new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>, A>, AllocError> new_uninit() argument 287 pin(x: T, flags: Flags) -> Result<Pin<Box<T, A>>, AllocError> where A: 'static, pin() argument 340 pin_slice<Func, Item, E>( mut init: Func, len: usize, flags: Flags, ) -> Result<Pin<Box<[T], A>>, E> where Func: FnMut(usize) -> Item, Item: PinInit<T, E>, E: From<AllocError>, pin_slice() argument 343 pin_slice<Func, Item, E>( mut init: Func, len: usize, flags: Flags, ) -> Result<Pin<Box<[T], A>>, E> where Func: FnMut(usize) -> Item, Item: PinInit<T, E>, E: From<AllocError>, pin_slice() argument 378 forget_contents(this: Self) -> Box<MaybeUninit<T>, A> forget_contents() argument 398 drop_contents(this: Self) -> Box<MaybeUninit<T>, A> drop_contents() argument 409 into_inner(b: Self) -> T into_inner() argument 426 from(b: Box<T, A>) -> Self from() argument 439 write_init<E>(mut self, init: impl Init<T, E>) -> Result<Self::Initialized, E> write_init() argument 448 write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> write_pin_init() argument 465 try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>, E> where E: From<AllocError>, try_pin_init() argument 473 try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> where E: From<AllocError>, try_init() argument 506 borrow<'a>(ptr: *mut c_void) -> &'a T borrow() argument 512 borrow_mut<'a>(ptr: *mut c_void) -> &'a mut T borrow_mut() argument 541 borrow<'a>(ptr: *mut c_void) -> Pin<&'a T> borrow() argument 552 borrow_mut<'a>(ptr: *mut c_void) -> Pin<&'a mut T> borrow_mut() argument 572 deref(&self) -> &T deref() argument 584 deref_mut(&mut self) -> &mut T deref_mut() argument 614 borrow(&self) -> &T borrow() argument 642 borrow_mut(&mut self) -> &mut T borrow_mut() argument [all...] |
| H A D | kvec.rs | 107 pub struct Vec<T, A: Allocator> { 108 ptr: NonNull<T>, 113 layout: ArrayLayout<T>, 129 pub type KVec<T> = Vec<T, Kmalloc>; 142 pub type VVec<T> = Vec<T, Vmalloc>; 155 pub type KVVec<T> = Vec<T, KVmalloc>; 158 unsafe impl<T, A> Send for Vec<T, A> 160 T: Send, 166 unsafe impl<T, A> Sync for Vec<T, A> 168 T: Sync, [all …]
|
| /linux/rust/syn/ |
| H A D | punctuated.rs | 49 pub struct Punctuated<T, P> { 50 inner: Vec<(T, P)>, 51 last: Option<Box<T>>, 54 impl<T, P> Punctuated<T, P> { 78 pub fn first(&self) -> Option<&T> { in first() argument 83 pub fn first_mut(&mut self) -> Option<&mut T> { in first_mut() argument 88 pub fn last(&self) -> Option<&T> { in last() argument 93 pub fn last_mut(&mut self) -> Option<&mut T> { in last_mut() argument 98 pub fn get(&self, index: usize) -> Option<&T> { in get() argument 109 pub fn get_mut(&mut self, index: usize) -> Option<&mut T> { in get_mut() argument [all …]
|
| /linux/rust/pin-init/src/ |
| H A D | lib.rs | 45 //! - a memory location that can hold your `struct` (this can be the [stack], an [`Arc<T>`], 46 //! [`Box<T>`] or any other smart pointer that supports this library). 133 //! To declare an init macro/function you just return an [`impl PinInit<T, E>`]: 161 //! [`impl PinInit<T, E>`] directly from a closure. Of course you have to ensure that the closure 165 //! `slot` now contains a valid bit pattern for the type `T`, 253 doc = "[`Arc<T>`]: https://rust.docs.kernel.org/kernel/sync/struct.Arc.html" 257 doc = "[`Box<T>`]: https://rust.docs.kernel.org/kernel/alloc/kbox/struct.Box.html" 259 #![cfg_attr(not(kernel), doc = "[`Arc<T>`]: alloc::alloc::sync::Arc")] 260 #![cfg_attr(not(kernel), doc = "[`Box<T>`]: alloc::alloc::boxed::Box")] 262 //! [`impl PinInit<T, 953 pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E> where F: FnOnce(Pin<&mut T>) -> Result<(), E>, pin_chain() argument 1061 chain<F>(self, f: F) -> ChainInit<Self, F, T, E> where F: FnOnce(&mut T) -> Result<(), E>, chain() argument 1117 pin_init_from_closure<T: ?Sized, E>( f: impl FnOnce(*mut T) -> Result<(), E>, ) -> impl PinInit<T, E> pin_init_from_closure() argument 1136 init_from_closure<T: ?Sized, E>( f: impl FnOnce(*mut T) -> Result<(), E>, ) -> impl Init<T, E> init_from_closure() argument 1146 cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl PinInit<U, E> cast_pin_init() argument 1162 cast_init<T, U, E>(init: impl Init<T, E>) -> impl Init<U, E> cast_init() argument 1176 uninit<T, E>() -> impl Init<MaybeUninit<T>, E> uninit() argument 1191 init_array_from_fn<I, const N: usize, T, E>( mut make_init: impl FnMut(usize) -> I, ) -> impl Init<[T; N], E> where I: Init<T, E>, init_array_from_fn() argument 1195 init_array_from_fn<I, const N: usize, T, E>( mut make_init: impl FnMut(usize) -> I, ) -> impl Init<[T; N], E> where I: Init<T, E>, global() argument 1234 pin_init_array_from_fn<I, const N: usize, T, E>( mut make_init: impl FnMut(usize) -> I, ) -> impl PinInit<[T; N], E> where I: PinInit<T, E>, pin_init_array_from_fn() argument 1238 pin_init_array_from_fn<I, const N: usize, T, E>( mut make_init: impl FnMut(usize) -> I, ) -> impl PinInit<[T; N], E> where I: PinInit<T, E>, global() argument 1288 pin_init_scope<T, E, F, I>(make_init: F) -> impl PinInit<T, E> where F: FnOnce() -> Result<I, E>, I: PinInit<T, E>, pin_init_scope() argument 1291 pin_init_scope<T, E, F, I>(make_init: F) -> impl PinInit<T, E> where F: FnOnce() -> Result<I, E>, I: PinInit<T, E>, pin_init_scope() argument 1331 init_scope<T, E, F, I>(make_init: F) -> impl Init<T, E> where F: FnOnce() -> Result<I, E>, I: Init<T, E>, init_scope() argument 1334 init_scope<T, E, F, I>(make_init: F) -> impl Init<T, E> where F: FnOnce() -> Result<I, E>, I: Init<T, E>, init_scope() argument 1350 unsafe impl<T> Init<T> for T { global() implementation 1360 unsafe impl<T> PinInit<T> for T { global() implementation 1398 write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E> write_init() argument 1403 write_pin_init<E>(self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> write_pin_init() argument 1407 type Initialized = &'static mut T; global() variable 1409 write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E> write_init() argument 1419 write_pin_init<E>(self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> write_pin_init() argument 1534 unsafe impl<T> ZeroableOption for &T {} global() implementation 1537 unsafe impl<T> ZeroableOption for &mut T {} global() implementation 1546 init_zeroed<T: Zeroable>() -> impl Init<T> init_zeroed() argument 1577 zeroed<T: Zeroable>() -> T zeroed() argument 1691 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1695 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1702 pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument 1710 pin_init<E>(init: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument [all...] |
| H A D | __internal.rs | 17 pub(crate) type Invariant<T> = PhantomData<fn(*mut T) -> *mut T>; 23 pub(crate) struct InitClosure<F, T: ?Sized, E>(pub(crate) F, pub(crate) Invariant<(E, T)>); 27 unsafe impl<T: ?Sized, F, E> Init<T, E> for InitClosure<F, T, E> 29 F: FnOnce(*mut T) -> Result<(), E>, 32 unsafe fn __init(self, slot: *mut T) -> Result<(), E> { in __init() 39 unsafe impl<T: ?Sized, F, E> PinInit<T, E> for InitClosure<F, T, E> 41 F: FnOnce(*mut T) -> Result<(), E>, 44 unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E> { in __pinned_init() 129 pub struct AllData<T: ?Sized>(Invariant<T>); 131 impl<T: ?Sized> Clone for AllData<T> { [all …]
|
| /linux/tools/perf/tests/ |
| H A D | kmod-path.c | 44 #define T(path, an, k, c, n) \ macro 53 T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]"); in test__kmod_path__parse() 54 T("/xxxx/xxxx/x-x.ko", false , true, 0 , NULL ); in test__kmod_path__parse() 55 T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]"); in test__kmod_path__parse() 56 T("/xxxx/xxxx/x-x.ko", false , true, 0 , NULL ); in test__kmod_path__parse() 63 T("/xxxx/xxxx/x.ko.gz", true , true, 1 , "[x]"); in test__kmod_path__parse() 64 T("/xxxx/xxxx/x.ko.gz", false , true, 1 , NULL ); in test__kmod_path__parse() 65 T("/xxxx/xxxx/x.ko.gz", true , true, 1 , "[x]"); in test__kmod_path__parse() 66 T("/xxxx/xxxx/x.ko.gz", false , true, 1 , NULL ); in test__kmod_path__parse() 72 T("/xxxx/xxxx/x.gz", true , false, 1 , "x.gz"); in test__kmod_path__parse() [all …]
|
| /linux/rust/kernel/sync/ |
| H A D | atomic.rs | 34 /// This has the same size, alignment and bit validity as the underlying type `T`. And it disables 46 /// `self.0` is a valid `T`. 52 pub struct Atomic<T: AtomicType>(AtomicRepr<T::Repr>); 54 // SAFETY: `Atomic<T>` is safe to transfer between execution contexts because of the safety 56 unsafe impl<T: AtomicType> Send for Atomic<T> {} 58 // SAFETY: `Atomic<T>` is safe to share among execution contexts because all accesses are atomic. 59 unsafe impl<T: AtomicType> Sync for Atomic<T> {} 140 from_repr<T: AtomicType>(r: T::Repr) -> T from_repr() argument 228 as_ptr(&self) -> *mut T as_ptr() argument 238 get_mut(&mut self) -> &mut T get_mut() argument 269 load<Ordering: ordering::AcquireOrRelaxed>(&self, _: Ordering) -> T load() argument 299 store<Ordering: ordering::ReleaseOrRelaxed>(&self, v: T, _: Ordering) store() argument 340 xchg<Ordering: ordering::Ordering>(&self, v: T, _: Ordering) -> T xchg() argument 413 cmpxchg<Ordering: ordering::Ordering>( &self, mut old: T, new: T, o: Ordering, ) -> Result<T, T> cmpxchg() argument 414 cmpxchg<Ordering: ordering::Ordering>( &self, mut old: T, new: T, o: Ordering, ) -> Result<T, T> cmpxchg() argument 416 cmpxchg<Ordering: ordering::Ordering>( &self, mut old: T, new: T, o: Ordering, ) -> Result<T, T> cmpxchg() argument 458 try_cmpxchg<Ordering: ordering::Ordering>(&self, old: &mut T, new: T, _: Ordering) -> bool try_cmpxchg() argument [all...] |
| H A D | aref.rs | 68 pub struct ARef<T: AlwaysRefCounted> { 69 ptr: NonNull<T>, 70 _p: PhantomData<T>, 77 unsafe impl<T: AlwaysRefCounted + Sync + Send> Send for ARef<T> {} 84 unsafe impl<T: AlwaysRefCounted + Sync + Send> Sync for ARef<T> {} 87 impl<T: AlwaysRefCounted> Unpin for ARef<T> {} 89 impl<T: AlwaysRefCounted> ARef<T> { 100 pub unsafe fn from_raw(ptr: NonNull<T>) -> Self { in from_raw() 136 pub fn into_raw(me: Self) -> NonNull<T> { in into_raw() argument 141 impl<T: AlwaysRefCounted> Clone for ARef<T> { [all …]
|
| /linux/rust/kernel/ |
| H A D | debugfs.rs | 98 fn create_file<'a, T, E: 'a>( in create_file() 101 data: impl PinInit<T, E> + 'a, 102 file_ops: &'static FileOps<T>, 103 ) -> impl PinInit<File<T>, E> + 'a 105 T: Sync + 'static, 107 let scope = Scope::<T>::new(data, move |data| { 165 pub fn read_only_file<'a, T, E: 'a>( 168 data: impl PinInit<T, E> + 'a, 169 ) -> impl PinInit<File<T>, E> + 'a 171 T argument 74 create_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, file_ops: &'static FileOps<T>, ) -> impl PinInit<File<T>, E> + 'a where T: Sync + 'static, create_file() argument 77 create_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, file_ops: &'static FileOps<T>, ) -> impl PinInit<File<T>, E> + 'a where T: Sync + 'static, create_file() argument 78 create_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, file_ops: &'static FileOps<T>, ) -> impl PinInit<File<T>, E> + 'a where T: Sync + 'static, create_file() argument 79 create_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, file_ops: &'static FileOps<T>, ) -> impl PinInit<File<T>, E> + 'a where T: Sync + 'static, create_file() argument 144 read_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Send + Sync + 'static, read_only_file() argument 147 read_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Send + Sync + 'static, read_only_file() argument 148 read_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Send + Sync + 'static, read_only_file() argument 174 read_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + Send + Sync + 'static, read_binary_file() argument 175 read_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + Send + Sync + 'static, read_binary_file() argument 208 read_callback_file<'a, T, E: 'a, F>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 211 read_callback_file<'a, T, E: 'a, F>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 213 read_callback_file<'a, T, E: 'a, F>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 216 read_callback_file<'a, T, E: 'a, F>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 226 read_write_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Reader + Send + Sync + 'static, read_write_file() argument 229 read_write_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Reader + Send + Sync + 'static, read_write_file() argument 230 read_write_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Writer + Reader + Send + Sync + 'static, read_write_file() argument 242 read_write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + BinaryReader + Send + Sync + 'static, read_write_binary_file() argument 245 read_write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + BinaryReader + Send + Sync + 'static, read_write_binary_file() argument 246 read_write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryWriter + BinaryReader + Send + Sync + 'static, read_write_binary_file() argument 260 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 263 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 266 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 269 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 270 read_write_callback_file<'a, T, E: 'a, F, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _f: &'static F, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 285 write_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Reader + Send + Sync + 'static, write_only_file() argument 288 write_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Reader + Send + Sync + 'static, write_only_file() argument 289 write_only_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: Reader + Send + Sync + 'static, write_only_file() argument 302 write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryReader + Send + Sync + 'static, write_binary_file() argument 305 write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryReader + Send + Sync + 'static, write_binary_file() argument 306 write_binary_file<'a, T, E: 'a>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, ) -> impl PinInit<File<T>, E> + 'a where T: BinaryReader + Send + Sync + 'static, write_binary_file() argument 317 write_callback_file<'a, T, E: 'a, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_callback_file() argument 320 write_callback_file<'a, T, E: 'a, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_callback_file() argument 322 write_callback_file<'a, T, E: 'a, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_callback_file() argument 325 write_callback_file<'a, T, E: 'a, W>( &'a self, name: &'a CStr, data: impl PinInit<T, E> + 'a, _w: &'static W, ) -> impl PinInit<File<T>, E> + 'a where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_callback_file() argument 364 scope<'a, T: 'a, E: 'a, F>( &'a self, data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Scope<T>, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, scope() argument 367 scope<'a, T: 'a, E: 'a, F>( &'a self, data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Scope<T>, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, scope() argument 369 scope<'a, T: 'a, E: 'a, F>( &'a self, data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Scope<T>, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, scope() argument 411 new<E: 'b, F>(data: impl PinInit<T, E> + 'b, init: F) -> impl PinInit<Self, E> + 'b where F: for<'a> FnOnce(&'a T) + 'b, new() argument 435 new<E: 'b, F>(data: impl PinInit<T, E> + 'b, init: F) -> impl PinInit<Self, E> + 'b where F: for<'a> FnOnce(&'a T) -> Entry<'static> + 'b, new() argument 463 dir<E: 'a, F>( data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Self, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, dir() argument 468 dir<E: 'a, F>( data: impl PinInit<T, E> + 'a, name: &'a CStr, init: F, ) -> impl PinInit<Self, E> + 'a where F: for<'data, 'dir> FnOnce(&'data T, &'dir ScopedDir<'data, 'dir>) + 'a, dir() argument 480 deref(&self) -> &T deref() argument 487 deref(&self) -> &T deref() argument 517 create_file<T: Sync>(&self, name: &CStr, data: &'data T, vtable: &'static FileOps<T>) create_file() argument 529 read_only_file<T: Writer + Send + Sync + 'static>(&self, name: &CStr, data: &'data T) read_only_file() argument 542 read_binary_file<T: BinaryWriter + Send + Sync + 'static>( &self, name: &CStr, data: &'data T, ) read_binary_file() argument 558 read_callback_file<T, F>(&self, name: &CStr, data: &'data T, _f: &'static F) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 561 read_callback_file<T, F>(&self, name: &CStr, data: &'data T, _f: &'static F) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, read_callback_file() argument 578 read_write_file<T: Writer + Reader + Send + Sync + 'static>( &self, name: &CStr, data: &'data T, ) read_write_file() argument 594 read_write_binary_file<T: BinaryWriter + BinaryReader + Send + Sync + 'static>( &self, name: &CStr, data: &'data T, ) read_write_binary_file() argument 610 read_write_callback_file<T, F, W>( &self, name: &CStr, data: &'data T, _f: &'static F, _w: &'static W, ) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 613 read_write_callback_file<T, F, W>( &self, name: &CStr, data: &'data T, _f: &'static F, _w: &'static W, ) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 618 read_write_callback_file<T, F, W>( &self, name: &CStr, data: &'data T, _f: &'static F, _w: &'static W, ) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 619 read_write_callback_file<T, F, W>( &self, name: &CStr, data: &'data T, _f: &'static F, _w: &'static W, ) where T: Send + Sync + 'static, F: Fn(&T, &mut fmt::Formatter<'_>) -> fmt::Result + Send + Sync, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, read_write_callback_file() argument 634 write_only_file<T: Reader + Send + Sync + 'static>(&self, name: &CStr, data: &'data T) write_only_file() argument 648 write_binary_file<T: BinaryReader + Send + Sync + 'static>( &self, name: &CStr, data: &'data T, ) write_binary_file() argument 663 write_only_callback_file<T, W>(&self, name: &CStr, data: &'data T, _w: &'static W) where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_only_callback_file() argument 666 write_only_callback_file<T, W>(&self, name: &CStr, data: &'data T, _w: &'static W) where T: Send + Sync + 'static, W: Fn(&T, &mut UserSliceReader) -> Result + Send + Sync, write_only_callback_file() argument [all...] |
| H A D | list.rs | 173 /// struct DTWrap<T: ?Sized> { 176 /// value: T, 179 /// impl<T> DTWrap<T> { 180 /// fn new(value: T) -> Result<ListArc<Self>> { 189 /// impl{T: ?Sized} ListArcSafe<0> for DTWrap<T> { untracked; } 279 pub struct List<T: ?Sized + ListItem<ID>, const ID: u64 = 0> { 281 _ty: PhantomData<ListArc<T, ID>>, 284 // SAFETY: This is a container of `ListArc<T, I 460 raw_get_self_ptr(me: *const Self) -> *const Opaque<*const T> raw_get_self_ptr() argument 491 insert_inner( &mut self, item: ListArc<T, ID>, next: *mut ListLinksFields, ) -> *mut ListLinksFields insert_inner() argument 534 push_back(&mut self, item: ListArc<T, ID>) push_back() argument 542 push_front(&mut self, item: ListArc<T, ID>) push_front() argument 553 pop_back(&mut self) -> Option<ListArc<T, ID>> pop_back() argument 565 pop_front(&mut self) -> Option<ListArc<T, ID>> pop_front() argument 585 remove(&mut self, item: &T) -> Option<ListArc<T, ID>> remove() argument 626 remove_internal(&mut self, item: *mut ListLinksFields) -> ListArc<T, ID> remove_internal() argument 645 remove_internal_inner( &mut self, item: *mut ListLinksFields, next: *mut ListLinksFields, prev: *mut ListLinksFields, ) -> ListArc<T, ID> remove_internal_inner() argument 693 push_all_back(&mut self, other: &mut List<T, ID>) push_all_back() argument 722 cursor_front(&mut self) -> Cursor<'_, T, ID> cursor_front() argument 731 cursor_back(&mut self) -> Cursor<'_, T, ID> cursor_back() argument 740 iter(&self) -> Iter<'_, T, ID> iter() argument 782 next(&mut self) -> Option<ArcBorrow<'a, T>> next() argument 979 peek_next(&mut self) -> Option<CursorPeek<'_, 'a, T, true, ID>> peek_next() argument 994 peek_prev(&mut self) -> Option<CursorPeek<'_, 'a, T, false, ID>> peek_prev() argument 1047 insert_inner(&mut self, item: ListArc<T, ID>) -> *mut ListLinksFields insert_inner() argument 1065 insert(mut self, item: ListArc<T, ID>) insert() argument 1076 insert_next(&mut self, item: ListArc<T, ID>) insert_next() argument 1083 insert_prev(&mut self, item: ListArc<T, ID>) insert_prev() argument 1088 remove_next(&mut self) -> Option<ListArc<T, ID>> remove_next() argument 1093 remove_prev(&mut self) -> Option<ListArc<T, ID>> remove_prev() argument 1113 remove(self) -> ListArc<T, ID> remove() argument 1126 arc(&self) -> ArcBorrow<'_, T> arc() argument 1153 deref(&self) -> &T deref() argument 1173 into_iter(self) -> Iter<'a, T, ID> into_iter() argument 1186 next(&mut self) -> Option<ListArc<T, ID>> next() argument 1194 next_back(&mut self) -> Option<ListArc<T, ID>> next_back() argument 1203 into_iter(self) -> IntoIter<T, ID> into_iter() argument [all...] |
| H A D | types.rs | 104 /// Note that for types like [`Arc`], an `&mut Arc<T>` only gives you immutable access to the 107 /// In the case of `Box<T>`, this method gives you the ability to modify the inner `T`, but it 218 pub struct ScopeGuard<T, F: FnOnce(T)>(Option<(T, F)>); 220 impl<T, F: FnOnce(T)> ScopeGuard<T, F> { 222 pub fn new_with_data(data: T, cleanup_fun 224 new_with_data(data: T, cleanup_func: F) -> Self new_with_data() argument 230 dismiss(mut self) -> T dismiss() argument 247 deref(&self) -> &T deref() argument 254 deref_mut(&mut self) -> &mut T deref_mut() argument 394 get(&self) -> *mut T get() argument 402 cast_into(this: *const Self) -> *mut T cast_into() argument 414 pin_init<E>(slot: impl PinInit<T, E>) -> impl PinInit<Self, E> pin_init() argument [all...] |
| H A D | maple_tree.rs | 29 pub struct MapleTree<T: ForeignOwnable> { 32 _p: PhantomData<T>, 40 pub struct MapleTreeAlloc<T: ForeignOwnable> { 42 tree: MapleTree<T>, 46 impl<T: ForeignOwnable> core::ops::Deref for MapleTreeAlloc<T> { 47 type Target = MapleTree<T>; 50 fn deref(&self) -> &MapleTree<T> { in deref() argument 76 impl<T: ForeignOwnable> MapleTree<T> { 121 pub fn insert(&self, index: usize, value: T, gfp: Flags) -> Result<(), InsertError<T>> { in insert() argument 169 pub fn insert_range<R>(&self, range: R, value: T, gfp: Flags) -> Result<(), InsertError<T>> in insert_range() argument [all …]
|
| H A D | xarray.rs | 18 /// This is similar to a [`crate::alloc::kvec::Vec<Option<T>>`], but more efficient when there are 24 /// `XA_ZERO_ENTRY` or came from `T::into_foreign`. 56 pub struct XArray<T: ForeignOwnable> { 59 _p: PhantomData<T>, 63 impl<T: ForeignOwnable> PinnedDrop for XArray<T> { 67 // SAFETY: `ptr` came from `T::into_foreign`. in drop() 71 drop(unsafe { T::from_foreign(ptr) }) in drop() 87 impl<T: ForeignOwnable> XArray<T> { 122 try_lock(&self) -> Option<Guard<'_, T>> try_lock() argument 135 lock(&self) -> Guard<'_, T> lock() argument 208 remove(&mut self, index: usize) -> Option<T> remove() argument 230 store( &mut self, index: usize, value: T, gfp: alloc::Flags, ) -> Result<Option<T>, StoreError<T>> store() argument 232 store( &mut self, index: usize, value: T, gfp: alloc::Flags, ) -> Result<Option<T>, StoreError<T>> store() argument [all...] |
| /linux/rust/kernel/debugfs/ |
| H A D | file_ops.rs | 28 /// `FileOps<T>` will always contain an `operations` which is safe to use for a file backed 29 /// off an inode which has a pointer to a `T` in its private data that is safe to convert 31 pub(super) struct FileOps<T> { 36 _phantom: PhantomData<T>, in new() 39 impl<T> FileOps<T> { in new() 43 /// inode has a pointer to `T` in its private data that is safe to convert into a reference. in new() 60 impl<T: Adapter> FileOps<T> { 61 pub(super) const fn adapt(&self) -> &FileOps<T 122 impl<T: Writer + Sync> ReadFile<T> for T { global() implementation 140 read<T: Reader + Sync>(data: &T, buf: *const c_char, count: usize) -> isize read() argument 165 let data = unsafe { &*(seq.private as *const T) }; write() constant 174 impl<T: Writer + Reader + Sync> ReadWriteFile<T> for T { global() implementation 224 let data = unsafe { &*((*file).private_data as *const T) }; write_only_write() constant 232 impl<T: Reader + Sync> WriteFile<T> for T { global() implementation 285 impl<T: BinaryWriter + Sync> BinaryReadFile<T> for T { global() implementation 340 impl<T: BinaryReader + Sync> BinaryWriteFile<T> for T { global() implementation 365 impl<T: BinaryWriter + BinaryReader + Sync> BinaryReadWriteFile<T> for T { global() implementation [all...] |
| H A D | traits.rs | 53 impl<T: Writer> Writer for Mutex<T> { in write_to_slice() 59 impl<T: fmt::Debug> Writer for T { implementation 79 // Base implementation for any `T: AsBytes`. in write_to_slice() 80 impl<T: AsBytes> BinaryWriter for T { 90 // Delegate for `Mutex<T>`: Support a `T` with an outer mutex. in write_to_slice() 91 impl<T in write_to_slice() 38 impl<T: fmt::Debug> Writer for T { global() implementation 213 impl<T: AsBytes + FromBytes> BinaryReaderMut for T { global() implementation [all...] |
| /linux/rust/proc-macro2/ |
| H A D | rcvec.rs | 9 pub(crate) struct RcVec<T> { 10 inner: Rc<Vec<T>>, 13 pub(crate) struct RcVecBuilder<T> { 14 inner: Vec<T>, 17 pub(crate) struct RcVecMut<'a, T> { 18 inner: &'a mut Vec<T>, 22 pub(crate) struct RcVecIntoIter<T> { 23 inner: vec::IntoIter<T>, 26 impl<T> RcVec<T> { 35 pub(crate) fn iter(&self) -> slice::Iter<T> { in iter() argument [all …]
|
| /linux/rust/kernel/drm/ |
| H A D | device.rs | 77 pub struct Device<T: drm::Driver> { 79 data: T::Data, 82 impl<T: drm::Driver> Device<T> { 85 open: Some(drm::File::<T::File>::open_callback), 86 postclose: Some(drm::File::<T::File>::postclose_callback), 92 gem_create_object: T::Object::ALLOC_OPS.gem_create_object, 93 prime_handle_to_fd: T::Object::ALLOC_OPS.prime_handle_to_fd, 94 prime_fd_to_handle: T::Object::ALLOC_OPS.prime_fd_to_handle, 95 gem_prime_import: T::Object::ALLOC_OPS.gem_prime_import, 96 gem_prime_import_sg_table: T::Object::ALLOC_OPS.gem_prime_import_sg_table, [all …]
|
| /linux/rust/kernel/list/ |
| H A D | arc.rs | 19 /// a [`ListArc`] exists or not. We refer to this logic as "the tracking inside `T`". 21 /// We allow the case where the tracking inside `T` thinks that a [`ListArc`] exists, but actually, 28 /// A consequence of the above is that you may implement the tracking inside `T` by not actually 144 /// relevant tracking is referred to as "the tracking inside `T`", and the [`ListArcSafe`] trait 147 /// Note that we allow the case where the tracking inside `T` thinks that a `ListArc` exists, but 159 /// * The tracking inside `T` is aware that a `ListArc` reference exists. 164 pub struct ListArc<T, const ID: u64 = 0> 166 T: ListArcSafe<ID> + ?Sized, 168 arc: Arc<T>, 171 impl<T 173 new(contents: T, flags: Flags) -> Result<Self, AllocError> new() argument 183 pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Self, E> where E: From<AllocError>, pin_init() argument 194 init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> where E: From<AllocError>, init() argument 237 pair_from_unique<const ID2: u64>(unique: UniqueArc<T>) -> (Self, ListArc<T, ID2>) where T: ListArcSafe<ID2>, pair_from_unique() argument 249 pair_from_pin_unique<const ID2: u64>( mut unique: Pin<UniqueArc<T>>, ) -> (Self, ListArc<T, ID2>) where T: ListArcSafe<ID2>, pair_from_pin_unique() argument 250 pair_from_pin_unique<const ID2: u64>( mut unique: Pin<UniqueArc<T>>, ) -> (Self, ListArc<T, ID2>) where T: ListArcSafe<ID2>, pair_from_pin_unique() argument 337 transmute_to_arc(self) -> Arc<T> transmute_to_arc() argument 349 into_raw(self) -> *const T into_raw() argument 371 into_arc(self) -> Arc<T> into_arc() argument 380 clone_arc(&self) -> Arc<T> clone_arc() argument 391 as_arc(&self) -> &Arc<T> as_arc() argument 400 as_arc_borrow(&self) -> ArcBorrow<'_, T> as_arc_borrow() argument 440 as_ref(&self) -> &Arc<T> as_ref() argument [all...] |
| /linux/rust/kernel/ptr/ |
| H A D | projection.rs | 39 pub unsafe trait ProjectIndex<T: ?Sized>: Sized { 43 fn get(self, slice: *mut T) -> Option<*mut Self::Output>; in get() 47 fn index(self, slice: *mut T) -> *mut Self::Output { in index() 55 unsafe impl<T, I, const N: usize> ProjectIndex<[T; N]> for I 57 I: ProjectIndex<[T]>, 59 type Output = <I as ProjectIndex<[T]>>::Output; 62 fn get(self, slice: *mut [T; N]) -> Option<*mut Self::Output> { in get() 63 <I as ProjectIndex<[T]>>::get(self, slice) 67 fn index(self, slice: *mut [T; N]) -> *mut Self::Output { in index() 68 <I as ProjectIndex<[T]>>::index(self, slice) [all …]
|
| /linux/drivers/comedi/drivers/tests/ |
| H A D | ni_routes_test.c | 310 const struct ni_route_tables *T = &private.routing_tables; in test_ni_route_to_register() local 313 unittest(ni_route_to_register(O(0), O(0), T) < 0, in test_ni_route_to_register() 315 unittest(ni_route_to_register(O(1), O(0), T) == 1, in test_ni_route_to_register() 317 unittest(ni_route_to_register(O(6), O(5), T) == 6, in test_ni_route_to_register() 319 unittest(ni_route_to_register(O(8), O(9), T) == 8, in test_ni_route_to_register() 323 unittest(ni_route_to_register(rgout0_src0, TRIGGER_LINE(0), T) == 0, in test_ni_route_to_register() 325 unittest(ni_route_to_register(rgout0_src0, TRIGGER_LINE(1), T) == 0, in test_ni_route_to_register() 327 unittest(ni_route_to_register(rgout0_src1, TRIGGER_LINE(2), T) == 1, in test_ni_route_to_register() 329 unittest(ni_route_to_register(rgout0_src1, TRIGGER_LINE(3), T) == 1, in test_ni_route_to_register() 332 unittest(ni_route_to_register(brd0_src0, TRIGGER_LINE(4), T) == in test_ni_route_to_register() [all …]
|
| /linux/tools/testing/selftests/rcutorture/bin/ |
| H A D | torture.sh | 264 T="`mktemp -d ${TMPDIR-/tmp}/torture.sh.XXXXXX`" 265 trap 'rm -rf $T' 0 2 267 echo " --- " $scriptname $args | tee -a $T/log 268 echo " --- Results directory: " $ds | tee -a $T/log 276 echo " --- Everything disabled, so explicit --do-normal overridden" | tee -a $T/log 289 echo " --- Zero time for rcutorture, disabling" | tee -a $T/log 301 echo " --- Zero time for locktorture, disabling" | tee -a $T/log 313 echo " --- Zero time for scftorture, disabling" | tee -a $T/log 324 touch $T/failures 325 touch $T/successe [all...] |
| /linux/rust/kernel/drm/gem/ |
| H A D | shmem.rs | 43 pub struct ObjectConfig<'a, T: DriverObject> { 50 pub parent_resv_obj: Option<&'a Object<T>>, 61 pub struct Object<T: DriverObject> { 65 parent_resv_obj: Option<ARef<Object<T>>>, 67 inner: T, 70 super::impl_aref_for_gem_obj!(impl<T> for Object<T> where T: DriverObject); 73 unsafe impl<T: DriverObject> Send for Object<T> {} 76 unsafe impl<T: DriverObject> Sync for Object<T> {} 78 impl<T: DriverObject> Object<T> { 82 open: Some(super::open_callback::<T>), [all …]
|