Home
last modified time | relevance | path

Searched refs:size_of (Results 1 – 25 of 35) sorted by relevance

12

/linux/rust/kernel/
H A Dtransmute.rs5 use core::mem::size_of;
50 let size = size_of::<Self>(); in from_bytes()
70 if bytes.len() < size_of::<Self>() { in from_bytes_prefix()
73 // PANIC: We checked that `bytes.len() >= size_of::<Self>`, thus `split_at` cannot in from_bytes_prefix()
76 let (prefix, remainder) = bytes.split_at(size_of::<Self>()); in from_bytes_prefix()
93 let size = size_of::<Self>(); in from_bytes_mut()
113 if bytes.len() < size_of::<Self>() { in from_bytes_mut_prefix()
116 // PANIC: We checked that `bytes.len() >= size_of::<Self>`, thus `split_at_mut` cannot in from_bytes_mut_prefix()
119 let (prefix, remainder) = bytes.split_at_mut(size_of::<Self>()); in from_bytes_mut_prefix()
133 if bytes.len() == size_of in from_bytes_copy()
[all...]
H A Dioctl.rs34 _IOC(uapi::_IOC_READ, ty, nr, core::mem::size_of::<T>()) in _IOR()
40 _IOC(uapi::_IOC_WRITE, ty, nr, core::mem::size_of::<T>()) in _IOW()
50 core::mem::size_of::<T>(), in _IOWR()
H A Dptr.rs10 size_of, //
246 size_of::<T>() in size()
253 p.len() * size_of::<T>() in size()
H A Ddma.rs405 core::mem::size_of::<T>() > 0, in alloc_attrs()
410 .checked_mul(core::mem::size_of::<T>()) in alloc_attrs()
461 self.count * core::mem::size_of::<T>() in size()
504 Ok(self.dma_handle + (offset * core::mem::size_of::<T>()) as DmaAddress) in dma_handle_with_offset()
647 let size = self.count * core::mem::size_of::<T>(); in drop()
H A Dbug.rs42 size = const ::core::mem::size_of::<$crate::bindings::bug_entry>(),
68 size = const ::core::mem::size_of::<$crate::bindings::bug_entry>(),
H A Duaccess.rs16 use core::mem::{size_of, MaybeUninit};
338 let len = size_of::<T>(); in read()
532 let len = size_of::<T>(); in write()
H A Dpwm.rs251 /// `wfhw_ptr` must be valid for writes of `size_of::<T::WfHw>()` bytes. in serialize_wfhw()
253 let size = core::mem::size_of::<T::WfHw>(); in serialize_wfhw()
271 /// `wfhw_ptr` must be valid for reads of `size_of::<T::WfHw>()` bytes. in deserialize_wfhw()
273 let size = core::mem::size_of::<T::WfHw>(); in deserialize_wfhw()
508 ops.sizeof_wfhw = core::mem::size_of::<T::WfHw>(); in create_pwm_ops()
591 let sizeof_priv = core::mem::size_of::<T>(); in new()
H A Dprelude.rs16 mem::{align_of, align_of_val, size_of, size_of_val},
H A Ddevice.rs26 static_assert!(core::mem::size_of::<bindings::driver_type>() >= core::mem::size_of::<TypeId>());
/linux/drivers/android/binder/
H A Dallocation.rs5 use core::mem::{size_of, size_of_val, MaybeUninit};
112 self.size_check(offset, size_of::<T>())?; in read()
256 for i in offsets.step_by(size_of::<usize>()) { in drop()
334 if offset.checked_add(size_of::<T>()).ok_or(EINVAL)? > self.limit { in read()
341 if offset.checked_add(size_of::<T>()).ok_or(EINVAL)? > self.limit { in write()
496 R: FnOnce(&mut [u8; size_of::<BinderObject>()]) -> Result<()>, in read_from_inner()
546 BINDER_TYPE_WEAK_BINDER => Some(size_of::<uapi::flat_binder_object>()), in type_to_size()
547 BINDER_TYPE_BINDER => Some(size_of::<uapi::flat_binder_object>()), in type_to_size()
548 BINDER_TYPE_WEAK_HANDLE => Some(size_of::<uapi::flat_binder_object>()), in type_to_size()
549 BINDER_TYPE_HANDLE => Some(size_of::<uapi::flat_binder_object>()), in type_to_size()
[all …]
H A Dthread.rs37 use core::mem::size_of;
755 size_of::<u64>(), in translate_object()
797 let fds_len = num_fds.checked_mul(size_of::<u32>()).ok_or(EINVAL)?; in translate_object()
799 if !is_aligned(parent_offset, size_of::<u32>()) { in translate_object()
817 if !is_aligned(parent_entry.sender_uaddr, size_of::<u32>()) { in translate_object()
847 for i in (0..fds_len).step_by(size_of::<u32>()) { in translate_object()
849 let mut fd_bytes = [0u8; size_of::<u32>()]; in translate_object()
850 fd_bytes.copy_from_slice(&fda_bytes[i..i + size_of::<u32>()]); in translate_object()
891 (size_of::<u64>(), *target_offset) in apply_sg()
978 if !is_aligned(offsets_size, size_of::<u64>()) { in copy_transaction_data()
[all …]
/linux/rust/kernel/sync/atomic/
H A Dpredefine.rs6 use core::mem::{align_of, size_of};
9 static_assert!(size_of::<bool>() == size_of::<i8>());
79 static_assert!(size_of::<isize>() == size_of::<isize_atomic_repr>());
81 static_assert!(size_of::<usize>() == size_of::<isize_atomic_repr>());
/linux/rust/kernel/sync/
H A Dlocked_by.rs7 use core::{cell::UnsafeCell, mem::size_of, ptr};
104 size_of::<Lock<U, B>>() > 0, in new()
130 size_of::<U>() > 0, in access()
159 size_of::<U>() > 0, in access_mut()
/linux/drivers/gpu/nova-core/
H A Dgsp.rs91 .as_slice_mut(size_of::<u64>(), NUM_PAGES * size_of::<u64>())? in new()
95 for (i, chunk) in pte_region.chunks_exact_mut(size_of::<u64>()).enumerate() { in new()
131 GSP_PAGE_SIZE / size_of::<LibosMemoryRegionInitArgument>(), in new()
H A Dvbios.rs109 if len % core::mem::size_of::<u32>() != 0 { in read_more()
120 for addr in (start..start + len).step_by(core::mem::size_of::<u32>()) { in read_more()
602 if npde_start + core::mem::size_of::<Self>() > data.len() { in find_in_data()
723 .get(pcir_offset..pcir_offset + core::mem::size_of::<PcirStruct>()) in new()
838 if data.len() < core::mem::size_of::<Self>() { in new()
1061 FalconUCodeDesc::V2(_v2) => core::mem::size_of::<FalconUCodeDescV2>(), in sigs()
1062 FalconUCodeDesc::V3(_v3) => core::mem::size_of::<FalconUCodeDescV3>(), in sigs()
1067 let sigs_size = sigs_count * core::mem::size_of::<Bcrt30Rsa3kSignature>(); in sigs()
H A Dnum.rs52 kernel::static_assert!(size_of::<$into>() >= size_of::<$from>());
/linux/drivers/gpu/nova-core/gsp/
H A Dfw.rs601 core::mem::size_of::<RegWritePayload>(), in reg_write_payload()
618 core::mem::size_of::<RegModifyPayload>(), in reg_modify_payload()
635 core::mem::size_of::<RegPollPayload>(), in reg_poll_payload()
652 core::mem::size_of::<DelayUsPayload>(), in delay_us_payload()
669 core::mem::size_of::<RegStorePayload>(), in reg_store_payload()
730 let mut bytes = [0u8; core::mem::size_of::<u64>()]; in new()
826 length: size_of::<Self>() in init()
863 elemCount: size_of::<Self>() in init()
890 .saturating_sub(size_of::<bindings::rpc_message_header_v>()) in payload_length()
895 size_of::<Self>() + self.payload_length() in length()
[all …]
H A Dcmdq.rs174 const PTE_ARRAY_SIZE: usize = GSP_PAGE_SIZE / size_of::<u64>();
201 const MSGQ_SIZE: u32 = num::usize_into_u32::<{ size_of::<Msgq>() }>(); in new()
303 if size_of::<GspMsgElement>() + size > slice_1.len() + slice_2.len() { in allocate_command()
423 pub(crate) const NUM_PTES: usize = size_of::<GspMem>() >> GSP_PAGE_SHIFT;
471 let command_size = size_of::<M::Command>() + command.variable_payload_len(); in send_command()
487 if command_size > size_of::<M::Command>() { in send_command()
H A Dsequencer.rs65 const CMD_SIZE: usize = size_of::<fw::SequencerBufferCmd>();
86 let opcode_size = core::mem::size_of::<u32>(); in new()
301 if self.current_offset + core::mem::size_of::<u32>() > self.cmd_data.len() { in next()
/linux/rust/
H A Dffi.rs20 ::core::mem::size_of::<$name>() == ::core::mem::size_of::<::core::ffi::$name>()
/linux/rust/kernel/alloc/
H A Dlayout.rs66 match len.checked_mul(core::mem::size_of::<T>()) { in new()
104 self.len() * core::mem::size_of::<T>() in size()
/linux/drivers/gpu/nova-core/regs/
H A Dmacros.rs307 static_assert!(::core::mem::size_of::<u32>() <= $stride);
318 register!($name @ $offset [ $size ; ::core::mem::size_of::<u32>() ] $(, $comment)? {
328 static_assert!(::core::mem::size_of::<u32>() <= $stride);
339 register!($name @ $base [ $offset [ $size ; ::core::mem::size_of::<u32>() ] ]
/linux/rust/kernel/block/mq/
H A Dtag_set.rs42 let tag_set: Result<_> = core::mem::size_of::<RequestDataWrapper>() in new()
/linux/rust/kernel/debugfs/
H A Dcallback_adapters.rs124 const { assert!(core::mem::size_of::<F>() == 0) }; in materialize_zst()
/linux/drivers/gpu/nova-core/gsp/fw/
H A Dcommands.rs16 static_assert!(size_of::<GspSetSystemInfo>() < GSP_PAGE_SIZE);

12