Home
last modified time | relevance | path

Searched +full:reference +full:- +full:sync (Results 1 – 25 of 646) sorted by relevance

12345678910>>...26

/linux/rust/kernel/sync/
H A Daref.rs1 // SPDX-License-Identifier: GPL-2.0
3 //! Internal reference counting support.
5 //! Many C types already have their own reference counting mechanism (e.g. by storing a
6 //! `refcount_t`). This module provides support for directly using their internal reference count
7 //! from Rust; instead of making users have to use an additional Rust-reference count in the form of
12 //! implementation of the `get_` and `put_` pattern used in C for reference counting.
15 //! for accessing the internal reference count of an object of the `MyType` type.
17 //! [`Arc`]: crate::sync::Arc
18 //! [`Arc<T>`]: crate::sync::Arc
22 /// Types that are _always_ reference counted.
[all …]
H A Dlocked_by.rs1 // SPDX-License-Identifier: GPL-2.0
28 /// compile-time that access to `InnerFile` is only granted when an `InnerDirectory` is also
32 /// use kernel::sync::{LockedBy, Mutex};
71 /// fn new_file(ino: u32, dir: &Directory) -> File {
86 // SAFETY: If `T` is not `Sync`, then parallel shared access to this `LockedBy` allows you to use
90 // If `T` is `Sync`, then the `access` method also becomes available, which allows you to obtain
91 // several `&T` from several threads at once. However, this is okay as `T` is `Sync`.
92 unsafe impl<T: ?Sized + Send, U: ?Sized> Sync for LockedBy<T, U> {}
102 pub fn new<B: Backend>(owner: &Lock<U, B>, data: T) -> Self { in new()
115 /// Returns a reference to the protected data when the caller provides evidence (via a
[all …]
H A Drefcount.rs1 // SPDX-License-Identifier: GPL-2.0
3 //! Atomic reference counting.
8 use crate::sync::atomic::Atomic;
11 /// Atomic reference counter.
25 /// The initial value should be non-saturated.
28 pub fn new(value: i32) -> Self { in new()
35 fn as_ptr(&self) -> *mut bindings::refcount_t { in as_ptr()
45 pub fn as_atomic(&self) -> &Atomic<i32> { in as_atomic()
47 // SAFETY: `refcount_t` is a transparent wrapper of `atomic_t`, which is an atomic 32-bit in as_atomic()
48 // integer that is layout-wise compatible with `Atomic<i32>`. All values are valid for in as_atomic()
[all …]
H A Dpoll.rs1 // SPDX-License-Identifier: GPL-2.0
11 sync::{CondVar, LockClassKey},
15 /// Creates a [`PollCondVar`] initialiser with the given name and a newly-created lock class.
19 $crate::sync::poll::PollCondVar::new(
29 /// The pointer must be null or reference a valid `poll_table`.
41 /// The pointer must be null or reference a valid `poll_table` for the duration of `'a`.
42 pub unsafe fn from_raw(table: *mut bindings::poll_table) -> Self { in from_raw()
67 /// [`CondVar`]: crate::sync::CondVar
76 pub fn new(name: &'static CStr, key: Pin<&'static LockClassKey>) -> impl PinInit<Self> { in new()
78 inner <- CondVar::new(name, key), in new()
[all …]
H A Datomic.rs1 // SPDX-License-Identifier: GPL-2.0
13 //! - A normal write from C side is treated as an atomic write if
15 //! - Mixed-size atomic accesses don't cause data races.
17 //! [`LKMM`]: srctree/tools/memory-model/
40 /// [`Atomic::as_ptr()`], this provides a way to interact with [C-side atomic operations]
49 /// [LKMM]: srctree/tools/memory-model/
50 /// [C-sid
207 from_ptr<'a>(ptr: *mut T) -> &'a Self where T: Sync, from_ptr() argument
[all...]
/linux/drivers/gpu/drm/xe/
H A Dxe_sync.c1 // SPDX-License-Identifier: MIT
8 #include <linux/dma-fence-array.h>
38 mmdrop(ufence->mm); in user_fence_destroy()
44 kref_get(&ufence->refcount); in user_fence_get()
49 kref_put(&ufence->refcount, user_fence_destroy); in user_fence_put()
60 return ERR_PTR(-EFAULT); in user_fence_create()
64 return ERR_PTR(-ENOMEM); in user_fence_create()
66 ufence->xe = xe; in user_fence_create()
67 kref_init(&ufence->refcount); in user_fence_create()
68 ufence->addr = ptr; in user_fence_create()
[all …]
/linux/include/drm/
H A Ddrm_syncobj.h29 #include <linux/dma-fence.h>
30 #include <linux/dma-fence-chain.h>
35 * struct drm_syncobj - sync object.
37 * This structure defines a generic sync object which wraps a &dma_fence.
41 * @refcount: Reference count of this object.
61 * @lock: Protects &cb_list and &ev_fd_list, and write-locks &fence.
73 * drm_syncobj_get - acquire a syncobj reference
74 * @obj: sync object
76 * This acquires an additional reference to @obj. It is illegal to call this
77 * without already holding a reference. No locks required.
[all …]
/linux/net/core/
H A Ddev_addr_lists.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * net/core/dev_addr_lists.c - Functions for handling net device lists
33 struct rb_node **ins_point = &list->tree.rb_node, *parent = NULL; in __hw_addr_insert()
40 diff = memcmp(new->addr, ha->addr, addr_len); in __hw_addr_insert()
42 diff = memcmp(&new->typ in __hw_addr_insert()
52 __hw_addr_create(const unsigned char * addr,int addr_len,unsigned char addr_type,bool global,bool sync) __hw_addr_create() argument
75 __hw_addr_add_ex(struct netdev_hw_addr_list * list,const unsigned char * addr,int addr_len,unsigned char addr_type,bool global,bool sync,int sync_count,bool exclusive) __hw_addr_add_ex() argument
141 __hw_addr_del_entry(struct netdev_hw_addr_list * list,struct netdev_hw_addr * ha,bool global,bool sync) __hw_addr_del_entry() argument
194 __hw_addr_del_ex(struct netdev_hw_addr_list * list,const unsigned char * addr,int addr_len,unsigned char addr_type,bool global,bool sync) __hw_addr_del_ex() argument
[all...]
/linux/rust/kernel/debugfs/
H A Dfile_ops.rs1 // SPDX-License-Identifier: GPL-2.0
30 /// into a reference.
43 /// inode has a pointer to `T` in its private data that is safe to convert into a reference. in new()
44 const unsafe fn new(operations: bindings::file_operations, mode: u16) -> Self {
55 pub(crate) const fn mode(&self) -> u16 { in adapt()
61 pub(super) const fn adapt(&self) -> &FileOps<T::Inner> {
71 fn deref(&self) -> &Self::Target { in fmt()
79 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fm
[all...]
/linux/drivers/net/ethernet/intel/ice/
H A Dice_dpll.h1 /* SPDX-License-Identifier: GPL-2.0 */
28 * enum ice_dpll_pin_sw - enumerate ice software pin indices:
45 /** ice_dpll_pin - store info about pins
48 * @tracker: reference count tracker
58 * @ref_sync: store id of reference sync pin
84 /** ice_dpll - store info required for DPLL control
87 * @tracker: reference count tracker
91 * @ref_state: state of dpll reference signals
96 * @dpll_state: current dpll sync state
97 * @prev_dpll_state: last dpll sync state
[all …]
H A Dice_dpll.c1 // SPDX-License-Identifier: GPL-2.0
54 * enum ice_dpll_pin_type - enumerate ice pin types:
72 [ICE_DPLL_PIN_TYPE_RCLK_INPUT] = "rclk-input",
84 * ice_dpll_is_sw_pin - check if given pin shall be controlled by SW
89 * Check if the pin shall be controlled by SW - instead of providing raw access
90 * for pin control. For E810 NIC with dpll there is additional MUX-related logic
96 * * true - pin controlled by SW
97 * * false - pin not controlled by SW
101 if (input && pf->hw.device_id == ICE_DEV_ID_E810C_QSFP) in ice_dpll_is_sw_pin()
102 index -= ICE_DPLL_SW_PIN_INPUT_BASE_QSFP - in ice_dpll_is_sw_pin()
[all …]
/linux/drivers/gpu/drm/
H A Ddrm_syncobj.c36 * Their primary use-case is to implement Vulkan fences and semaphores.
39 * - Creation and destruction of syncobjs
40 * - Import and export of syncobjs to/from a syncobj file descriptor
41 * - Import and export a syncobj's underlying fence to/from a sync file
42 * - Reset a syncobj (set its fence to NULL)
43 * - Signal a syncobj (set a trivially signaled fence)
44 * - Wait for a syncobj's fence to appear and be signaled
50 * - Signal a given point on the timeline
51 * - Wait for a given point to appear and/or be signaled
52 * - Import and export from/to a given point of a timeline
[all …]
/linux/rust/kernel/
H A Dpid_namespace.rs1 // SPDX-License-Identifier: GPL-2.0
10 use crate::{bindings, sync::aref::AlwaysRefCounted, types::Opaque};
26 pub fn as_ptr(&self) -> *mut bindings::pid_namespace { in as_ptr()
30 /// Creates a reference to a [`PidNamespace`] from a valid pointer.
35 /// returned [`PidNamespace`] reference.
36 pub unsafe fn from_ptr<'a>(ptr: *const bindings::pid_namespace) -> &'a Self { in from_ptr()
43 // SAFETY: Instances of `PidNamespace` are always reference-counted.
47 // SAFETY: The existence of a shared reference means that the refcount is nonzero. in inc_ref()
53 // SAFETY: The safety requirements guarantee that the refcount is non-zero. in dec_ref()
59 // - `PidNamespace::dec_ref` can be called from any thread.
[all …]
H A Drbtree.rs1 // SPDX-License-Identifier: GPL-2.0
3 //! Red-black trees.
7 //! Reference: <https://docs.kernel.org/core-api/rbtree.html>
17 /// A red-black tree with owned nodes.
19 /// It is backed by the kernel C red-black trees.
101 /// use kernel::{alloc::flags, rbtree::{RBTree, RBTreeNode}, sync::SpinLock};
103 /// fn insert_test(tree: &SpinLock<RBTree<u32, u32>>) -> Resul
[all...]
H A Dopp.rs1 // SPDX-License-Identifier: GPL-2.0
9 //! Reference: <https://docs.kernel.org/power/opp.html>
19 sync::aref::{ARef, AlwaysRefCounted},
40 pub(crate) fn new(table: &Table) -> Result<Self> { in new()
55 /// Returns a reference to the underlying [`cpufreq::Table`].
57 fn table(&self) -> &cpufreq::Table { in table()
67 fn deref(&self) -> &Self::Target { in deref()
90 /// Creates a null-terminated slice of pointers to [`CString`]s.
91 fn to_c_str_array(names: &[CString]) -> Result<KVec<*const c_char>> { in to_c_str_array()
92 // Allocated a null-terminated vector of pointers. in to_c_str_array()
[all …]
H A Dmm.rs1 // SPDX-License-Identifier: GPL-2.0
16 sync::aref::{ARef, AlwaysRefCounted},
55 unsafe impl Sync for Mm {}
61 // SAFETY: The pointer is valid since self is a reference. in inc_ref()
74 /// This type is like [`Mm`], but with non-zero `mm_users`. It can only be used when `mm_users` can
75 /// be proven to be non-zero at compile-time, usually because the relevant code holds an `mmget`
82 /// Values of this type are always refcounted using `mmget`. The value of `mm_users` is non-zero.
91 unsafe impl Sync for MmWithUser {}
97 // SAFETY: The pointer is valid since self is a reference. in inc_ref()
113 fn deref(&self) -> &Mm { in deref()
[all …]
H A Dtask.rs1 // SPDX-License-Identifier: GPL-2.0
12 sync::aref::ARef,
75 /// Getting the current task and storing it in some struct. The reference count is automatically
79 /// use kernel::{task::Task, sync::aref::ARef};
87 /// fn new() -> Self {
107 unsafe impl Sync for Task {}
112 /// For example, to retrieve the pid-namespace of a task, you must use rcu protection unless it is
126 /// Other operations temporarily create a new sub-context:
142 fn deref(&self) -> &Task { in deref()
161 pub fn current_raw() -> *mut bindings::task_struct { in current_raw()
[all …]
H A Drevocable.rs1 // SPDX-License-Identifier: GPL-2.0
10 use crate::{bindings, prelude::*, sync::rcu, types::Opaque};
15 sync::atomic::{AtomicBool, Ordering},
33 /// fn add_two(v: &Revocable<Example>) -> Option<u32> {
48 /// use kernel::sync::rcu;
55 /// fn add_two(v: &Revocable<Example>) -> Option<u32> {
78 // SAFETY: `Revocable` is `Sync` if the wrapped object is both `Send` and `Sync`. We require `Send`
81 unsafe impl<T: Sync + Send> Sync for Revocable<T> {}
85 pub fn new<E>(data: impl PinInit<T, E>) -> impl PinInit<Self, E> { in new()
88 data <- Opaque::pin_init(data), in new()
[all …]
/linux/Documentation/sound/cards/
H A Dhdspm.rst2 Software Interface ALSA-DSP MADI Driver
5 (translated from German, so no good English ;-),
7 2004 - winfried ritsch
11 the Controls and startup-options are ALSA-Standard and only the
19 ------------------
21 * number of channels -- depends on transmission mode
29 * Single Speed -- 1..64 channels
37 * Double Speed -- 1..32 channels
40 Note: Choosing the 56-channel mode for
41 transmission/receive-mode , only 28 are transmitted/received
[all …]
/linux/drivers/dpll/zl3073x/
H A Ddpll.c1 // SPDX-License-Identifier: GPL-2.0-only
29 * struct zl3073x_dpll_pin - DPLL pin
33 * @tracker: tracking object for the acquired reference
39 * @esync_control: embedded sync is controllable
72 * zl3073x_dpll_is_input_pin - check if the pin is input one
80 return pin->dir == DPLL_PIN_DIRECTION_INPUT; in zl3073x_dpll_is_input_pin()
84 * zl3073x_dpll_is_p_pin - check if the pin is P-pin
87 * Return: true if the pin is P-pin, false if it is N-pin
92 return zl3073x_is_p_pin(pin->id); in zl3073x_dpll_is_p_pin()
103 *direction = pin->dir; in zl3073x_dpll_pin_direction_get()
[all …]
/linux/drivers/gpu/drm/i915/gt/
H A Dintel_timeline_types.h1 /* SPDX-License-Identifier: MIT */
32 * lifetimes to the events for different use-cases. For example,
60 * Contains an RCU guarded pointer to the last request. No reference is
61 * held to the request, users must carefully acquire a reference to
75 * recent sync point. As the contexts may be executed out-of-order, we
81 struct i915_syncmap *sync; member
/linux/Documentation/driver-api/
H A Dsync_file.rst2 Sync File API Guide
8 sync_file API is, and how drivers can support it. Sync file is the carrier of
20 signals that the buffer is ready to use. And vice-versa for the consumer ->
23 Sync files allows userspace awareness on buffer sharing synchronization between
26 Sync file was originally added in the Android kernel but current Linux Desktop
29 in-fences and out-fences
30 ------------------------
32 Sync files can go either to or from userspace. When a sync_file is sent from
33 the driver to userspace we call the fences it contains 'out-fences'. They are
35 the driver creates an out-fence to be able to notify, through
[all …]
/linux/rust/kernel/drm/gem/
H A Dmod.rs1 // SPDX-License-Identifier: GPL-2.0 OR MIT
18 sync::aref::{
45 unsafe impl $( <$( $tparam_id ),+> )? $crate::sync::aref::AlwaysRefCounted for $type
51 // SAFETY: The existence of a shared reference guarantees that the refcount is
52 // non-zero.
60 // SAFETY: The safety requirements guarantee that the refcount is non-zero.
77 pub trait DriverObject: Sync + Send + Sized {
89 ) -> impl PinInit<Self, Error>; in new()
92 fn open(_obj: &<Self::Driver as drm::Driver>::Object, _file: &DriverFile<Self>) -> Result { in open()
102 /// Returns a reference to the raw `drm_gem_object` structure, which must be valid as long as
[all …]
/linux/fs/iomap/
H A Ddirect-io.c1 // SPDX-License-Identifier: GPL-2.0
4 * Copyright (c) 2016-2025 Christoph Hellwig.
6 #include <linux/bio-integrity.h>
7 #include <linux/blk-crypto.h>
57 if (dio->dops && dio->dops->bio_set) in iomap_dio_alloc_bio()
58 return bio_alloc_bioset(iter->iomap.bdev, nr_vecs, opf, in iomap_dio_alloc_bio()
59 GFP_KERNEL, dio->dops->bio_set); in iomap_dio_alloc_bio()
60 return bio_alloc(iter->iomap.bdev, nr_vecs, opf, GFP_KERNEL); in iomap_dio_alloc_bio()
66 struct kiocb *iocb = dio->iocb; in iomap_dio_submit_bio()
68 atomic_inc(&dio->ref); in iomap_dio_submit_bio()
[all …]
/linux/rust/syn/
H A Dspanned.rs1 // SPDX-License-Identifier: Apache-2.0 OR MIT
11 //! implements the [`Sync`] trait. Maybe this is the type of one of the fields
13 //! be able to pass a reference to one of those fields across threads.
16 //! [`Sync`]: std::marker::Sync
18 //! If the field type does *not* implement `Sync` as required, we want the
22 //! static assertion that `Sync` is implemented for that type.
36 //! pub fn my_macro(input: TokenStream) -> TokenStream {
41 //! struct _AssertSync where #ty: Sync;
48 //! # fn get_a_type() -> Type {
55 //! `Sync`. The errors they would see look like the following.
[all …]

12345678910>>...26