| /linux/rust/kernel/ |
| H A D | task.rs | 202 pub fn as_ptr(&self) -> *mut bindings::task_struct { in as_ptr() method 210 unsafe { *ptr::addr_of!((*self.as_ptr()).pid) } in pid() 217 Kuid::from_raw(unsafe { bindings::task_uid(self.as_ptr()) }) in uid() 224 Kuid::from_raw(unsafe { bindings::task_euid(self.as_ptr()) }) in euid() 231 unsafe { bindings::signal_pending(self.as_ptr()) != 0 } in signal_pending() 238 let ptr = unsafe { bindings::task_get_pid_ns(self.as_ptr()) }; in get_pid_ns() 254 Some(pidns) => pidns.as_ptr(), in tgid_nr_ns() 261 unsafe { bindings::task_tgid_nr_ns(self.as_ptr(), pidns) } in tgid_nr_ns() 269 unsafe { bindings::wake_up_process(self.as_ptr()) }; in wake_up() 281 let mm = unsafe { (*self.as_ptr()).mm }; in mm() [all …]
|
| 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(), sel 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 | dma.rs | 606 T::size(self.cpu_addr.as_ptr()) in size() 611 pub fn as_ptr(&self) -> *const T { in as_ptr() method 612 self.cpu_addr.as_ptr() in as_ptr() 619 self.cpu_addr.as_ptr() in as_mut_ptr() 640 unsafe { &*self.as_ptr() } in as_ref() 966 let size = T::size(self.cpu_addr.as_ptr()); in drop() 974 self.cpu_addr.as_ptr().cast(), in drop() 1119 self.cpu_handle.as_ptr(), in drop() 1164 $crate::dma::Coherent::as_ptr(dma), $($proj)*
|
| 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 | 119 Some(table) => table.as_ptr(), in register() 124 Some(table) => table.as_ptr(), in register() 129 Some(table) => table.as_ptr(), in register() 211 let raw_id = unsafe { bindings::i2c_match_id(table.as_ptr(), dev.as_raw()) }; in i2c_id_info() 594 unsafe { bindings::i2c_unregister_device(self.0.as_ptr()) }
|
| H A D | scatterlist.rs | 213 bindings::dma_map_sgtable(dev.as_raw(), sgt.as_ptr(), dir.into(), 0) in new() 232 // - `self.sgt.as_ptr()` is a valid pointer to a `struct sg_table` by the type invariants in drop() 237 bindings::dma_unmap_sgtable(self.dev.as_raw(), self.sgt.as_ptr(), self.dir.into(), 0) in drop() 350 page_vec.push(page.as_ptr(), flags)?; in new() 370 let sgt = unsafe { &raw mut (*this.as_ptr()).sgt }.cast(); in new()
|
| H A D | rbtree.rs | 463 NonNull::new(best.as_ptr()).map(|current| { in cursor_lower_bound_mut() 484 NonNull::new(best.as_ptr()).map(|current| { in cursor_lower_bound() 843 let this = unsafe { container_of!(node.as_ptr(), Node<K, V>, links) }; in to_key_value() 876 Direction::Prev => bindings::rb_prev(self.current.as_ptr()), in get_neighbor_raw() 877 Direction::Next => bindings::rb_next(self.current.as_ptr()), in get_neighbor_raw() 923 let this = unsafe { container_of!(self.current.as_ptr(), Node<K, V>, links) }; in remove_current() 953 let neighbor = neighbor.as_ptr(); in remove_neighbor() 1028 Direction::Prev => bindings::rb_prev(self.current.as_ptr()), in get_neighbor_raw() 1029 Direction::Next => bindings::rb_next(self.current.as_ptr()), in get_neighbor_raw() 1065 let this = unsafe { container_of!(node.as_ptr(), Nod in to_key_value_raw() [all...] |
| H A D | configfs.rs | 160 item_type.as_ptr(), in new() 169 kernel::static_lock_class!().as_ptr(), in new() 265 let name = name.to_bytes_with_nul().as_ptr(); in new() 268 bindings::config_group_init_type_name(place, name.cast(), item_type.as_ptr()) in new() 756 ct_owner: owner.as_ptr(), 773 ct_owner: owner.as_ptr(), 790 fn as_ptr(&self) -> *const bindings::config_item_type { 791 fn as_ptr(&self) -> *const bindings::config_item_type { as_ptr() method
|
| H A D | sync.rs | 110 pub fn as_ptr(&self) -> *mut bindings::lock_class_key { 118 // SAFETY: `self.as_ptr()` was registered with lockdep and `self` is pinned, so the address 120 unsafe { bindings::lockdep_unregister_key(self.as_ptr()) } 84 pub(crate) fn as_ptr(&self) -> *mut bindings::lock_class_key { as_ptr() method
|
| H A D | xarray.rs | 72 let ptr = ptr.as_ptr(); in drop() 202 unsafe { T::borrow(ptr.as_ptr()) } in get_mut() 210 unsafe { T::borrow_mut(ptr.as_ptr()) } in remove()
|
| H A D | print.rs | 115 format_string.as_ptr(), 116 module_name.as_ptr(), 136 format_strings::CONT.as_ptr(),
|
| H A D | auxiliary.rs | 67 (*adrv.get()).id_table = T::ID_TABLE.as_ptr(); in register() 355 let adev: *mut bindings::auxiliary_device = obj.cast().as_ptr(); in new() 530 // SAFETY: By the type invariant of `Self`, `self.adev.as_ptr()` is a valid registered 532 unsafe { bindings::auxiliary_device_delete(self.adev.as_ptr()) }; 537 (*self.adev.as_ptr()).registration_data_rust, 543 // SAFETY: By the type invariant of `Self`, `self.adev.as_ptr()` is a valid registered 545 unsafe { bindings::auxiliary_device_uninit(self.adev.as_ptr()) };
|
| H A D | str.rs | 207 c_str.as_ptr().cast() 239 // This function exists to paper over the fact that `CStr::as_ptr` returns a `*const 354 self.as_ptr().cast() in make_ascii_uppercase() 631 s.as_bytes().as_ptr(), 812 unsafe { kstrtobool_raw(stack_string.as_ptr()) } 871 let ptr = unsafe { bindings::memchr(buf.as_ptr().cast(), 0, f.bytes_written() - 1) }; in deref()
|
| /linux/rust/pin-init/examples/ |
| H A D | linked_list.rs | 61 if ptr::eq(self.next.as_ptr(), self) { 64 Some(unsafe { NonNull::new_unchecked(self.next.as_ptr() as *mut Self) }) in next() 84 if !ptr::eq(self.next.as_ptr(), &*self) { 85 let next = unsafe { &*self.next.as_ptr() }; in drop() 86 let prev = unsafe { &*self.prev.as_ptr() }; in drop() 111 unsafe { &(*self.0.get().as_ptr()).next } 117 unsafe { &(*self.0.get().as_ptr()).prev } 122 unsafe { &*self.0.get().as_ptr() } 131 fn as_ptr(&self) -> *const ListHead { 132 self.0.get().as_ptr() 133 fn as_ptr(&self) -> *const ListHead { as_ptr() method [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() 126 unsafe { bindings::zap_vma_range(self.as_ptr(), address, size) }; in zap_page_range_single() 140 Some(unsafe { VmaMixedMap::from_raw(self.as_ptr()) }) in as_mixedmap_vma() 195 to_result(unsafe { bindings::vm_insert_page(self.as_ptr(), address, page.as_ptr()) }) in vm_insert_page() 251 unsafe { (*self.as_ptr()) in update_flags() [all...] |
| /linux/rust/kernel/sync/ |
| H A D | refcount.rs | 37 fn as_ptr(&self) -> *mut bindings::refcount_t { in as_ptr() 58 // SAFETY: `self.as_ptr()` is valid. in set() 59 unsafe { bindings::refcount_set(self.as_ptr(), value) } 72 unsafe { bindings::refcount_inc(self.as_ptr()) } 83 // SAFETY: `self.as_ptr()` is valid. in dec() 84 unsafe { bindings::refcount_dec(self.as_ptr()) } 107 // SAFETY: `self.as_ptr()` is valid. in dec_and_test() 108 unsafe { bindings::refcount_dec_and_test(self.as_ptr()) } 35 fn as_ptr(&self) -> *mut bindings::refcount_t { as_ptr() method
|
| H A D | atomic.rs | 40 /// [`Atomic::as_ptr()`], this provides a way to interact with [C-side atomic operations] 235 pub const fn as_ptr(&self) -> *mut T { 236 // GUARANTEE: Per the function guarantee of `AtomicRepr::as_ptr()`, the `self.0.as_ptr()` 239 self.0.as_ptr().cast() in get_mut() 262 unsafe { &mut *self.0.as_ptr().cast() } 228 pub const fn as_ptr(&self) -> *mut T { as_ptr() method
|
| /linux/rust/kernel/debugfs/ |
| H A D | entry.rs | 39 Some(entry) => entry.as_ptr(), in dynamic_dir() 66 // * `parent.as_ptr()` is a pointer to a valid `dentry` by invariant. in dynamic_file() 74 parent.as_ptr(), in dynamic_file() 92 Some(entry) => entry.as_ptr(), in dir() 117 // * `parent.as_ptr()` is a pointer to a valid `dentry` because we have `&'a Entry`. in file() 127 parent.as_ptr(), in file() 159 pub(crate) fn as_ptr(&self) -> *mut bindings::dentry { in drop() 167 // `as_ptr` guarantees that the pointer is of this form. 168 unsafe { bindings::debugfs_remove(self.as_ptr()) } 153 pub(crate) fn as_ptr(&self) -> *mut bindings::dentry { as_ptr() method
|
| /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/sync/atomic/ |
| H A D | internal.rs | 95 pub const fn as_ptr(&self) -> *mut T { 286 // SAFETY: `a.as_ptr()` is valid and properly aligned. 287 unsafe { bindings::#call(a.as_ptr().cast()) } 292 // SAFETY: `a.as_ptr()` is valid and properly aligned. 293 unsafe { bindings::#call(a.as_ptr().cast(), v) } 306 // SAFETY: `a.as_ptr()` is valid and properly aligned. 307 unsafe { bindings::#call(a.as_ptr().cast(), v) } 319 // SAFETY: `a.as_ptr()` is valid and properly aligned. `core::ptr::from_mut(old)` 321 unsafe { bindings::#call(a.as_ptr().cast(), core::ptr::from_mut(old), new) } 334 // SAFETY: `a.as_ptr()` i 60 pub const fn as_ptr(&self) -> *mut T { as_ptr() method [all...] |
| /linux/rust/kernel/alloc/ |
| H A D | kvec.rs | 281 self.ptr.as_ptr() in is_empty() 287 pub const fn as_ptr(&self) -> *const T { 288 self.ptr.as_ptr() in new() 804 if !unsafe { bindings::is_vmalloc_addr(self.ptr.as_ptr().cast()) } { in shrink_to() 853 // - `self.as_ptr()` is valid for reads of `self.len()` elements of `T`. in extend_with() 858 ptr::copy_nonoverlapping(self.as_ptr(), new_ptr.as_ptr().cast::<T>(), self.len()) in extend_with() 1043 // SAFETY: The memory behind `self.as_ptr()` is guaranteed to contain `self.len` in borrow() 1045 unsafe { slice::from_raw_parts(self.as_ptr(), self.len) } 1055 // SAFETY: The memory behind `self.as_ptr()` i 264 pub const fn as_ptr(&self) -> *const T { as_ptr() function [all...] |
| H A D | allocator.rs | 109 ptr.as_ptr() in call() 207 let page = unsafe { bindings::vmalloc_to_page(ptr.as_ptr().cast()) }; 298 let addr = self.0.as_ptr() as usize; in test_alignment()
|
| /linux/rust/kernel/irq/ |
| H A D | request.rs | 211 cookie: this.as_ptr().cast::<c_void>(), in new() 227 this.as_ptr().cast::<c_void>(), in new() 428 cookie: this.as_ptr().cast::<c_void>(), in new() 445 this.as_ptr().cast::<c_void>(), in new()
|
| /linux/rust/kernel/drm/ |
| H A D | device.rs | 201 ioctls: T::IOCTLS.as_ptr(), in from_raw() 242 let raw_data = unsafe { ptr::addr_of_mut!((*raw_drm.as_ptr()).data) }; in dec_ref() 309 unsafe { &raw mut (*ptr.as_ptr()).dev }.cast()
|