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>
20 * The IPC ID contains 2 separate numbers - index and sequence number.
22 * bits 0-14: index (32k, 15 bits)
23 * bits 15-30: sequence number (64k, 16 bits)
26 * bits 0-23: index (16M, 24 bits)
27 * bits 24-30: sequence number (128, 7 bits)
41 #define IPCMNI_IDX_MASK ((1 << ipc_mni_shift) - 1)
48 #define IPCMNI_IDX_MASK ((1 << IPCMNI_SHIFT) - 1)
83 * Structure that holds the parameters needed by the ipc operations
96 * Structure that holds some ipc operations. This structure is used to unify
98 * . routine to call to create a new ipc object. Can be one of newque,
100 * . routine to call to check permissions for a new ipc object.
131 /* must be called with ids->rwsem acquired for writing */
144 * ipc_get_maxidx - get the highest assigned index
145 * @ids: ipc identifier set
154 if (ids->in_use == 0) in ipc_get_maxidx()
155 return -1; in ipc_get_maxidx()
157 if (ids->in_use == ipc_mni) in ipc_get_maxidx()
158 return ipc_mni - 1; in ipc_get_maxidx()
160 return ids->max_idx; in ipc_get_maxidx()
205 return ipcid_to_seqx(id) != ipcp->seq; in ipc_checkid()
210 spin_lock(&perm->lock); in ipc_lock_object()
215 spin_unlock(&perm->lock); in ipc_unlock_object()
220 assert_spin_locked(&perm->lock); in ipc_assert_locked_object()
230 * ipc_valid_object() - helper to sort out IPC_RMID races for codepaths
232 * Checks whether the ipc object is still around or if it's gone already, as
233 * ipc_rmid() may have already freed the ID while the ipc lock was spinning.
234 * Needs to be called with kern_ipc_perm.lock held -- exception made for one
239 return !perm->deleted; in ipc_valid_object()
253 return ((ns->sem_ctls[3] < 0) || (ns->sem_ctls[3] > ipc_mni)) in sem_check_semmni()
254 ? -ERANGE : 0; in sem_check_semmni()