Home
last modified time | relevance | path

Searched refs:usize (Results 1 – 25 of 121) sorted by relevance

12345

/linux/rust/kernel/
H A Dsizes.rs8 pub const SZ_1K: usize = bindings::SZ_1K as usize;
10 pub const SZ_2K: usize = bindings::SZ_2K as usize;
12 pub const SZ_4K: usize = bindings::SZ_4K as usize;
14 pub const SZ_8K: usize = bindings::SZ_8K as usize;
16 pub const SZ_16K: usize = bindings::SZ_16K as usize;
18 pub const SZ_32K: usize = bindings::SZ_32K as usize;
20 pub const SZ_64K: usize = bindings::SZ_64K as usize;
22 pub const SZ_128K: usize = bindings::SZ_128K as usize;
24 pub const SZ_256K: usize = bindings::SZ_256K as usize;
26 pub const SZ_512K: usize = bindings::SZ_512K as usize;
[all …]
H A Dio.rs38 pub struct IoRaw<const SIZE: usize = 0> {
39 addr: usize,
40 maxsize: usize,
43 impl<const SIZE: usize> IoRaw<SIZE> {
45 pub fn new(addr: usize, maxsize: usize) -> Result<Self> { in new() argument
55 pub fn addr(&self) -> usize { in addr() argument
61 pub fn maxsize(&self) -> usize { in maxsize() argument
136 pub struct Io<const SIZE: usize = 0>(IoRaw<SIZE>);
146 pub fn $name(&self, offset: usize) -> $type_name {
158 pub fn $try_name(&self, offset: usize) -> Result<$type_name> {
[all …]
H A Dbitmap.rs35 pub unsafe fn from_raw<'a>(ptr: *const usize, nbits: usize) -> &'a Bitmap { in from_raw() argument
60 pub unsafe fn from_raw_mut<'a>(ptr: *mut usize, nbits: usize) -> &'a mut Bitmap { in from_raw_mut() argument
76 pub fn as_ptr(&self) -> *const usize { in as_ptr() argument
77 core::ptr::from_ref::<Bitmap>(self).cast::<usize>() in as_ptr()
81 pub fn as_mut_ptr(&mut self) -> *mut usize { in as_mut_ptr() argument
82 core::ptr::from_mut::<Bitmap>(self).cast::<usize>() in as_mut_ptr()
87 pub fn len(&self) -> usize { in len() argument
95 bitmap: usize,
96 ptr: NonNull<usize>,
158 nbits: usize,
[all …]
H A Dmaple_tree.rs56 fn to_maple_range(range: impl RangeBounds<usize>) -> Option<(usize, usize)> { in to_maple_range() argument
66 Bound::Unbounded => usize::MAX, in to_maple_range()
121 pub fn insert(&self, index: usize, value: T, gfp: Flags) -> Result<(), InsertError<T>> { in insert() argument
171 R: RangeBounds<usize>, in insert_range() argument
227 pub fn erase(&self, index: usize) -> Option<T> { in erase()
263 let mut ma_state = unsafe { MaState::new_raw(self.into_ref().get_ref(), 0, usize::MAX) }; in free_all_entries()
276 ma_state.mas_find_raw(usize::MAX) in free_all_entries()
323 pub fn ma_state(&mut self, first: usize, end: usize) -> MaState<'_, T> { in ma_state() argument
376 pub fn load(&mut self, index: usize) -> Option<T::BorrowedMut<'_>> { in load()
442 size: usize, in alloc_range() argument
[all …]
H A Did_pool.rs74 num_ids: usize,
114 pub fn with_capacity(num_ids: usize, flags: Flags) -> Result<Self, AllocError> { in with_capacity() argument
115 let num_ids = usize::max(num_ids, BitmapVec::MAX_INLINE_LEN); in with_capacity()
122 pub fn capacity(&self) -> usize { in capacity() argument
170 let num_ids = usize::max(BitmapVec::MAX_INLINE_LEN, cap / 2); in shrink_request()
230 pub fn find_unused_id(&mut self, offset: usize) -> Option<UnusedId<'_>> { in find_unused_id()
240 pub fn release_id(&mut self, id: usize) { in release_id() argument
251 id: usize,
264 pub fn as_usize(&self) -> usize { in as_usize() argument
284 pub fn acquire(self) -> usize { in acquire() argument
H A Duaccess.rs28 pub fn from_addr(addr: usize) -> Self { in from_addr()
59 pub fn wrapping_byte_add(self, add: usize) -> UserPtr { in wrapping_byte_add()
149 length: usize,
165 pub fn new(ptr: UserPtr, length: usize) -> Self { in new()
214 length: usize,
221 pub fn skip(&mut self, num_skip: usize) -> Result { in skip()
244 pub fn len(&self) -> usize { in len() argument
297 pub fn read_slice_partial(&mut self, out: &mut [u8], offset: usize) -> Result<usize> { in read_slice_partial() argument
316 pub fn read_slice_file(&mut self, out: &mut [u8], offset: &mut file::Offset) -> Result<usize> { in read_slice_file() argument
446 length: usize,
[all …]
H A Dptr.rs25 pub struct Alignment(NonZero<usize>);
42 pub const fn new<const ALIGN: usize>() -> Self { in new()
69 pub const fn new_checked(align: usize) -> Option<Self> { in new_checked()
103 pub const fn as_usize(self) -> usize { in as_usize() argument
119 pub const fn as_nonzero(self) -> NonZero<usize> { in as_nonzero() argument
157 pub const fn mask(self) -> usize { in mask() argument
227 impl_alignable_uint!(u8, u16, u32, u64, usize);
H A Ddma.rs361 count: usize,
382 count: usize, in alloc_attrs() argument
425 count: usize, in alloc_coherent() argument
435 pub fn count(&self) -> usize { in count() argument
440 pub fn size(&self) -> usize { in size() argument
467 pub fn dma_handle_with_offset(&self, offset: usize) -> Result<DmaAddress> { in dma_handle_with_offset()
479 fn validate_range(&self, offset: usize, count: usize) -> Result { in validate_range() argument
499 pub unsafe fn as_slice(&self, offset: usize, count: usize) -> Result<&[T]> { in as_slice() argument
519 pub unsafe fn as_slice_mut(&mut self, offset: usize, count: usize) -> Result<&mut [T]> { in as_slice_mut() argument
551 pub unsafe fn write(&mut self, src: &[T], offset: usize) -> Result { in write()
[all …]
/linux/lib/crypto/mpi/
H A Dmpi-add.c21 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 Dmpi-cmp.c52 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 Dmpih-mul.c322 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 Dmpi-mul.c20 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/drivers/android/binder/range_alloc/
H A Dtree.rs25 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
[all …]
/linux/rust/kernel/debugfs/
H A Dtraits.rs55 ) -> Result<usize>; in write_to_slice() argument
64 ) -> Result<usize> { in write_to_slice() argument
75 ) -> Result<usize> { in write_to_slice() argument
92 ) -> Result<usize> { in write_to_slice() argument
107 ) -> Result<usize> { in write_to_slice() argument
121 ) -> Result<usize> { in write_to_slice() argument
136 ) -> Result<usize> { in write_to_slice() argument
209 ) -> Result<usize>; in read_from_slice_mut() argument
218 ) -> Result<usize> { in read_from_slice_mut() argument
229 ) -> Result<usize> { in read_from_slice_mut() argument
[all …]
/linux/rust/kernel/alloc/
H A Dkvec.rs111 len: usize,
181 pub const fn capacity(&self) -> usize { in capacity() argument
183 usize::MAX in capacity()
191 pub const fn len(&self) -> usize { in len() argument
202 pub const unsafe fn inc_len(&mut self, additional: usize) { in inc_len() argument
218 unsafe fn dec_len(&mut self, count: usize) -> &mut [T] { in dec_len()
397 index: usize, in insert_within_capacity() argument
465 pub fn remove(&mut self, i: usize) -> Result<T, RemoveError> { in remove()
501 pub fn with_capacity(capacity: usize, flags: Flags) -> Result<Self, AllocError> { in with_capacity() argument
550 pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self { in from_raw_parts() argument
[all …]
H A Dallocator.rs20 const ARCH_KMALLOC_MINALIGN: usize = bindings::ARCH_KMALLOC_MINALIGN;
57 usize,
143 const MIN_ALIGN: usize = ARCH_KMALLOC_MINALIGN;
213 const MIN_ALIGN: usize = kernel::page::PAGE_SIZE;
234 const MIN_ALIGN: usize = ARCH_KMALLOC_MINALIGN;
262 const TEST_SIZE: usize = 1024; in test_alignment()
263 const TEST_LARGE_ALIGN_SIZE: usize = kernel::page::PAGE_SIZE * 4; in test_alignment()
280 fn is_aligned_to(&self, align: usize) -> bool { in test_alignment()
283 let addr = self.0.as_ptr() as usize; in test_alignment()
/linux/rust/kernel/pci/
H A Dio.rs25 pub struct Bar<const SIZE: usize = 0> {
31 impl<const SIZE: usize> Bar<SIZE> {
54 let ioptr: usize = unsafe { bindings::pci_iomap(pdev.as_raw(), num, 0) } as usize; in new()
63 let io = match IoRaw::new(ioptr, len as usize) { in new()
85 unsafe fn do_release(pdev: &Device, ioptr: usize, num: i32) { in do_release() argument
110 impl<const SIZE: usize> Drop for Bar<SIZE> {
116 impl<const SIZE: usize> Deref for Bar<SIZE> {
128 pub fn iomap_region_sized<'a, const SIZE: usize>( in iomap_region_sized()
/linux/rust/kernel/sync/atomic/
H A Dpredefine.rs47 static_assert!(size_of::<usize>() == size_of::<isize_atomic_repr>());
48 static_assert!(align_of::<usize>() == align_of::<isize_atomic_repr>());
91 unsafe impl super::AtomicType for usize { implementation
96 unsafe impl super::AtomicAdd<usize> for usize { implementation
97 fn rhs_into_delta(rhs: usize) -> isize_atomic_repr { in rhs_into_delta()
121 for_each_type!(42 in [i32, i64, u32, u64, isize, usize] |v| { in atomic_basic_tests()
130 for_each_type!(42 in [i32, i64, u32, u64, isize, usize] |v| { in atomic_xchg_tests()
143 for_each_type!(42 in [i32, i64, u32, u64, isize, usize] |v| { in atomic_cmpxchg_tests()
158 for_each_type!(42 in [i32, i64, u32, u64, isize, usize] |v| { in atomic_arithmetic_tests()
/linux/rust/kernel/io/
H A Dmem.rs85 pub fn iomap_sized<const SIZE: usize>(self) -> impl PinInit<Devres<IoMem<SIZE>>, Error> + 'a { in iomap_sized()
95 pub fn iomap_exclusive_sized<const SIZE: usize>( in iomap_exclusive_sized()
159 pub struct ExclusiveIoMem<const SIZE: usize> {
170 impl<const SIZE: usize> ExclusiveIoMem<SIZE> {
205 impl<const SIZE: usize> Deref for ExclusiveIoMem<SIZE> {
222 pub struct IoMem<const SIZE: usize = 0> {
226 impl<const SIZE: usize> IoMem<SIZE> {
258 let io = IoRaw::new(addr as usize, size)?; in ioremap()
273 impl<const SIZE: usize> Drop for IoMem<SIZE> {
280 impl<const SIZE: usize> Deref for IoMem<SIZE> {
/linux/drivers/android/binder/
H A Dstats.rs11 const BC_COUNT: usize = _IOC_NR(BC_REPLY_SG) as usize + 1;
12 const BR_COUNT: usize = _IOC_NR(BR_TRANSACTION_PENDING_FROZEN) 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 Derst-dbg.c82 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/tools/testing/selftests/bpf/progs/
H A Dtest_get_stack_rawtp.c62 long usize, ksize; in bpf_prog1() local
87 usize = bpf_get_stack(ctx, raw_data, max_len, BPF_F_USER_STACK); in bpf_prog1()
88 if (usize < 0) in bpf_prog1()
91 ksize = bpf_get_stack(ctx, raw_data + usize, max_len - usize, 0); in bpf_prog1()
95 total_size = usize + ksize; in bpf_prog1()
/linux/arch/x86/kernel/cpu/mce/
H A Ddev-mcelog.c162 static int __mce_read_apei(char __user **ubuf, size_t usize) in __mce_read_apei() argument
168 if (usize < sizeof(struct mce)) in __mce_read_apei()
203 size_t usize, loff_t *off) in mce_chrdev_read() argument
212 err = __mce_read_apei(&buf, usize); in mce_chrdev_read()
219 if (*off != 0 || usize < mcelog->len * sizeof(struct mce)) in mce_chrdev_read()
287 size_t usize, loff_t *off) in mce_chrdev_write() argument
300 if ((unsigned long)usize > sizeof(struct mce)) in mce_chrdev_write()
301 usize = sizeof(struct mce); in mce_chrdev_write()
302 if (copy_from_user(&m, ubuf, usize)) in mce_chrdev_write()
316 return usize; in mce_chrdev_write()
/linux/samples/rust/
H A Drust_driver_pci.rs12 const TEST: usize = 0x0;
13 const OFFSET: usize = 0x4;
14 const DATA: usize = 0x8;
15 const COUNT: usize = 0xC;
16 const END: usize = 0x10;
51 let offset = bar.read32(Regs::OFFSET) as usize; in testdev()
/linux/rust/syn/
H A Dpunctuated.rs73 pub fn len(&self) -> usize { in len() argument
98 pub fn get(&self, index: usize) -> Option<&T> { in get()
109 pub fn get_mut(&mut self, index: usize) -> Option<&mut T> { in get_mut()
263 pub fn insert(&mut self, index: usize, value: T) in insert() argument
577 fn size_hint(&self) -> (usize, Option<usize>) { in size_hint() argument
592 fn len(&self) -> usize { in len() argument
627 fn size_hint(&self) -> (usize, Option<usize>) { in size_hint() argument
642 fn len(&self) -> usize { in len() argument
667 fn size_hint(&self) -> (usize, Option<usize>) { in size_hint() argument
682 fn len(&self) -> usize { in len() argument
[all …]

12345