| /linux/rust/kernel/ |
| H A D | sizes.rs | 7 //! The top-level `SZ_*` constants are [`usize`]-typed, for use in kernel page 11 //! on [`u32`], [`u64`], and [`usize`], for use in device address spaces where 13 //! these constants as [`u64`] (or [`u32`]) rather than [`usize`], because 119 pub const $name: usize = bindings::$name as usize; 124 /// Implemented for [`u32`], [`u64`], and [`usize`] so drivers can 179 define_sizes!(u32, u64, usize);
|
| H A D | bitmap.rs | 67 pub unsafe fn from_raw<'a>(ptr: *const usize, nbits: usize) -> &'a Bitmap { in from_raw_mut() 69 nbits <= i32::MAX as usize, in from_raw_mut() 104 pub unsafe fn from_raw_mut<'a>(ptr: *mut usize, nbits: usize) -> &'a mut Bitmap { 106 nbits <= i32::MAX as usize, 127 pub fn as_ptr(&self) -> *const usize { 128 core::ptr::from_ref::<Bitmap>(self).cast::<usize>() 132 pub fn as_mut_ptr(&mut self) -> *mut usize { 133 core::ptr::from_mut::<Bitmap>(self).cast::<usize>() 35 from_raw<'a>(ptr: *const usize, nbits: usize) -> &'a Bitmap from_raw() argument 60 from_raw_mut<'a>(ptr: *mut usize, nbits: usize) -> &'a mut Bitmap from_raw_mut() argument 76 as_ptr(&self) -> *const usize as_ptr() argument 81 as_mut_ptr(&mut self) -> *mut usize as_mut_ptr() argument 87 len(&self) -> usize len() argument 248 new(nbits: usize, flags: Flags) -> Result<Self, AllocError> new() argument 272 len(&self) -> usize len() argument 306 set_bit(&mut self, index: usize) set_bit() argument 332 set_bit_atomic(&self, index: usize) set_bit_atomic() argument 357 clear_bit(&mut self, index: usize) clear_bit() argument 383 clear_bit_atomic(&self, index: usize) clear_bit_atomic() argument 450 last_bit(&self) -> Option<usize> last_bit() argument 464 next_bit(&self, start: usize) -> Option<usize> next_bit() argument 484 next_zero_bit(&self, start: usize) -> Option<usize> next_zero_bit() argument [all...] |
| H A D | device_id.rs | 45 /// This field must be correctly sized to hold a `usize`. 51 const DRIVER_DATA_OFFSET: usize; 91 pub struct IdArray<T: RawDeviceId, U: 'static, const N: usize> { 101 unsafe impl<T: RawDeviceId, U: Sync + 'static, const N: usize> Send for IdArray<T, U, N> {} 105 unsafe impl<T: RawDeviceId, U: Sync + 'static, const N: usize> Sync for IdArray<T, U, N> {} 107 impl<T: RawDeviceId + RawDeviceIdIndex, U: 'static, const N: usize> IdArray<T, U, N> { 114 let mut i = 0usize; 142 impl<T: RawDeviceId, const N: usize> IdArray<T, (), N> { in raw_ids() 170 impl<T: RawDeviceId, U, const N: usize> IdTable<T, U> for IdArray<T, U, N> { in id() 52 index(&self) -> usize index() argument 64 size(&self) -> usize size() argument
|
| H A D | ptr.rs | 34 pub struct Alignment(NonZero<usize>); 51 pub const fn new<const ALIGN: usize>() -> Self { in new() 78 pub const fn new_checked(align: usize) -> Option<Self> { in new_checked() 99 /// Returns this alignment as a [`usize`]. 111 pub const fn as_usize(self) -> usize { 127 pub const fn as_nonzero(self) -> NonZero<usize> { in as_nonzero() 165 pub const fn mask(self) -> usize { in mask() 173 const VALUE: Self = match Alignment::new_checked(<usize as FromConst<V>>::VALUE) { 242 impl_alignable_uint!(u8, u16, u32, u64, usize); 249 const MIN_SIZE: usize; 108 as_usize(self) -> usize as_usize() argument 124 as_nonzero(self) -> NonZero<usize> as_nonzero() argument 162 mask(self) -> usize mask() argument 239 size(p: *const Self) -> usize size() argument 244 size(_: *const Self) -> usize size() argument 251 size(p: *const Self) -> usize size() argument 278 const_align_up(value: usize, align: Alignment) -> Option<usize> const_align_up() argument [all...] |
| H A D | uaccess.rs | 30 pub fn from_addr(addr: usize) -> Self { in from_addr() 61 pub fn wrapping_byte_add(self, add: usize) -> UserPtr { in wrapping_byte_add() 97 /// fn bytes_add_one(uptr: UserPtr, len: usize) -> Result { 119 /// fn is_valid(uptr: UserPtr, len: usize) -> Result<bool> { 129 /// fn get_bytes_if_valid(uptr: UserPtr, len: usize) -> Result<KVec<u8>> { 151 length: usize, 167 pub fn new(ptr: UserPtr, length: usize) -> Self { in new() 216 length: usize, 223 pub fn skip(&mut self, num_skip: usize) -> Result { in skip() 246 pub fn len(&self) -> usize { in len() argument 299 read_slice_partial(&mut self, out: &mut [u8], offset: usize) -> Result<usize> read_slice_partial() argument 318 read_slice_file(&mut self, out: &mut [u8], offset: &mut file::Offset) -> Result<usize> read_slice_file() argument 455 len(&self) -> usize len() argument 531 write_dma<T: KnownSize + AsBytes + ?Sized>( &mut self, alloc: &Coherent<T>, offset: usize, count: usize, ) -> Result write_dma() argument 532 write_dma<T: KnownSize + AsBytes + ?Sized>( &mut self, alloc: &Coherent<T>, offset: usize, count: usize, ) -> Result write_dma() argument 561 write_slice_partial(&mut self, data: &[u8], offset: usize) -> Result<usize> write_slice_partial() argument 580 write_slice_file(&mut self, data: &[u8], offset: &mut file::Offset) -> Result<usize> write_slice_file() argument 641 raw_strncpy_from_user(dst: &mut [MaybeUninit<u8>], src: UserPtr) -> Result<usize> raw_strncpy_from_user() argument [all...] |
| H A D | io.rs | 61 /// // Fallible conversion to `usize` (can truncate on 32-bit). 62 /// assert_eq!(usize::try_from(size)?, 0x1000); 103 impl TryFrom<ResourceSize> for usize { 123 pub struct Region<const SIZE: usize = 0> { 127 impl<const SIZE: usize> Region<SIZE> { 136 pub fn ptr_from_raw_parts_mut(base: *mut u8, size: usize) -> *mut Self { 145 pub fn ptr_try_from_raw_parts_mut(base: *mut u8, size: usize) -> Result<*mut Self> { in new() 154 impl<const SIZE: usize> KnownSize for Region<SIZE> { 155 const MIN_SIZE: usize = SIZE; in new_region() argument 160 fn size(p: *const Self) -> usize { 92 size(p: *const Self) -> usize size() argument 165 addr(&self) -> usize addr() argument 171 size(&self) -> usize size() argument 181 offset_valid<U>(base: usize, offset: usize, size: usize) -> bool offset_valid() argument 194 io_view_assert<'a, IO: Io<'a>, U>( this: IO, offset: usize, ) -> <IO::Backend as IoBackend>::View<'a, U> io_view_assert() argument 214 io_view<'a, IO: Io<'a>, U>( this: IO, offset: usize, ) -> Result<<IO::Backend as IoBackend>::View<'a, U>> io_view() argument 366 offset(self) -> usize offset() argument 418 size(self) -> usize size() argument [all...] |
| H A D | maple_tree.rs | 60 fn to_maple_range(range: impl RangeBounds<usize>) -> Option<(usize, usize)> { in to_maple_range() 70 Bound::Unbounded => usize::MAX, in to_maple_range() 125 pub fn insert(&self, index: usize, value: T, gfp: Flags) -> Result<(), InsertError<T>> { 175 R: RangeBounds<usize>, in insert_range() 231 pub fn erase(&self, index: usize) -> Option<T> { in erase() 270 let mut ma_state = unsafe { MaState::new_raw(self.into_ref().get_ref(), 0, usize::MAX) }; in free_all_entries() 283 ma_state.mas_find_raw(usize::MAX) in free_all_entries() 341 pub fn ma_state(&mut self, first: usize, en 56 to_maple_range(range: impl RangeBounds<usize>) -> Option<(usize, usize)> to_maple_range() argument 121 insert(&self, index: usize, value: T, gfp: Flags) -> Result<(), InsertError<T>> insert() argument 171 insert_range<R>(&self, range: R, value: T, gfp: Flags) -> Result<(), InsertError<T>> where R: RangeBounds<usize>, insert_range() argument 323 ma_state(&mut self, first: usize, end: usize) -> MaState<'_, T> ma_state() argument 442 alloc_range<R>( &self, size: usize, value: T, range: R, gfp: Flags, ) -> Result<usize, AllocError<T>> where R: RangeBounds<usize>, alloc_range() argument 446 alloc_range<R>( &self, size: usize, value: T, range: R, gfp: Flags, ) -> Result<usize, AllocError<T>> where R: RangeBounds<usize>, alloc_range() argument 448 alloc_range<R>( &self, size: usize, value: T, range: R, gfp: Flags, ) -> Result<usize, AllocError<T>> where R: RangeBounds<usize>, alloc_range() argument 511 new_raw(mt: &'tree MapleTree<T>, first: usize, end: usize) -> Self new_raw() argument [all...] |
| H A D | id_pool.rs | 58 /// fn get_id_maybe_realloc(guarded_pool: &SpinLock<IdPool>) -> Result<usize, AllocError> { 80 num_ids: usize, 120 pub fn with_capacity(num_ids: usize, flags: Flags) -> Result<Self, AllocError> { 121 let num_ids = usize::max(num_ids, BitmapVec::MAX_INLINE_LEN); 128 pub fn capacity(&self) -> usize { 176 let num_ids = usize::max(BitmapVec::MAX_INLINE_LEN, cap / 2); in shrink() 242 pub fn find_unused_id(&mut self, offset: usize) -> Option<UnusedId<'_>> { in release_id() 259 pub fn release_id(&mut self, id: usize) { 272 offset: usize, 273 count: NonZero<usize>, 114 with_capacity(num_ids: usize, flags: Flags) -> Result<Self, AllocError> with_capacity() argument 122 capacity(&self) -> usize capacity() argument 240 release_id(&mut self, id: usize) release_id() argument 264 as_usize(&self) -> usize as_usize() argument 284 acquire(self) -> usize acquire() argument [all...] |
| /linux/lib/crypto/mpi/ |
| H A D | mpi-add.c | 21 mpi_size_t usize, vsize, wsize; in mpi_add() local 26 usize = v->nlimbs; in mpi_add() 30 wsize = usize + 1; in mpi_add() 38 usize = u->nlimbs; in mpi_add() 42 wsize = usize + 1; in mpi_add() 54 MPN_COPY(wp, up, usize); in mpi_add() 55 wsize = usize; in mpi_add() 59 if (usize != vsize) { in mpi_add() 60 mpihelp_sub(wp, up, usize, vp, vsize); in mpi_add() 61 wsize = usize; in mpi_add() [all …]
|
| H A D | mpi-cmp.c | 52 mpi_size_t usize, vsize; in mpi_cmp() local 57 usize = u->nlimbs; in mpi_cmp() 63 if (usize != vsize && !u->sign && !v->sign) in mpi_cmp() 64 return usize - vsize; in mpi_cmp() 65 if (usize != vsize && u->sign && v->sign) in mpi_cmp() 66 return vsize - usize; in mpi_cmp() 67 if (!usize) in mpi_cmp() 69 cmp = mpihelp_cmp(u->d, v->d, usize); in mpi_cmp()
|
| H A D | mpih-mul.c | 322 mpi_ptr_t up, mpi_size_t usize, in mpihelp_mul_karatsuba_case() argument 341 usize -= vsize; in mpihelp_mul_karatsuba_case() 342 if (usize >= vsize) { in mpihelp_mul_karatsuba_case() 363 usize -= vsize; in mpihelp_mul_karatsuba_case() 364 } while (usize >= vsize); in mpihelp_mul_karatsuba_case() 367 if (usize) { in mpihelp_mul_karatsuba_case() 368 if (usize < KARATSUBA_THRESHOLD) { in mpihelp_mul_karatsuba_case() 370 if (mpihelp_mul(ctx->tspace, vp, vsize, up, usize, &tmp) in mpihelp_mul_karatsuba_case() 381 up, usize, in mpihelp_mul_karatsuba_case() 387 mpihelp_add_1(prodp + vsize, ctx->tspace + vsize, usize, cy); in mpihelp_mul_karatsuba_case() [all …]
|
| H A D | mpi-mul.c | 20 mpi_size_t usize, vsize, wsize; in mpi_mul() local 30 usize = v->nlimbs; in mpi_mul() 37 usize = u->nlimbs; in mpi_mul() 48 wsize = usize + vsize; in mpi_mul() 64 up = tmp_limb = mpi_alloc_limb_space(usize); in mpi_mul() 71 MPN_COPY(up, wp, usize); in mpi_mul() 85 err = mpihelp_mul(wp, up, usize, vp, vsize, &cy); in mpi_mul()
|
| /linux/rust/kernel/pci/ |
| H A D | io.rs | 32 #[repr(usize)] 45 pub const fn into_raw(self) -> usize { in into_raw() 47 // within `usize` without truncation or sign change. in into_raw() 48 self as usize 170 pub struct Bar<'a, const SIZE: usize = 0> { in new() 176 impl<const SIZE: usize> ForLt for Bar<'static, SIZE> { in new() 182 unsafe impl<const SIZE: usize> CovariantForLt for Bar<'static, SIZE> {} in new() 187 pub type DevresBar<const SIZE: usize = 0> = DevresLt<Bar<'static, SIZE>>; in new() 189 impl<'a, const SIZE: usize> Bar<'a, SIZE> { in new() 216 let ioptr: usize in do_release() 43 into_raw(self) -> usize into_raw() argument 125 addr(&self) -> usize addr() argument 131 maxsize(&self) -> usize maxsize() argument 209 do_release(pdev: &Device, ioptr: usize, num: i32) do_release() argument [all...] |
| /linux/drivers/android/binder/range_alloc/ |
| H A D | mod.rs | 19 fn new(is_oneway: bool, debug_id: usize, pid: Pid) -> Self { in new() argument 44 debug_id: usize, 68 fn debug_id(&self) -> usize { in debug_id() argument 79 const TREE_THRESHOLD: usize = 8; 84 pub(crate) start_page_idx: usize, 85 pub(crate) end_page_idx: usize, 89 fn interior_pages(offset: usize, size: usize) -> FreedRange { in interior_pages() argument 100 offset: usize, 101 size: usize, 106 endpoint(&self) -> usize endpoint() argument 128 free_oneway_space(&self) -> usize free_oneway_space() argument 136 count_buffers(&self) -> usize count_buffers() argument 245 reservation_commit(&mut self, offset: usize, data: &mut Option<T>) -> Result reservation_commit() argument 256 reserve_existing(&mut self, offset: usize) -> Result<(usize, usize, Option<T>)> reserve_existing() argument 267 take_for_each<F: Fn(usize, usize, usize, Option<T>)>(&mut self, callback: F) take_for_each() argument [all...] |
| H A D | array.rs | 26 size: usize, 27 free_oneway_space: usize, 34 insert_at_idx: usize, 36 insert_at_offset: usize, 40 pub(crate) fn new(size: usize, alloc: EmptyArrayAlloc<T>) -> Self { in new() argument 48 pub(crate) fn free_oneway_space(&self) -> usize { in free_oneway_space() argument 52 pub(crate) fn count_buffers(&self) -> usize { in count_buffers() argument 56 pub(crate) fn total_size(&self) -> usize { in total_size() argument 90 fn find_empty_range(&self, size: usize) -> Option<FindEmptyRes> { in find_empty_range() 117 debug_id: usize, in reserve_new() argument 118 reserve_new( &mut self, debug_id: usize, size: usize, is_oneway: bool, pid: Pid, ) -> Result<(usize, bool)> reserve_new() argument 121 reserve_new( &mut self, debug_id: usize, size: usize, is_oneway: bool, pid: Pid, ) -> Result<(usize, bool)> reserve_new() argument 223 reservation_commit(&mut self, offset: usize, data: &mut Option<T>) -> Result reservation_commit() argument 239 reserve_existing(&mut self, offset: usize) -> Result<(usize, usize, Option<T>)> reserve_existing() argument 257 take_for_each<F: Fn(usize, usize, usize, Option<T>)>(&mut self, callback: F) take_for_each() argument [all...] |
| H A D | tree.rs | 25 tree: RBTree<usize, Descriptor<T>>, 29 size: usize, 30 free_oneway_space: usize, 35 size: usize, in from_array() argument 99 pub(crate) fn total_size(&self) -> usize { in total_size() argument 103 pub(crate) fn free_oneway_space(&self) -> usize { in free_oneway_space() argument 107 pub(crate) fn count_buffers(&self) -> usize { in count_buffers() argument 142 fn find_best_match(&mut self, size: usize) -> Option<&mut Descriptor<T>> { in find_best_match() 151 debug_id: usize, in reserve_new() argument 152 size: usize, in reserve_new() argument 156 reserve_new( &mut self, debug_id: usize, size: usize, is_oneway: bool, pid: Pid, alloc: ReserveNewTreeAlloc<T>, ) -> Result<(usize, bool)> reserve_new() argument 309 reservation_commit(&mut self, offset: usize, data: &mut Option<T>) -> Result reservation_commit() argument 328 reserve_existing(&mut self, offset: usize) -> Result<(usize, usize, Option<T>)> reserve_existing() argument 361 take_for_each<F: Fn(usize, usize, usize, Option<T>)>(&mut self, callback: F) take_for_each() argument 407 new(offset: usize, size: usize) -> Self new() argument 452 initialize( self, desc: Descriptor<T>, ) -> ( RBTreeNode<usize, Descriptor<T>>, RBTreeNode<FreeKey, ()>, FreeNodeRes, ) initialize() argument [all...] |
| /linux/drivers/gpu/drm/ |
| H A D | drm_panic_qr.rs | |
| /linux/rust/zerocopy/src/util/ |
| H A D | mod.rs | 71 pub(crate) fn miri_promise_symbolic_alignment(ptr: *const (), align: usize); in miri_promise_symbolic_alignment() argument 75 fn addr(self) -> usize; in addr() argument 80 fn addr(self) -> usize { in addr() argument 88 fn addr(self) -> usize { in addr() argument 96 fn addr(self) -> usize { in addr() argument 103 fn addr(self) -> usize { in addr() argument 105 // Use `.addr()` instead of `as usize` once it's stable, and get rid of in addr() 106 // this `allow`. Currently, `as usize` is the only way to accomplish in addr() 113 return self.cast::<()>() as usize; in addr() 119 fn addr(self) -> usize { in addr() argument 155 padding_needed_for(len: usize, align: NonZeroUsize) -> usize padding_needed_for() argument 237 round_down_to_next_multiple_of_alignment( n: usize, align: NonZeroUsize, ) -> usize round_down_to_next_multiple_of_alignment() argument 239 round_down_to_next_multiple_of_alignment( n: usize, align: NonZeroUsize, ) -> usize round_down_to_next_multiple_of_alignment() argument 592 validate_cast_and_convert_metadata( addr: usize, bytes_len: MetadataOf<[u8]>, cast_type: CastType, meta: Option<T::PointerMetadata>, ) -> Result<(MetadataOf<T>, MetadataOf<[u8]>), MetadataCastError> validate_cast_and_convert_metadata() argument 756 impl NumExt for usize { global() implementation 762 unchecked_add(self, rhs: usize) -> usize unchecked_add() argument 778 unchecked_sub(self, rhs: usize) -> usize unchecked_sub() argument 794 unchecked_mul(self, rhs: usize) -> usize unchecked_mul() argument 898 alt_impl(n: usize, align: NonZeroUsize) -> usize test_round_down_to_next_multiple_of_alignment() argument [all...] |
| /linux/rust/kernel/debugfs/ |
| H A D | traits.rs | 74 ) -> Result<usize>; in write_to_slice() 83 ) -> Result<usize> { 94 ) -> Result<usize> { in write_to_slice() 111 ) -> Result<usize> { 126 ) -> Result<usize> { 140 ) -> Result<usize> { in write_to_slice() 155 ) -> Result<usize> { 221 ) -> Result<usize>; 230 ) -> Result<usize> { in read_from_slice_mut() 241 ) -> Result<usize> { in read_from_slice_mut() 55 write_to_slice( &self, writer: &mut UserSliceWriter, offset: &mut file::Offset, ) -> Result<usize> write_to_slice() argument 64 write_to_slice( &self, writer: &mut UserSliceWriter, offset: &mut file::Offset, ) -> Result<usize> write_to_slice() argument 75 write_to_slice( &self, writer: &mut UserSliceWriter, offset: &mut file::Offset, ) -> Result<usize> write_to_slice() argument 92 write_to_slice( &self, writer: &mut UserSliceWriter, offset: &mut file::Offset, ) -> Result<usize> write_to_slice() argument 107 write_to_slice( &self, writer: &mut UserSliceWriter, offset: &mut file::Offset, ) -> Result<usize> write_to_slice() argument 121 write_to_slice( &self, writer: &mut UserSliceWriter, offset: &mut file::Offset, ) -> Result<usize> write_to_slice() argument 136 write_to_slice( &self, writer: &mut UserSliceWriter, offset: &mut file::Offset, ) -> Result<usize> write_to_slice() argument 209 read_from_slice_mut( &mut self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice_mut() argument 218 read_from_slice_mut( &mut self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice_mut() argument 229 read_from_slice_mut( &mut self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice_mut() argument 244 read_from_slice_mut( &mut self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice_mut() argument 272 read_from_slice( &self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice() argument 281 read_from_slice( &self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice() argument 294 read_from_slice( &self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice() argument 305 read_from_slice( &self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice() argument 316 read_from_slice( &self, reader: &mut UserSliceReader, offset: &mut file::Offset, ) -> Result<usize> read_from_slice() argument [all...] |
| /linux/rust/kernel/io/ |
| H A D | mem.rs | 92 pub fn iomap_sized<const SIZE: usize>(self) -> Result<IoMem<'a, SIZE>> { 102 pub fn iomap_exclusive_sized<const SIZE: usize>(self) -> Result<ExclusiveIoMem<'a, SIZE>> { 168 pub struct ExclusiveIoMem<'a, const SIZE: usize> { 179 impl<const SIZE: usize> ForLt for ExclusiveIoMem<'static, SIZE> { in ioremap() 185 unsafe impl<const SIZE: usize> CovariantForLt for ExclusiveIoMem<'static, SIZE> {} in ioremap() 190 pub type DevresExclusiveIoMem<const SIZE: usize> = DevresLt<ExclusiveIoMem<'static, SIZE>>; in ioremap() 192 impl<'a, const SIZE: usize> ExclusiveIoMem<'a, SIZE> { in ioremap() 228 impl<'a, const SIZE: usize> IoBase<'a> for &'a ExclusiveIoMem<'_, SIZE> { in ioremap() 247 pub struct IoMem<'a, const SIZE: usize = 0> { in ioremap() 252 impl<const SIZE: usize> ForL in ioremap() [all...] |
| /linux/drivers/android/binder/ |
| H A D | stats.rs | 11 const BC_COUNT: usize = _IOC_NR(BC_FREEZE_NOTIFICATION_DONE) as usize + 1; 12 const BR_COUNT: usize = _IOC_NR(BR_CLEAR_FREEZE_NOTIFICATION_DONE) as usize + 1; 33 let idx = _IOC_NR(bc) as usize; in inc_bc() 40 let idx = _IOC_NR(br) as usize; in inc_br() 71 pub(super) fn command_string(i: usize) -> &'static str { in command_string() 80 pub(super) fn return_string(i: usize) -> &'static str { in return_string()
|
| /linux/drivers/acpi/apei/ |
| H A D | erst-dbg.c | 82 size_t usize, loff_t *off) in erst_dbg_read() argument 139 if (len > usize) in erst_dbg_read() 152 size_t usize, loff_t *off) in erst_dbg_write() argument 160 if (usize > ERST_DBG_RECORD_LEN_MAX) { in erst_dbg_write() 167 if (usize > erst_dbg_buf_len) { in erst_dbg_write() 170 p = kmalloc(usize, GFP_KERNEL); in erst_dbg_write() 175 erst_dbg_buf_len = usize; in erst_dbg_write() 177 if (copy_from_user(erst_dbg_buf, ubuf, usize)) { in erst_dbg_write() 183 if (rcd->record_length != usize) in erst_dbg_write() 190 return rc < 0 ? rc : usize; in erst_dbg_write()
|
| /linux/rust/kernel/sync/atomic/ |
| H A D | predefine.rs | 77 // as `isize` and `usize`, and `isize` and `usize` are always bi-directional transmutable to 100 static_assert!(size_of::<usize>() == size_of::<isize_atomic_repr>()); 101 static_assert!(align_of::<usize>() == align_of::<isize_atomic_repr>()); 109 // SAFETY: The wrapping add result of two `isize_atomic_repr`s is a valid `usize`. in rhs_into_delta() 142 // SAFETY: `usize` has the same size and alignment with `isize_atomic_repr`, and is round-trip in atomic_xchg_tests() 144 unsafe impl super::AtomicType for usize { in atomic_xchg_tests() 148 // SAFETY: The wrapping add result of two `isize_atomic_repr`s is a valid `usize`. in atomic_xchg_tests() 149 unsafe impl super::AtomicAdd<usize> for usize { in atomic_xchg_tests() 102 unsafe impl super::AtomicType for usize { global() implementation 107 unsafe impl super::AtomicAdd<usize> for usize { global() implementation [all...] |
| /linux/rust/zerocopy/src/pointer/ |
| H A D | inner.rs | 64 /// `usize`) 279 T: ?Sized + KnownLayout<PointerMetadata = usize>, 390 pub unsafe fn slice_unchecked(self, range: Range<usize>) -> Self { 502 impl<'a, T, const N: usize> PtrInner<'a, [T; N]> { in iter() 570 // implies that the sum of the address (represented as a `usize`) and in try_cast_into() 571 // length do not overflow `usize`, as required by in try_cast_into() 647 fn test_split_at<const OFFSET: usize, const BUFFER_SIZE: usize>() { 650 struct SliceDst<const OFFSET: usize> { in test_split_at() argument 655 let n: usize in test_split_at() 702 test_trailing_slice<const OFFSET: usize, const BUFFER_SIZE: usize>() test_trailing_slice() argument [all...] |
| /linux/rust/kernel/alloc/ |
| H A D | kvec.rs | 140 len: usize, 210 pub const fn capacity(&self) -> usize { in inc_len() 212 usize::MAX 220 pub const fn len(&self) -> usize { 231 pub const unsafe fn inc_len(&mut self, additional: usize) { 247 unsafe fn dec_len(&mut self, count: usize) -> &mut [T] { 426 index: usize, 494 pub fn remove(&mut self, i: usize) -> Result<T, RemoveError> { 530 pub fn with_capacity(capacity: usize, flags: Flags) -> Result<Self, AllocError> { 548 pub fn zeroed(n: usize, flag 184 capacity(&self) -> usize capacity() argument 194 len(&self) -> usize len() argument 205 inc_len(&mut self, additional: usize) inc_len() argument 400 insert_within_capacity( &mut self, index: usize, element: T, ) -> Result<(), InsertError<T>> insert_within_capacity() argument 504 with_capacity(capacity: usize, flags: Flags) -> Result<Self, AllocError> with_capacity() argument 553 from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self from_raw_parts() argument 579 into_raw_parts(self) -> (*mut T, usize, usize) into_raw_parts() argument 625 reserve(&mut self, additional: usize, flags: Flags) -> Result<(), AllocError> reserve() argument 681 truncate(&mut self, len: usize) truncate() argument 766 shrink_to(&mut self, min_capacity: usize, flags: Flags) -> Result<(), AllocError> shrink_to() argument 852 extend_with(&mut self, n: usize, value: T, flags: Flags) -> Result<(), AllocError> extend_with() argument 907 from_elem(value: T, n: usize, flags: Flags) -> Result<Self, AllocError> from_elem() argument 932 resize(&mut self, new_len: usize, value: T, flags: Flags) -> Result<(), AllocError> resize() argument 1208 into_raw_parts(self) -> (*mut T, NonNull<T>, usize, usize) into_raw_parts() argument 1360 size_hint(&self) -> (usize, Option<usize>) size_hint() argument 1450 size_hint(&self) -> (usize, Option<usize>) size_hint() argument [all...] |