/linux/rust/kernel/list/ |
H A D | arc.rs | 42 unsafe fn on_create_list_arc_from_unique(self: Pin<&mut Self>); in on_create_list_arc_from_unique() 173 pub fn new(contents: T, flags: Flags) -> Result<Self, AllocError> { in new() 183 pub fn pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Self, E> in pin_init() 194 pub fn init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in init() 208 fn from(unique: UniqueArc<T>) -> Self { in from() 219 fn from(mut unique: Pin<UniqueArc<T>>) -> Self { in from() 237 pub fn pair_from_unique<const ID2: u64>(unique: UniqueArc<T>) -> (Self, ListArc<T, ID2>) in pair_from_unique() 250 ) -> (Self, ListArc<T, ID2>) in pair_from_pin_unique() 277 pub fn try_from_arc(arc: Arc<T>) -> Result<Self, Arc<T>> in try_from_arc() 327 unsafe fn transmute_from_arc(arc: Arc<T>) -> Self { in transmute_from_arc() [all …]
|
/linux/rust/kernel/ |
H A D | cpumask.rs | 61 pub unsafe fn as_mut_ref<'a>(ptr: *mut bindings::cpumask) -> &'a mut Self { in as_mut_ref() 75 pub unsafe fn as_ref<'a>(ptr: *const bindings::cpumask) -> &'a Self { in as_ref() 85 let this: *const Self = self; in as_raw() constant 161 pub fn copy(&self, dstp: &mut Self) { in copy() 227 pub fn new_zero(_flags: Flags) -> Result<Self, AllocError> { in new_zero() 255 pub unsafe fn new(_flags: Flags) -> Result<Self, AllocError> { in new() 282 pub unsafe fn as_mut_ref<'a>(ptr: *mut bindings::cpumask_var_t) -> &'a mut Self { in as_mut_ref() 296 pub unsafe fn as_ref<'a>(ptr: *const bindings::cpumask_var_t) -> &'a Self { in as_ref() 305 pub fn try_clone(cpumask: &Cpumask) -> Result<Self> { in try_clone()
|
H A D | cpu.rs | 56 pub unsafe fn from_i32_unchecked(id: i32) -> Self { in from_i32_unchecked() 65 pub fn from_i32(id: i32) -> Option<Self> { in from_i32() 80 pub unsafe fn from_u32_unchecked(id: u32) -> Self { in from_u32_unchecked() 91 pub fn from_u32(id: u32) -> Option<Self> { in from_u32() 119 fn from(id: CpuId) -> Self { in from() 125 fn from(id: CpuId) -> Self { in from()
|
H A D | types.rs | 63 unsafe fn from_foreign(ptr: *mut Self::PointedTo) -> Self; in from_foreign() 75 unsafe fn try_from_foreign(ptr: *mut Self::PointedTo) -> Option<Self> { in try_from_foreign() 139 unsafe fn from_foreign(_: *mut Self::PointedTo) -> Self {} in from_foreign() 223 pub fn new_with_data(data: T, cleanup_func: F) -> Self { in new_with_data() 333 pub const fn new(value: T) -> Self { in new() 357 pub fn pin_init(slot: impl PinInit<T>) -> impl PinInit<Self> { in pin_init() 375 pub fn ffi_init(init_func: impl FnOnce(*mut T)) -> impl PinInit<Self> { in ffi_init() 396 ) -> impl PinInit<Self, E> { in try_ffi_init() 451 unsafe fn dec_ref(obj: NonNull<Self>); in dec_ref() 493 pub unsafe fn from_raw(ptr: NonNull<T>) -> Self { in from_raw() [all …]
|
H A D | firmware.rs | 62 fn request_internal(name: &CStr, dev: &Device, func: FwFunc) -> Result<Self> { in request_internal() 79 pub fn request(name: &CStr, dev: &Device) -> Result<Self> { in request() 85 pub fn request_nowarn(name: &CStr, dev: &Device) -> Result<Self> { in request_nowarn() 233 pub const fn new(module_name: &'static CStr) -> Self { in new() 241 const fn push_internal(mut self, bytes: &[u8]) -> Self { in push_internal() 279 pub const fn push(self, s: &str) -> Self { in push() 288 const fn push_module_name(self) -> Self { in push_module_name() 312 pub const fn new_entry(self) -> Self { in new_entry()
|
H A D | cpufreq.rs | 91 fn new(val: u32) -> Result<Self> { in new() 105 fn from(rel: Relation) -> Self { in from() 141 pub unsafe fn from_raw_mut<'a>(ptr: *mut bindings::cpufreq_policy_data) -> &'a mut Self { in from_raw_mut() 152 let this: *const Self = self; in as_raw() constant 181 pub unsafe fn new(index: usize) -> Self { in new() 189 fn from(index: TableIndex) -> Self { in from() 235 pub unsafe fn from_raw<'a>(ptr: *const bindings::cpufreq_frequency_table) -> &'a Self { in from_raw() 246 let this: *const Self = self; in as_raw() constant 289 fn new(entries: KVec<bindings::cpufreq_frequency_table>) -> Result<Self> { in new() 425 pub unsafe fn from_raw<'a>(ptr: *const bindings::cpufreq_policy) -> &'a Self { in from_raw() [all …]
|
H A D | opp.rs | 39 pub(crate) fn new(table: &Table) -> Result<Self> { in new() 122 fn from(volt: MicroVolt) -> Self { in from() 147 fn from(power: MicroWatt) -> Self { in from() 181 fn new(dev: &ARef<Device>, mut data: Data) -> Result<Self> { in new() 230 pub fn new(freq: Hertz, volt: MicroVolt, level: u32, turbo: bool) -> Self { in new() 379 pub fn set_clk_names(mut self, names: KVec<CString>) -> Result<Self> { in set_clk_names() 393 pub fn set_prop_name(mut self, name: CString) -> Result<Self> { in set_prop_name() 403 pub fn set_regulator_names(mut self, names: KVec<CString>) -> Result<Self> { in set_regulator_names() 418 pub fn set_required_dev(mut self, dev: ARef<Device>, index: u32) -> Result<Self> { in set_required_dev() 428 pub fn set_supported_hw(mut self, hw: KVec<u32>) -> Result<Self> { in set_supported_hw() [all …]
|
H A D | clk.rs | 34 pub fn from_khz(khz: c_ulong) -> Self { in from_khz() 39 pub fn from_mhz(mhz: c_ulong) -> Self { in from_mhz() 44 pub fn from_ghz(ghz: c_ulong) -> Self { in from_ghz() 70 fn from(freq: Hertz) -> Self { in from() 134 pub fn get(dev: &Device, name: Option<&CStr>) -> Result<Self> { in get() 306 pub fn get(dev: &Device, name: Option<&CStr>) -> Result<Self> { in get()
|
H A D | pci.rs | 134 pub const fn from_id(vendor: u32, device: u32) -> Self { in from_id() 150 pub const fn from_class(class: u32, class_mask: u32) -> Self { in from_class() 243 fn probe(dev: &Device<device::Core>, id_info: &Self::IdInfo) -> Result<Pin<KBox<Self>>>; in probe() 274 fn new(pdev: &Device, num: u32, name: &CStr) -> Result<Self> { in new() 444 unsafe fn dec_ref(obj: NonNull<Self>) { in dec_ref() 464 fn try_from(dev: &device::Device<Ctx>) -> Result<Self, Self::Error> { in try_from()
|
H A D | auxiliary.rs | 113 pub const fn new(modname: &'static CStr, name: &'static CStr) -> Self { in new() 192 fn probe(dev: &Device<device::Core>, id_info: &Self::IdInfo) -> Result<Pin<KBox<Self>>>; in probe() 225 let ptr: *const Self = self; in parent() constant 259 unsafe fn dec_ref(obj: NonNull<Self>) { in dec_ref() 303 pub fn new(parent: &device::Device, name: &CStr, id: u32, modname: &CStr) -> Result<Self> { in new()
|
H A D | device.rs | 58 pub unsafe fn get_device(ptr: *mut bindings::device) -> ARef<Self> { in get_device() 72 pub(crate) fn parent(&self) -> Option<&Self> { in parent() 97 pub unsafe fn as_ref<'a>(ptr: *mut bindings::device) -> &'a Self { in as_ref() 225 unsafe fn dec_ref(obj: ptr::NonNull<Self>) { in dec_ref()
|
H A D | configfs.rs | 152 ) -> impl PinInit<Self, Error> { in new() 189 fn drop(self: Pin<&mut Self>) { in drop() 220 unsafe fn container_of(group: *const bindings::config_group) -> *const Self; in container_of() 231 unsafe fn container_of(group: *const bindings::config_group) -> *const Self { in container_of() 262 ) -> impl PinInit<Self, Error> { in new() 289 unsafe fn container_of(group: *const bindings::config_group) -> *const Self { in container_of() 613 pub const fn new(name: &'static CStr) -> Self { in new()
|
H A D | revocable.rs | 83 pub fn new(data: impl PinInit<T>) -> impl PinInit<Self> { in new() 211 fn drop(self: Pin<&mut Self>) { in drop() 240 fn new(data_ref: *const T, rcu_guard: rcu::Guard) -> Self { in new()
|
H A D | platform.rs | 168 -> Result<Pin<KBox<Self>>>; in probe() 205 unsafe fn dec_ref(obj: NonNull<Self>) { in dec_ref() 225 fn try_from(dev: &device::Device<Ctx>) -> Result<Self, Self::Error> { in try_from()
|
/linux/rust/pin-init/src/ |
H A D | alloc.rs | 30 fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E> in try_pin_init() 38 fn pin_init(init: impl PinInit<T>) -> Result<Pin<Self>, AllocError> { in pin_init() 50 fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E> in try_init() 55 fn init(init: impl Init<T>) -> Result<Self, AllocError> { in init() method 82 fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E> in try_pin_init() 90 fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E> in try_init() 100 fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E> in try_pin_init() 118 fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E> in try_init()
|
H A D | lib.rs | 1084 fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E> in pin_chain() 1192 fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E> in chain() 1461 fn drop(self: Pin<&mut Self>, only_call_from_drop: __internal::OnlyCallFromDrop); in drop() 1596 fn pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E>; in pin_init() argument 1600 fn pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> { in pin_init() argument 1607 fn pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> { in pin_init() argument 1615 fn pin_init<E>(init: impl PinInit<T, E>) -> impl PinInit<Self, E> { in pin_init() argument
|
/linux/rust/kernel/sync/ |
H A D | arc.rs | 218 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in try_init() 228 pub fn new(contents: T, flags: Flags) -> Result<Self, AllocError> { in new() 252 unsafe fn from_inner(inner: NonNull<ArcInner<T>>) -> Self { in from_inner() 285 pub unsafe fn from_raw(ptr: *const T) -> Self { in from_raw() 308 pub fn ptr_eq(this: &Self, other: &Self) -> bool { in ptr_eq() 385 unsafe fn from_foreign(ptr: *mut Self::PointedTo) -> Self { in from_foreign() 430 fn clone(&self) -> Self { in clone() 467 fn from(item: UniqueArc<T>) -> Self { in from() 473 fn from(item: Pin<UniqueArc<T>>) -> Self { in from() 550 fn clone(&self) -> Self { in clone() [all …]
|
/linux/rust/pin-init/examples/ |
H A D | linked_list.rs | 42 pub fn insert_next(list: &ListHead) -> impl PinInit<Self, Infallible> + '_ { in insert_next() 51 pub fn insert_prev(list: &ListHead) -> impl PinInit<Self, Infallible> + '_ { in insert_prev() 60 pub fn next(&self) -> Option<NonNull<Self>> { in next() 83 fn drop(self: Pin<&mut Self>) { in drop() 105 unsafe fn new_unchecked(ptr: NonNull<ListHead>) -> Self { in new_unchecked()
|
H A D | pthread_mutex.rs | 36 fn drop(self: Pin<&mut Self>) { in drop() 51 fn from(e: Infallible) -> Self { in from() 58 fn from(_: AllocError) -> Self { in from() 64 pub fn new(data: T) -> impl PinInit<Self, Error> { in new()
|
/linux/scripts/ |
H A D | generate_rust_target.rs | 69 fn from(value: bool) -> Self { in from() 75 fn from(value: i32) -> Self { in from() 81 fn from(value: String) -> Self { in from() 87 fn from(value: &str) -> Self { in from() 93 fn from(object: Object) -> Self { in from() 99 fn from(i: [T; N]) -> Self { in from()
|
/linux/rust/kernel/alloc/ |
H A D | kbox.rs | 176 pub const unsafe fn from_raw(raw: *mut T) -> Self { in from_raw() 253 pub fn new(x: T, flags: Flags) -> Result<Self, AllocError> { in new() 293 pub fn into_pin(this: Self) -> Pin<Self> { in into_pin() 346 fn from(b: Box<T, A>) -> Self { in from() 385 fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>, E> in try_pin_init() 393 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in try_init() 414 unsafe fn from_foreign(ptr: *mut Self::PointedTo) -> Self { in from_foreign() 447 unsafe fn from_foreign(ptr: *mut Self::PointedTo) -> Self { in from_foreign()
|
/linux/rust/kernel/drm/ |
H A D | device.rs | 98 pub fn new(dev: &device::Device, data: impl PinInit<T::Data, Error>) -> Result<ARef<Self>> { in new() 137 unsafe fn from_drm_device(ptr: *const bindings::drm_device) -> *mut Self { in from_drm_device() 157 pub unsafe fn as_ref<'a>(ptr: *const bindings::drm_device) -> &'a Self { in as_ref() 183 unsafe fn dec_ref(obj: NonNull<Self>) { in dec_ref()
|
/linux/rust/kernel/block/mq/ |
H A D | gen_disk.rs | 41 pub fn rotational(mut self, rotational: bool) -> Self { in rotational() method 63 pub fn logical_block_size(mut self, block_size: u32) -> Result<Self> { in logical_block_size() 78 pub fn physical_block_size(mut self, block_size: u32) -> Result<Self> { in physical_block_size() 85 pub fn capacity_sectors(mut self, capacity: u64) -> Self { in capacity_sectors()
|
/linux/rust/kernel/drm/gem/ |
H A D | mod.rs | 20 fn new(dev: &drm::Device<T::Driver>, size: usize) -> impl PinInit<Self, Error>; in new() 54 unsafe fn as_ref<'a>(self_ptr: *mut bindings::drm_gem_object) -> &'a Self; in as_ref() 64 unsafe fn dec_ref(obj: NonNull<Self>) { in dec_ref() 127 unsafe fn as_ref<'a>(self_ptr: *mut bindings::drm_gem_object) -> &'a Self { in as_ref() 162 ) -> Result<ARef<Self>> { in lookup_handle() 234 pub fn new(dev: &drm::Device<T::Driver>, size: usize) -> Result<ARef<Self>> { in new()
|
/linux/drivers/gpu/nova-core/ |
H A D | gpu.rs | 111 fn try_from(value: u8) -> Result<Self> { in try_from() 127 fn from_boot0(boot0: regs::NV_PMC_BOOT_0) -> Self { in from_boot0() 172 ) -> Result<impl PinInit<Self>> { in new()
|