Home
last modified time | relevance | path

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

123456

/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.rs24 pub struct IoRaw<const SIZE: usize = 0> {
25 addr: usize,
26 maxsize: usize,
29 impl<const SIZE: usize> IoRaw<SIZE> {
31 pub fn new(addr: usize, maxsize: usize) -> Result<Self> { in new() argument
41 pub fn addr(&self) -> usize { in addr() argument
47 pub fn maxsize(&self) -> usize { in maxsize() argument
114 pub struct Io<const SIZE: usize = 0>(IoRaw<SIZE>);
124 pub fn $name(&self, offset: usize) -> $type_name {
136 pub fn $try_name(&self, offset: usize) -> Result<$type_name> {
[all …]
H A Dbitmap.rs15 const BITS_PER_LONG: usize = bindings::BITS_PER_LONG as usize;
37 pub unsafe fn from_raw<'a>(ptr: *const usize, nbits: usize) -> &'a Bitmap { in from_raw() argument
62 pub unsafe fn from_raw_mut<'a>(ptr: *mut usize, nbits: usize) -> &'a mut Bitmap { in from_raw_mut() argument
78 pub fn as_ptr(&self) -> *const usize { in as_ptr() argument
79 core::ptr::from_ref::<Bitmap>(self).cast::<usize>() in as_ptr()
83 pub fn as_mut_ptr(&mut self) -> *mut usize { in as_mut_ptr() argument
84 core::ptr::from_mut::<Bitmap>(self).cast::<usize>() in as_mut_ptr()
89 pub fn len(&self) -> usize { in len() argument
97 bitmap: usize,
98 ptr: NonNull<usize>,
[all …]
H A Dpage.rs20 pub const PAGE_SHIFT: usize = bindings::PAGE_SHIFT as usize;
23 pub const PAGE_SIZE: usize = bindings::PAGE_SIZE;
26 pub const PAGE_MASK: usize = !(PAGE_SIZE - 1);
32 pub const fn page_align(addr: usize) -> usize { in page_align() argument
238 off: usize, in with_pointer_into_page() argument
239 len: usize, in with_pointer_into_page() argument
265 pub unsafe fn read_raw(&self, dst: *mut u8, offset: usize, len: usize) -> Result { in read_raw() argument
287 pub unsafe fn write_raw(&self, src: *const u8, offset: usize, len: usize) -> Result { in write_raw() argument
307 pub unsafe fn fill_zero_raw(&self, offset: usize, len: usize) -> Result { in fill_zero_raw() argument
333 offset: usize, in copy_from_user_slice_raw() argument
[all …]
H A Ddevice_id.rs48 const DRIVER_DATA_OFFSET: usize;
52 fn index(&self) -> usize; in index() argument
57 pub struct RawIdArray<T: RawDeviceId, const N: usize> {
62 impl<T: RawDeviceId, const N: usize> RawIdArray<T, N> {
64 pub const fn size(&self) -> usize { in size() argument
71 pub struct IdArray<T: RawDeviceId, U, const N: usize> {
76 impl<T: RawDeviceId, U, const N: usize> IdArray<T, U, N> {
88 const unsafe fn build(ids: [(T, U); N], data_offset: Option<usize>) -> Self { in build()
104 .cast::<usize>()
147 impl<T: RawDeviceId + RawDeviceIdIndex, U, const N: usize> IdArray<T, U, N> {
[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()
268 let ptr = ma_state.mas_find_raw(usize::MAX); in free_all_entries()
314 pub fn ma_state(&mut self, first: usize, end: usize) -> MaState<'_, T> { in ma_state() argument
367 pub fn load(&mut self, index: usize) -> Option<T::BorrowedMut<'_>> { in load()
433 size: usize, in alloc_range() argument
[all …]
H A Did_pool.rs10 const BITS_PER_LONG: usize = bindings::BITS_PER_LONG as usize;
76 num_ids: usize,
105 pub fn new(num_ids: usize, flags: Flags) -> Result<Self, AllocError> { in new() argument
113 pub fn capacity(&self) -> usize { in capacity() argument
155 let num_ids = usize::max(BITS_PER_LONG, cap / 2); in shrink_request()
213 pub fn acquire_next_id(&mut self, offset: usize) -> Option<usize> { in acquire_next_id() argument
223 pub fn release_id(&mut self, id: usize) { in release_id() argument
H A Diov.rs84 pub fn len(&self) -> usize { in len() argument
108 pub fn advance(&mut self, bytes: usize) { in advance() argument
119 pub unsafe fn revert(&mut self, bytes: usize) { in revert() argument
129 pub fn copy_from_iter(&mut self, out: &mut [u8]) -> usize { in copy_from_iter() argument
145 ) -> Result<usize> { in copy_from_iter_vec() argument
235 pub fn len(&self) -> usize { in len() argument
259 pub fn advance(&mut self, bytes: usize) { in advance() argument
270 pub unsafe fn revert(&mut self, bytes: usize) { in revert() argument
281 pub fn copy_to_iter(&mut self, input: &[u8]) -> usize { in copy_to_iter() argument
295 pub fn simple_read_from_buffer(&mut self, ppos: &mut i64, contents: &[u8]) -> Result<usize> { in simple_read_from_buffer() argument
[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 …]
/linux/drivers/android/binder/range_alloc/
H A Darray.rs26 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
[all …]
H A Dmod.rs19 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 fn endpoint(&self) -> usize { in endpoint() argument
[all …]
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/drivers/gpu/drm/
H A Ddrm_panic_qr.rs33 struct Version(usize);
119 const MAX_EC_SIZE: usize = 30;
120 const MAX_BLK_SIZE: usize = 123;
221 fn max_data(&self) -> usize { in max_data() argument
225 fn ec_size(&self) -> usize { in ec_size() argument
229 fn g1_blocks(&self) -> usize { in g1_blocks() argument
230 VPARAM[self.0 - 1].1 as usize in g1_blocks()
233 fn g2_blocks(&self) -> usize { in g2_blocks() argument
234 VPARAM[self.0 - 1].2 as usize in g2_blocks()
237 fn g1_blk_size(&self) -> usize { in g1_blk_size() argument
[all …]
/linux/drivers/android/binder/
H A Dallocation.rs29 pub(crate) offsets: Option<Range<usize>>,
53 pub(crate) offset: usize,
54 size: usize,
55 pub(crate) ptr: usize,
61 pub(crate) debug_id: usize,
67 debug_id: usize, in new() argument
68 offset: usize, in new() argument
69 size: usize, in new() argument
70 ptr: usize, in new() argument
85 fn size_check(&self, offset: usize, size: usize) -> Result { in size_check() argument
[all …]
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/gpu/nova-core/regs/
H A Dmacros.rs20 const BASE: usize;
607 pub(crate) const OFFSET: usize = $offset;
611 pub(crate) fn read<const SIZE: usize, T>(io: &T) -> Self where
619 pub(crate) fn write<const SIZE: usize, T>(self, io: &T) where
628 pub(crate) fn alter<const SIZE: usize, T, F>(
645 pub(crate) const OFFSET: usize = $offset;
650 pub(crate) fn read<const SIZE: usize, T, B>(
658 const OFFSET: usize = $name::OFFSET;
670 pub(crate) fn write<const SIZE: usize, T, B>(
679 const OFFSET: usize = $name::OFFSET;
[all …]
/linux/drivers/gpu/nova-core/
H A Dvbios.rs16 const ROM_OFFSET: usize = 0x300000;
18 const BIOS_MAX_SCAN_LEN: usize = 0x100000;
20 const BIOS_READ_AHEAD_SIZE: usize = 1024;
44 current_offset: usize,
61 fn read_more(&mut self, len: usize) -> Result { in read_more()
91 fn read_more_at_offset(&mut self, offset: usize, len: usize) -> Result { in read_more_at_offset() argument
111 offset: usize, in read_bios_image_at_offset() argument
112 len: usize, in read_bios_image_at_offset() argument
330 fn image_size_bytes(&self) -> usize { in image_size_bytes() argument
331 self.image_len as usize * 512 in image_size_bytes()
[all …]
/linux/rust/kernel/alloc/allocator/
H A Diter.rs24 size: usize,
26 index: usize,
61 fn size_hint(&self) -> (usize, Option<usize>) { in size_hint() argument
77 pub unsafe fn new(buf: NonNull<u8>, size: usize) -> Self { in new()
93 pub fn size(&self) -> usize { in size() argument
99 pub fn page_count(&self) -> usize { in page_count() argument
/linux/rust/kernel/alloc/
H A Dlayout.rs18 len: usize,
29 const ISIZE_MAX: usize = isize::MAX as usize;
65 pub const fn new(len: usize) -> Result<Self, LayoutError> { in new()
83 pub const unsafe fn new_unchecked(len: usize) -> Self { in new_unchecked()
93 pub const fn len(&self) -> usize { in len() argument
103 pub const fn size(&self) -> usize { in size() argument
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 …]
/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.rs77 pub fn iomap_sized<const SIZE: usize>(self) -> impl PinInit<Devres<IoMem<SIZE>>, Error> + 'a { in iomap_sized()
87 pub fn iomap_exclusive_sized<const SIZE: usize>( in iomap_exclusive_sized()
151 pub struct ExclusiveIoMem<const SIZE: usize> {
162 impl<const SIZE: usize> ExclusiveIoMem<SIZE> {
197 impl<const SIZE: usize> Deref for ExclusiveIoMem<SIZE> {
214 pub struct IoMem<const SIZE: usize = 0> {
218 impl<const SIZE: usize> IoMem<SIZE> {
250 let io = IoRaw::new(addr as usize, size)?; in ioremap()
265 impl<const SIZE: usize> Drop for IoMem<SIZE> {
272 impl<const SIZE: usize> Deref for IoMem<SIZE> {
/linux/drivers/gpu/nova-core/firmware/
H A Dbooter.rs24 fn frombytes_at<S: FromBytes + Sized>(slice: &[u8], offset: usize) -> Result<S> { in frombytes_at()
77 frombytes_at::<HsHeaderV2>(bin_fw.fw, bin_fw.hdr.header_offset as usize) in new()
86 frombytes_at::<u32>(self.fw, self.hdr.patch_loc_offset as usize) in patch_location()
94 let num_sig = frombytes_at::<u32>(self.fw, self.hdr.num_sig_offset as usize)?; in signatures_iter()
99 let patch_sig = frombytes_at::<u32>(self.fw, self.hdr.patch_sig_offset as usize)?; in signatures_iter()
100 let signatures_start = (self.hdr.sig_prod_offset + patch_sig) as usize; in signatures_iter()
104 .get(signatures_start..signatures_start + self.hdr.sig_prod_size as usize) in signatures_iter()
106 .chunks_exact(sig_size as usize) in signatures_iter()
135 let start = hs_fw.hdr.meta_data_offset as usize; in new()
137 .checked_add(hs_fw.hdr.meta_data_size as usize) in new()
[all …]

123456