| /linux/rust/pin-init/examples/ |
| H A D | linked_list.rs | 63 if ptr::eq(self.next.as_ptr(), self) { in next() 66 Some(unsafe { NonNull::new_unchecked(self.next.as_ptr() as *mut Self) }) in next() 86 if !ptr::eq(self.next.as_ptr(), &*self) { in drop() 87 let next = unsafe { &*self.next.as_ptr() }; in drop() 88 let prev = unsafe { &*self.prev.as_ptr() }; in drop() 113 unsafe { &(*self.0.get().as_ptr()).next } in next() 119 unsafe { &(*self.0.get().as_ptr()).prev } in prev() 124 unsafe { &*self.0.get().as_ptr() } in cur() 133 fn as_ptr(&self) -> *const ListHead { in as_ptr() method 134 self.0.get().as_ptr() in as_ptr() [all …]
|
| /linux/rust/kernel/mm/ |
| H A D | virt.rs | 56 pub fn as_ptr(&self) -> *mut bindings::vm_area_struct { in as_ptr() method 66 unsafe { MmWithUser::from_raw((*self.as_ptr()).vm_mm) } in mm() 76 unsafe { (*self.as_ptr()).__bindgen_anon_2.vm_flags } in flags() 84 unsafe { (*self.as_ptr()).__bindgen_anon_1.__bindgen_anon_1.vm_start } in start() 92 unsafe { (*self.as_ptr()).__bindgen_anon_1.__bindgen_anon_1.vm_end } in end() 127 bindings::zap_page_range_single(self.as_ptr(), address, size, core::ptr::null_mut()) in zap_page_range_single() 142 Some(unsafe { VmaMixedMap::from_raw(self.as_ptr()) }) in as_mixedmap_vma() 197 to_result(unsafe { bindings::vm_insert_page(self.as_ptr(), address, page.as_ptr()) }) in vm_insert_page() 253 unsafe { (*self.as_ptr()).__bindgen_anon_2.vm_flags = flags }; in update_flags() 267 unsafe { VmaMixedMap::from_raw(self.vma.as_ptr()) } in set_mixedmap()
|
| /linux/rust/kernel/sync/ |
| H A D | refcount.rs | 34 fn as_ptr(&self) -> *mut bindings::refcount_t { in as_ptr() method 56 unsafe { bindings::refcount_set(self.as_ptr(), value) } in set() 69 unsafe { bindings::refcount_inc(self.as_ptr()) } in inc() 81 unsafe { bindings::refcount_dec(self.as_ptr()) } in dec() 105 unsafe { bindings::refcount_dec_and_test(self.as_ptr()) } in dec_and_test()
|
| H A D | atomic.rs | 228 pub const fn as_ptr(&self) -> *mut T { in as_ptr() method 232 self.0.as_ptr().cast() in as_ptr() 244 unsafe { &mut *self.0.as_ptr().cast() } in get_mut()
|
| /linux/rust/kernel/debugfs/ |
| H A D | entry.rs | 33 Some(entry) => entry.as_ptr(), in dynamic_dir() 68 parent.as_ptr(), in dynamic_file() 86 Some(entry) => entry.as_ptr(), in dir() 121 parent.as_ptr(), in file() 153 pub(crate) fn as_ptr(&self) -> *mut bindings::dentry { in as_ptr() method 162 unsafe { bindings::debugfs_remove(self.as_ptr()) } in drop()
|
| /linux/rust/kernel/fs/ |
| H A D | file.rs | 204 unsafe { bindings::get_file(self.as_ptr()) }; in inc_ref() 211 unsafe { bindings::fput(obj.cast().as_ptr()) } in dec_ref() 240 unsafe { bindings::get_file(self.as_ptr()) }; in inc_ref() 248 unsafe { bindings::fput(obj.cast().as_ptr()) } in dec_ref() 317 pub fn as_ptr(&self) -> *mut bindings::file { in as_ptr() method 325 let ptr = unsafe { (*self.as_ptr()).f_cred }; in cred() 343 unsafe { core::ptr::addr_of!((*self.as_ptr()).f_flags).read_volatile() } in flags() 437 unsafe { bindings::fd_install(self.fd, file.as_ptr()) }; in fd_install()
|
| /linux/rust/kernel/ |
| H A D | regulator.rs | 255 self.inner.as_ptr(), in set_voltage() 265 let voltage = unsafe { bindings::regulator_get_voltage(self.inner.as_ptr()) }; in get_voltage() 288 to_result(unsafe { bindings::regulator_enable(self.inner.as_ptr()) }) in enable_internal() 293 to_result(unsafe { bindings::regulator_disable(self.inner.as_ptr()) }) in disable_internal() 355 unsafe { bindings::regulator_is_enabled(self.inner.as_ptr()) != 0 } in is_enabled() 365 unsafe { bindings::regulator_disable(self.inner.as_ptr()) }; in drop() 369 unsafe { bindings::regulator_put(self.inner.as_ptr()) }; in drop()
|
| H A D | bitmap.rs | 76 pub fn as_ptr(&self) -> *const usize { in as_ptr() method 173 unsafe { self.repr.ptr.as_ptr() } in deref() 192 unsafe { self.repr.ptr.as_ptr() } in deref_mut() 222 unsafe { bindings::bitmap_free(self.repr.ptr.as_ptr()) }; in drop() 341 unsafe { bindings::set_bit(index, self.as_ptr().cast_mut()) }; in set_bit_atomic() 392 unsafe { bindings::clear_bit(index, self.as_ptr().cast_mut()) }; in clear_bit_atomic() 422 src.as_ptr(), in copy_and_extend() 452 let index = unsafe { bindings::_find_last_bit(self.as_ptr(), self.len()) }; in last_bit() 473 let index = unsafe { bindings::_find_next_bit(self.as_ptr(), self.len(), start) }; in next_bit() 493 let index = unsafe { bindings::_find_next_zero_bit(self.as_ptr(), self.len(), start) }; in next_zero_bit() [all …]
|
| H A D | pid_namespace.rs | 26 pub fn as_ptr(&self) -> *mut bindings::pid_namespace { in as_ptr() method 48 unsafe { bindings::get_pid_ns(self.as_ptr()) }; in inc_ref() 54 unsafe { bindings::put_pid_ns(obj.cast().as_ptr()) } in dec_ref()
|
| H A D | mm.rs | 68 unsafe { bindings::mmdrop(obj.cast().as_ptr()) }; in dec_ref() 104 unsafe { bindings::mmput(obj.cast().as_ptr()) }; in dec_ref() 295 unsafe { bindings::vma_end_read(self.vma.as_ptr()) }; in drop()
|
| H A D | i2c.rs | 111 Some(table) => table.as_ptr(), in register() 116 Some(table) => table.as_ptr(), in register() 121 Some(table) => table.as_ptr(), in register() 203 let raw_id = unsafe { bindings::i2c_match_id(table.as_ptr(), dev.as_raw()) }; in i2c_id_info() 400 Ok(unsafe { (&*adapter.as_ptr().cast::<I2cAdapter<device::Normal>>()).into() }) in get() 577 unsafe { bindings::i2c_unregister_device(self.0.as_ptr()) } in drop()
|
| H A D | scatterlist.rs | 212 bindings::dma_map_sgtable(dev.as_raw(), sgt.as_ptr(), dir.into(), 0) in new() 236 bindings::dma_unmap_sgtable(self.dev.as_raw(), self.sgt.as_ptr(), self.dir.into(), 0) in drop() 349 page_vec.push(page.as_ptr(), flags)?; in new() 369 let sgt = unsafe { &raw mut (*this.as_ptr()).sgt }.cast(); in new()
|
| H A D | rbtree.rs | 460 NonNull::new(best.as_ptr()).map(|current| { in cursor_lower_bound_mut() 481 NonNull::new(best.as_ptr()).map(|current| { in cursor_lower_bound() 840 let this = unsafe { container_of!(node.as_ptr(), Node<K, V>, links) }; in to_key_value() 873 Direction::Prev => bindings::rb_prev(self.current.as_ptr()), in get_neighbor_raw() 874 Direction::Next => bindings::rb_next(self.current.as_ptr()), in get_neighbor_raw() 920 let this = unsafe { container_of!(self.current.as_ptr(), Node<K, V>, links) }; in remove_current() 950 let neighbor = neighbor.as_ptr(); in remove_neighbor() 1025 Direction::Prev => bindings::rb_prev(self.current.as_ptr()), in get_neighbor_raw() 1026 Direction::Next => bindings::rb_next(self.current.as_ptr()), in get_neighbor_raw() 1062 let this = unsafe { container_of!(node.as_ptr(), Node<K, V>, links) }; in to_key_value_raw()
|
| H A D | auxiliary.rs | 41 (*adrv.get()).id_table = T::ID_TABLE.as_ptr(); in register() 269 let adev: *mut bindings::auxiliary_device = obj.cast().as_ptr(); in dec_ref() 367 unsafe { bindings::auxiliary_device_delete(self.0.as_ptr()) }; in drop() 373 unsafe { bindings::auxiliary_device_uninit(self.0.as_ptr()) }; in drop()
|
| H A D | sync.rs | 84 pub(crate) fn as_ptr(&self) -> *mut bindings::lock_class_key { in as_ptr() method 94 unsafe { bindings::lockdep_unregister_key(self.as_ptr()) } in drop()
|
| H A D | configfs.rs | 161 item_type.as_ptr(), in new() 170 kernel::static_lock_class!().as_ptr(), in new() 266 let name = name.to_bytes_with_nul().as_ptr(); in new() 269 bindings::config_group_init_type_name(place, name.cast(), item_type.as_ptr()) in new() 757 ct_owner: owner.as_ptr(), 774 ct_owner: owner.as_ptr(), 791 fn as_ptr(&self) -> *const bindings::config_item_type { in as_ptr() method
|
| H A D | xarray.rs | 66 let ptr = ptr.as_ptr(); in drop() 195 unsafe { T::borrow(ptr.as_ptr()) } in get() 203 unsafe { T::borrow_mut(ptr.as_ptr()) } in get_mut()
|
| H A D | print.rs | 110 format_string.as_ptr(), 111 module_name.as_ptr(), 131 format_strings::CONT.as_ptr(), in call_printk_cont()
|
| H A D | str.rs | 193 c_str.as_ptr().cast() in as_char_ptr_in_const_context() 338 self.as_ptr().cast() in as_char_ptr() 601 s.as_bytes().as_ptr(), in write_str() 782 unsafe { kstrtobool_raw(stack_string.as_ptr()) } in kstrtobool_bytes() 838 let ptr = unsafe { bindings::memchr(buf.as_ptr().cast(), 0, f.bytes_written() - 1) }; in try_from_fmt()
|
| H A D | dma.rs | 448 self.cpu_addr.as_ptr() in start_ptr() 454 self.cpu_addr.as_ptr() in start_ptr_mut() 560 src.as_ptr(), in write() 582 Ok(unsafe { self.cpu_addr.as_ptr().add(offset) }) in item_from_index()
|
| H A D | driver.rs | 249 let raw_id = unsafe { bindings::acpi_match_device(table.as_ptr(), dev.as_raw()) }; in acpi_id_info() 283 let raw_id = unsafe { bindings::of_match_device(table.as_ptr(), dev.as_raw()) }; in of_id_info()
|
| H A D | usb.rs | 45 (*udrv.get()).id_table = T::ID_TABLE.as_ptr(); in register() 378 unsafe { bindings::usb_put_intf(obj.cast().as_ptr()) } in dec_ref() 429 unsafe { bindings::usb_put_dev(obj.cast().as_ptr()) } in dec_ref()
|
| /linux/rust/kernel/sync/atomic/ |
| H A D | internal.rs | 60 pub const fn as_ptr(&self) -> *mut T { in as_ptr() method 207 unsafe { bindings::#call(a.as_ptr().cast()) } 213 unsafe { bindings::#call(a.as_ptr().cast(), v) } 226 unsafe { bindings::#call(a.as_ptr().cast(), v) } 240 unsafe { bindings::#call(a.as_ptr().cast(), core::ptr::from_mut(old), new) } 253 unsafe { bindings::#call(v, a.as_ptr().cast()) } 262 unsafe { bindings::#call(v, a.as_ptr().cast()) }
|
| /linux/rust/kernel/alloc/ |
| H A D | kvec.rs | 255 self.ptr.as_ptr() in as_mut_ptr() 261 pub const fn as_ptr(&self) -> *const T { in as_ptr() function 262 self.ptr.as_ptr() in as_ptr() 892 unsafe { slice::from_raw_parts(self.as_ptr(), self.len) } in deref() 1143 let has_advanced = ptr != buf.as_ptr(); in collect() 1154 unsafe { ptr::copy(ptr, buf.as_ptr(), len) }; in collect() 1155 ptr = buf.as_ptr(); in collect() 1178 ptr.as_ptr().cast() in collect()
|
| H A D | allocator.rs | 98 ptr.as_ptr() in call() 193 let page = unsafe { bindings::vmalloc_to_page(ptr.as_ptr().cast()) }; in to_page() 283 let addr = self.0.as_ptr() as usize; in test_alignment()
|