| /rust/kernel/ |
| A D | sizes.rs | 8 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; 28 pub const SZ_1M: usize = bindings::SZ_1M as usize; 30 pub const SZ_2M: usize = bindings::SZ_2M as usize; 32 pub const SZ_4M: usize = bindings::SZ_4M as usize; [all …]
|
| A D | io.rs | 24 addr: usize, 25 maxsize: usize, 28 impl<const SIZE: usize> IoRaw<SIZE> { 30 pub fn new(addr: usize, maxsize: usize) -> Result<Self> { in new() argument 40 pub fn addr(&self) -> usize { in addr() argument 46 pub fn maxsize(&self) -> usize { in maxsize() argument 174 impl<const SIZE: usize> Io<SIZE> { 188 pub fn addr(&self) -> usize { in addr() argument 199 const fn offset_valid<U>(offset: usize, size: usize) -> bool { in offset_valid() argument 209 fn io_addr<U>(&self, offset: usize) -> Result<usize> { in io_addr() argument [all …]
|
| A D | page.rs | 15 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 147 off: usize, in with_pointer_into_page() argument 148 len: usize, in with_pointer_into_page() argument 174 pub unsafe fn read_raw(&self, dst: *mut u8, offset: usize, len: usize) -> Result { in read_raw() argument 196 pub unsafe fn write_raw(&self, src: *const u8, offset: usize, len: usize) -> Result { in write_raw() argument 216 pub unsafe fn fill_zero_raw(&self, offset: usize, len: usize) -> Result { in fill_zero_raw() argument 242 offset: usize, in copy_from_user_slice_raw() argument [all …]
|
| A D | device_id.rs | 48 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> { 104 .cast::<usize>() 170 fn id(&self, index: usize) -> &T::RawType; in id() 173 fn info(&self, index: usize) -> &U; in info() 183 fn id(&self, index: usize) -> &T::RawType { in id() [all …]
|
| A D | transmute.rs | 26 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],
|
| A D | dma.rs | 279 count: usize, 300 count: usize, in alloc_attrs() argument 345 count: usize, in alloc_coherent() argument 355 pub fn count(&self) -> usize { in count() argument 360 pub fn size(&self) -> usize { in size() argument 387 pub fn dma_handle_with_offset(&self, offset: usize) -> Result<bindings::dma_addr_t> { in dma_handle_with_offset() 399 fn validate_range(&self, offset: usize, count: usize) -> Result { in validate_range() argument 419 pub unsafe fn as_slice(&self, offset: usize, count: usize) -> Result<&[T]> { in as_slice() argument 439 pub unsafe fn as_slice_mut(&mut self, offset: usize, count: usize) -> Result<&mut [T]> { in as_slice_mut() argument 471 pub unsafe fn write(&mut self, src: &[T], offset: usize) -> Result { in write() [all …]
|
| A D | uaccess.rs | 27 pub fn from_addr(addr: usize) -> Self { in from_addr() 58 pub fn wrapping_byte_add(self, add: usize) -> UserPtr { in wrapping_byte_add() 148 length: usize, 164 pub fn new(ptr: UserPtr, length: usize) -> Self { in new() 213 length: usize, 220 pub fn skip(&mut self, num_skip: usize) -> Result { in skip() 243 pub fn len(&self) -> usize { in len() argument 403 length: usize, 410 pub fn len(&self) -> usize { in len() argument 485 fn raw_strncpy_from_user(dst: &mut [MaybeUninit<u8>], src: UserPtr) -> Result<usize> { in raw_strncpy_from_user() argument [all …]
|
| A D | str.rs | 18 pub const fn len(&self) -> usize { in len() argument 214 pub const fn len(&self) -> usize { in len() argument 564 impl CStrIndex for usize {} implementation 565 impl CStrIndex for ops::Range<usize> {} 737 beg: usize, 738 pos: usize, 739 end: usize, 762 beg: pos as usize, in from_ptrs() 763 pos: pos as usize, in from_ptrs() 764 end: end as usize, in from_ptrs() [all …]
|
| A D | of.rs | 27 const DRIVER_DATA_OFFSET: usize = core::mem::offset_of!(bindings::of_device_id, data); 29 fn index(&self) -> usize { in index() argument 30 self.0.data as usize in index()
|
| A D | ioctl.rs | 13 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()
|
| A D | xarray.rs | 110 bindings::xa_find(self.xa.get(), &mut index, usize::MAX, bindings::XA_PRESENT) in iter() 115 bindings::xa_find_after(self.xa.get(), &mut index, usize::MAX, bindings::XA_PRESENT) in iter() 181 fn load<F, U>(&self, index: usize, f: F) -> Option<U> in load() argument 192 pub fn get(&self, index: usize) -> Option<T::Borrowed<'_>> { in get() 200 pub fn get_mut(&mut self, index: usize) -> Option<T::BorrowedMut<'_>> { in get_mut() 208 pub fn remove(&mut self, index: usize) -> Option<T> { in remove() 229 index: usize, in store() argument
|
| A D | acpi.rs | 27 const DRIVER_DATA_OFFSET: usize = core::mem::offset_of!(bindings::acpi_device_id, driver_data); 29 fn index(&self) -> usize { in index() argument 35 const ACPI_ID_LEN: usize = 16;
|
| A D | firmware.rs | 95 pub fn size(&self) -> usize { in size() argument 226 pub struct ModInfoBuilder<const N: usize> { 228 n: usize, 232 impl<const N: usize> ModInfoBuilder<N> { 334 pub const fn build_length(self) -> usize { in build_length() argument
|
| A D | pci.rs | 170 const DRIVER_DATA_OFFSET: usize = core::mem::offset_of!(bindings::pci_device_id, driver_data); 172 fn index(&self) -> usize { in index() argument 284 pub struct Bar<const SIZE: usize = 0> { 290 impl<const SIZE: usize> Bar<SIZE> { 313 let ioptr: usize = unsafe { bindings::pci_iomap(pdev.as_raw(), num, 0) } as usize; in new() 322 let io = match IoRaw::new(ioptr, len as usize) { in new() 344 unsafe fn do_release(pdev: &Device, ioptr: usize, num: i32) { in do_release() argument 368 impl<const SIZE: usize> Drop for Bar<SIZE> { 374 impl<const SIZE: usize> Deref for Bar<SIZE> { 418 pub fn iomap_region_sized<'a, const SIZE: usize>( in iomap_region_sized()
|
| A D | security.rs | 46 pub fn len(&self) -> usize { in len() argument 47 self.ctx.len as usize in len()
|
| A D | cpufreq.rs | 39 const CPUFREQ_NAME_LEN: usize = bindings::CPUFREQ_NAME_LEN as usize; 172 pub struct TableIndex(usize); 181 pub unsafe fn new(index: usize) -> Self { in new() 187 impl From<TableIndex> for usize { implementation 477 Hertz::from_khz(self.as_ref().min as usize) in min() 490 Hertz::from_khz(self.as_ref().max as usize) in max() 503 Hertz::from_khz(self.as_ref().cur as usize) in cur() 509 Hertz::from_khz(self.as_ref().suspend_freq as usize) in suspend_freq() 795 fn adjust_perf(_policy: &mut Policy, _min_perf: usize, _target_perf: usize, _capacity: usize) { in adjust_perf() argument 1233 let index = unsafe { TableIndex::new(index as usize) }; in target_index_callback() [all …]
|
| A D | configfs.rs | 586 size: usize, in store() argument 655 fn show(data: &Self::Data, page: &mut [u8; PAGE_SIZE]) -> Result<usize>; in show() argument 681 pub struct AttributeList<const N: usize, Data>( 689 unsafe impl<const N: usize, Data> Send for AttributeList<N, Data> {} 692 unsafe impl<const N: usize, Data> Sync for AttributeList<N, Data> {} 694 impl<const N: usize, Data> AttributeList<N, Data> { 709 pub const unsafe fn add<const I: usize, const ID: u64, O>( in add() argument 747 pub const fn new_with_child_ctor<const N: usize, Child>( 768 pub const fn new<const N: usize>( 946 const N: usize = $cnt; [all …]
|
| /rust/kernel/alloc/ |
| A D | layout.rs | 18 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
|
| A D | kvec.rs | 108 len: usize, 178 pub fn capacity(&self) -> usize { in capacity() argument 180 usize::MAX in capacity() 188 pub fn len(&self) -> usize { in len() argument 384 index: usize, in insert_within_capacity() argument 537 pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self { in from_raw_parts() argument 563 pub fn into_raw_parts(self) -> (*mut T, usize, usize) { in into_raw_parts() argument 1036 len: usize, 1045 fn into_raw_parts(self) -> (*mut T, NonNull<T>, usize, usize) { in into_raw_parts() argument 1191 fn size_hint(&self) -> (usize, Option<usize>) { in size_hint() argument [all …]
|
| /rust/kernel/io/ |
| A D | mem.rs | 77 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> {
|
| /rust/kernel/device/ |
| A D | property.rs | 113 pub fn property_match_string(&self, name: &CStr, match_str: &CStr) -> Result<usize> { in property_match_string() argument 125 Ok(ret as usize) in property_match_string() 132 len: usize, in property_read_array_vec() argument 157 pub fn property_count_elem<T: PropertyInt>(&self, name: &CStr) -> Result<usize> { in property_count_elem() argument 340 unsafe { core::slice::from_raw_parts(self.0.args.as_ptr(), self.0.nargs as usize) } in as_slice() 344 pub fn len(&self) -> usize { in len() argument 345 self.0.nargs as usize in len() 483 fn read_array_len_from_fwnode_property(fwnode: &FwNode, name: &CStr) -> Result<usize>; in read_array_len_from_fwnode_property() argument 493 impl<const N: usize> Sealed for [$int; N] {} 539 Ok(ret as usize) [all …]
|
| /rust/kernel/block/mq/ |
| A D | raw_writer.rs | 15 pos: usize, 27 pub(crate) fn from_array<const N: usize>( in from_array()
|
| /rust/pin-init/examples/ |
| A D | static_init.rs | 74 unsafe impl PinInit<CMutex<usize>> for CountInit { 77 slot: *mut CMutex<usize>, in __pinned_init() argument 85 pub static COUNT: StaticInit<CMutex<usize>, CountInit> = StaticInit::new(CountInit); 90 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main()
|
| /rust/kernel/mm/ |
| A D | virt.rs | 81 pub fn start(&self) -> usize { in start() argument 89 pub fn end(&self) -> usize { in end() argument 116 pub fn zap_page_range_single(&self, address: usize, size: usize) { in zap_page_range_single() argument 194 pub fn vm_insert_page(&self, address: usize, page: &Page) -> Result { in vm_insert_page() argument
|
| /rust/kernel/drm/ |
| A D | driver.rs | 37 size: usize, 122 fn new(drm: &drm::Device<T>, flags: usize) -> Result<Self> { in new() 134 flags: usize, in new_foreign_owned() argument
|