Home
last modified time | relevance | path

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

1234

/linux-6.15/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;
H A Dio.rs19 addr: usize,
20 maxsize: usize,
23 impl<const SIZE: usize> IoRaw<SIZE> {
25 pub fn new(addr: usize, maxsize: usize) -> Result<Self> { in new() argument
35 pub fn addr(&self) -> usize { in addr() argument
41 pub fn maxsize(&self) -> usize { in maxsize() argument
169 impl<const SIZE: usize> Io<SIZE> {
183 pub fn addr(&self) -> usize { in addr() argument
194 const fn offset_valid<U>(offset: usize, size: usize) -> bool { in offset_valid() argument
204 fn io_addr<U>(&self, offset: usize) -> Result<usize> { in io_addr() argument
[all …]
H A Dpage.rs15 pub const PAGE_SHIFT: usize = bindings::PAGE_SHIFT as usize;
18 pub const PAGE_SIZE: usize = bindings::PAGE_SIZE;
21 pub const PAGE_MASK: usize = !(PAGE_SIZE - 1);
27 pub const fn page_align(addr: usize) -> usize { in page_align() argument
146 off: usize, in with_pointer_into_page() argument
147 len: usize, in with_pointer_into_page() argument
173 pub unsafe fn read_raw(&self, dst: *mut u8, offset: usize, len: usize) -> Result { in read_raw() argument
195 pub unsafe fn write_raw(&self, src: *const u8, offset: usize, len: usize) -> Result { in write_raw() argument
215 pub unsafe fn fill_zero_raw(&self, offset: usize, len: usize) -> Result { in fill_zero_raw() argument
241 offset: usize, in copy_from_user_slice_raw() argument
[all …]
H A Ddevice_id.rs40 const DRIVER_DATA_OFFSET: usize;
43 fn index(&self) -> usize; in index() argument
48 pub struct RawIdArray<T: RawDeviceId, const N: usize> {
53 impl<T: RawDeviceId, const N: usize> RawIdArray<T, N> {
55 pub const fn size(&self) -> usize { in size() argument
62 pub struct IdArray<T: RawDeviceId, U, const N: usize> {
86 .cast::<usize>()
129 fn id(&self, index: usize) -> &T::RawType; in id()
132 fn info(&self, index: usize) -> &U; in info()
142 fn id(&self, index: usize) -> &T::RawType { in id()
[all …]
H A Duaccess.rs18 pub type UserPtr = usize;
107 length: usize,
123 pub fn new(ptr: UserPtr, length: usize) -> Self { in new()
172 length: usize,
179 pub fn skip(&mut self, num_skip: usize) -> Result { in skip()
202 pub fn len(&self) -> usize { in len() argument
303 length: usize,
310 pub fn len(&self) -> usize { in len() argument
H A Dstr.rs18 pub const fn len(&self) -> usize { in len() argument
205 pub const fn len(&self) -> usize { in len() argument
211 pub const fn len_with_nul(&self) -> usize { in len_with_nul() argument
505 impl Index<ops::RangeFrom<usize>> for CStr {
533 impl CStrIndex for usize {} implementation
534 impl CStrIndex for ops::Range<usize> {}
716 beg: usize,
717 pos: usize,
718 end: usize,
754 let pos = buf as usize; in from_buffer()
[all …]
H A Dpci.rs169 const DRIVER_DATA_OFFSET: usize = core::mem::offset_of!(bindings::pci_device_id, driver_data);
171 fn index(&self) -> usize { in index() argument
264 pub struct Bar<const SIZE: usize = 0> {
270 impl<const SIZE: usize> Bar<SIZE> {
293 let ioptr: usize = unsafe { bindings::pci_iomap(pdev.as_raw(), num, 0) } as usize; in new()
302 let io = match IoRaw::new(ioptr, len as usize) { in new()
324 unsafe fn do_release(pdev: &Device, ioptr: usize, num: i32) { in do_release() argument
348 impl<const SIZE: usize> Drop for Bar<SIZE> {
354 impl<const SIZE: usize> Deref for Bar<SIZE> {
394 pub fn iomap_region_sized<const SIZE: usize>( in iomap_region_sized()
H A Dtransmute.rs26 u8, u16, u32, u64, usize,
32 {<T: FromBytes, const N: usize>} [T; N],
61 u8, u16, u32, u64, usize,
70 {<T: AsBytes, const N: usize>} [T; N],
H A Dfirmware.rs94 pub fn size(&self) -> usize { in size() argument
225 pub struct ModInfoBuilder<const N: usize> {
227 n: usize,
231 impl<const N: usize> ModInfoBuilder<N> {
333 pub const fn build_length(self) -> usize { in build_length() argument
H A Dioctl.rs13 const fn _IOC(dir: u32, ty: u32, nr: u32, size: usize) -> u32 { in _IOC()
17 build_assert!(size <= (uapi::_IOC_SIZEMASK as usize)); in _IOC()
70 pub const fn _IOC_SIZE(nr: u32) -> usize { in _IOC_SIZE() argument
71 ((nr >> uapi::_IOC_SIZESHIFT) & uapi::_IOC_SIZEMASK) as usize in _IOC_SIZE()
/linux-6.15/lib/crypto/mpi/
H A Dmpi-add.c24 usize = v->nlimbs; in mpi_add()
28 wsize = usize + 1; in mpi_add()
36 usize = u->nlimbs; in mpi_add()
40 wsize = usize + 1; in mpi_add()
53 wsize = usize; in mpi_add()
57 if (usize != vsize) { in mpi_add()
59 wsize = usize; in mpi_add()
64 wsize = usize; in mpi_add()
70 wsize = usize; in mpi_add()
77 wp[usize] = cy; in mpi_add()
[all …]
H A Dmpi-cmp.c50 mpi_size_t usize, vsize; in mpi_cmp() local
55 usize = u->nlimbs; in mpi_cmp()
61 if (usize != vsize && !u->sign && !v->sign) in mpi_cmp()
62 return usize - vsize; in mpi_cmp()
63 if (usize != vsize && u->sign && v->sign) in mpi_cmp()
64 return vsize - usize; in mpi_cmp()
65 if (!usize) in mpi_cmp()
67 cmp = mpihelp_cmp(u->d, v->d, usize); in mpi_cmp()
H A Dmpih-mul.c341 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()
381 up, usize, in mpihelp_mul_karatsuba_case()
448 MPN_COPY(prodp, up, usize); in mpihelp_mul()
450 MPN_ZERO(prodp, usize); in mpihelp_mul()
455 prodp[usize] = cy; in mpihelp_mul()
466 usize); in mpihelp_mul()
[all …]
H A Dmpi-mul.c18 mpi_size_t usize, vsize, wsize; in mpi_mul() local
28 usize = v->nlimbs; in mpi_mul()
35 usize = u->nlimbs; in mpi_mul()
46 wsize = usize + vsize; in mpi_mul()
62 up = tmp_limb = mpi_alloc_limb_space(usize); in mpi_mul()
69 MPN_COPY(up, wp, usize); in mpi_mul()
83 err = mpihelp_mul(wp, up, usize, vp, vsize, &cy); in mpi_mul()
/linux-6.15/drivers/gpu/drm/
H A Ddrm_panic_qr.rs33 struct Version(usize);
377 offset: usize,
379 carry_len: usize,
429 ec_size: usize,
468 fn push(&mut self, offset: &mut usize, bits: (u16, usize)) { in push() argument
516 fn error_code_for_blocks(&mut self, offset: usize, size: usize, ec_offset: usize) { in error_code_for_blocks() argument
566 offset: usize,
643 let off = y as usize * self.stride as usize + x as usize / 8; in set()
651 let off = y as usize * self.stride as usize + x as usize / 8; in xor()
898 data_len: usize, in drm_panic_qr_generate() argument
[all …]
/linux-6.15/drivers/acpi/apei/
H A Derst-dbg.c83 size_t usize, loff_t *off) in erst_dbg_read() argument
140 if (len > usize) in erst_dbg_read()
153 size_t usize, loff_t *off) in erst_dbg_write() argument
161 if (usize > ERST_DBG_RECORD_LEN_MAX) { in erst_dbg_write()
168 if (usize > erst_dbg_buf_len) { in erst_dbg_write()
171 p = kmalloc(usize, GFP_KERNEL); in erst_dbg_write()
176 erst_dbg_buf_len = usize; in erst_dbg_write()
178 rc = copy_from_user(erst_dbg_buf, ubuf, usize); in erst_dbg_write()
185 if (rcd->record_length != usize) in erst_dbg_write()
192 return rc < 0 ? rc : usize; in erst_dbg_write()
/linux-6.15/rust/kernel/alloc/
H A Dkvec.rs105 len: usize,
175 pub fn capacity(&self) -> usize { in capacity() argument
177 usize::MAX in capacity()
185 pub fn len(&self) -> usize { in len() argument
197 pub unsafe fn set_len(&mut self, new_len: usize) { in set_len() argument
367 pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self { in from_raw_parts() argument
393 pub fn into_raw_parts(self) -> (*mut T, usize, usize) { in into_raw_parts() argument
649 [A: Allocator, const N: usize] Vec<T, A>, [U; N],
693 len: usize,
702 fn into_raw_parts(self) -> (*mut T, NonNull<T>, usize, usize) { in into_raw_parts() argument
[all …]
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 unsafe fn new_unchecked(len: usize) -> Self { in new_unchecked()
93 pub const fn len(&self) -> usize { in len() argument
/linux-6.15/lib/tests/
H A Dusercopy_kunit.c112 size_t ksize, usize; in usercopy_test_copy_struct_from_user() local
127 usize = size; in usercopy_test_copy_struct_from_user()
132 KUNIT_EXPECT_EQ_MSG(test, copy_struct_from_user(kmem, ksize, umem, usize), 0, in usercopy_test_copy_struct_from_user()
139 usize = size / 2; in usercopy_test_copy_struct_from_user()
141 memcpy(expected, umem_src, usize); in usercopy_test_copy_struct_from_user()
142 memset(expected + usize, 0x0, ksize - usize); in usercopy_test_copy_struct_from_user()
145 KUNIT_EXPECT_EQ_MSG(test, copy_struct_from_user(kmem, ksize, umem, usize), 0, in usercopy_test_copy_struct_from_user()
152 usize = size; in usercopy_test_copy_struct_from_user()
160 usize = size; in usercopy_test_copy_struct_from_user()
163 KUNIT_EXPECT_EQ_MSG(test, clear_user(umem + ksize, usize - ksize), 0, in usercopy_test_copy_struct_from_user()
[all …]
/linux-6.15/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-6.15/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;
48 let offset = u32::from_le(bar.read32(Regs::OFFSET)) as usize; in testdev()
/linux-6.15/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-6.15/include/linux/
H A Duaccess.h383 size_t usize) in copy_struct_from_user() argument
385 size_t size = min(ksize, usize); in copy_struct_from_user()
386 size_t rest = max(ksize, usize) - size; in copy_struct_from_user()
393 if (usize < ksize) { in copy_struct_from_user()
395 } else if (usize > ksize) { in copy_struct_from_user()
479 copy_struct_to_user(void __user *dst, size_t usize, const void *src, in copy_struct_to_user() argument
482 size_t size = min(ksize, usize); in copy_struct_to_user()
483 size_t rest = max(ksize, usize) - size; in copy_struct_to_user()
490 if (usize > ksize) { in copy_struct_to_user()
495 *ignored_trailing = ksize < usize && in copy_struct_to_user()
H A Dsockptr.h88 sockptr_t src, size_t usize) in copy_struct_from_sockptr() argument
90 size_t size = min(ksize, usize); in copy_struct_from_sockptr()
91 size_t rest = max(ksize, usize) - size; in copy_struct_from_sockptr()
96 if (usize < ksize) { in copy_struct_from_sockptr()
98 } else if (usize > ksize) { in copy_struct_from_sockptr()
/linux-6.15/rust/kernel/list/
H A Dimpl_list_item_mod.rs22 const OFFSET: usize;
57 const OFFSET: usize = ::core::mem::offset_of!(Self, $($field).*) as usize;
100 const OFFSET: usize = ::core::mem::offset_of!(Self, $field) as usize;

1234