]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/sem.h
ipc/sem.c: avoid using spin_unlock_wait()
[mirror_ubuntu-artful-kernel.git] / include / linux / sem.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_SEM_H
2#define _LINUX_SEM_H
3
60063497 4#include <linux/atomic.h>
380af1b3 5#include <linux/rcupdate.h>
31a7c474 6#include <linux/cache.h>
607ca46e 7#include <uapi/linux/sem.h>
1da177e4 8
8c65b4a6
TS
9struct task_struct;
10
1da177e4
LT
11/* One sem_array data structure for each set of semaphores in the system. */
12struct sem_array {
31a7c474
MS
13 struct kern_ipc_perm ____cacheline_aligned_in_smp
14 sem_perm; /* permissions .. see ipc.h */
1da177e4
LT
15 time_t sem_ctime; /* last change time */
16 struct sem *sem_base; /* ptr to first semaphore in array */
1a82e9e1
MS
17 struct list_head pending_alter; /* pending operations */
18 /* that alter the array */
19 struct list_head pending_const; /* pending complex operations */
20 /* that do not alter semvals */
4daa28f6 21 struct list_head list_id; /* undo requests on this array */
b97e820f
MS
22 int sem_nsems; /* no. of semaphores in array */
23 int complex_count; /* pending complex operations */
5864a2fd 24 bool complex_mode; /* no parallel simple ops */
1da177e4
LT
25};
26
f567a185
MS
27#ifdef CONFIG_SYSVIPC
28
1da177e4
LT
29struct sysv_sem {
30 struct sem_undo_list *undo_list;
31};
32
1da177e4
LT
33extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
34extern void exit_sem(struct task_struct *tsk);
35
36#else
f567a185
MS
37
38struct sysv_sem {
39 /* empty */
40};
41
1da177e4
LT
42static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
43{
44 return 0;
45}
46
47static inline void exit_sem(struct task_struct *tsk)
48{
49 return;
50}
51#endif
52
1da177e4 53#endif /* _LINUX_SEM_H */