Lines Matching +full:ipc +full:- +full:3

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/ipc/util.h
6 * ipc helper functions (c) 1999 Manfred Spraul <manfred@colorfullife.com>
19 * The IPC ID contains 2 separate numbers - index and sequence number.
21 * bits 0-14: index (32k, 15 bits)
22 * bits 15-30: sequence number (64k, 16 bits)
25 * bits 0-23: index (16M, 24 bits)
26 * bits 24-30: sequence number (128, 7 bits)
40 #define IPCMNI_IDX_MASK ((1 << ipc_mni_shift) - 1)
47 #define IPCMNI_IDX_MASK ((1 << IPCMNI_SHIFT) - 1)
84 * Structure that holds the parameters needed by the ipc operations
97 * Structure that holds some ipc operations. This structure is used to unify
99 * . routine to call to create a new ipc object. Can be one of newque,
101 * . routine to call to check permissions for a new ipc object.
132 /* must be called with ids->rwsem acquired for writing */
145 * ipc_get_maxidx - get the highest assigned index
146 * @ids: ipc identifier set
155 if (ids->in_use == 0) in ipc_get_maxidx()
156 return -1; in ipc_get_maxidx()
158 if (ids->in_use == ipc_mni) in ipc_get_maxidx()
159 return ipc_mni - 1; in ipc_get_maxidx()
161 return ids->max_idx; in ipc_get_maxidx()
206 return ipcid_to_seqx(id) != ipcp->seq; in ipc_checkid()
211 spin_lock(&perm->lock); in ipc_lock_object()
216 spin_unlock(&perm->lock); in ipc_unlock_object()
221 assert_spin_locked(&perm->lock); in ipc_assert_locked_object()
231 * ipc_valid_object() - helper to sort out IPC_RMID races for codepaths
233 * Checks whether the ipc object is still around or if it's gone already, as
234 * ipc_rmid() may have already freed the ID while the ipc lock was spinning.
235 * Needs to be called with kern_ipc_perm.lock held -- exception made for one
240 return !perm->deleted; in ipc_valid_object()
254 return ((ns->sem_ctls[3] < 0) || (ns->sem_ctls[3] > ipc_mni)) in sem_check_semmni()
255 ? -ERANGE : 0; in sem_check_semmni()