~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/futex.h

Version: ~ [ linux-5.14-rc3 ] ~ [ linux-5.13.5 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.53 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.135 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.198 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.240 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.276 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.276 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_FUTEX_H
  3 #define _LINUX_FUTEX_H
  4 
  5 #include <linux/ktime.h>
  6 #include <uapi/linux/futex.h>
  7 
  8 struct inode;
  9 struct mm_struct;
 10 struct task_struct;
 11 
 12 long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
 13               u32 __user *uaddr2, u32 val2, u32 val3);
 14 
 15 extern int
 16 handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi);
 17 
 18 /*
 19  * Futexes are matched on equal values of this key.
 20  * The key type depends on whether it's a shared or private mapping.
 21  * Don't rearrange members without looking at hash_futex().
 22  *
 23  * offset is aligned to a multiple of sizeof(u32) (== 4) by definition.
 24  * We use the two low order bits of offset to tell what is the kind of key :
 25  *  00 : Private process futex (PTHREAD_PROCESS_PRIVATE)
 26  *       (no reference on an inode or mm)
 27  *  01 : Shared futex (PTHREAD_PROCESS_SHARED)
 28  *      mapped on a file (reference on the underlying inode)
 29  *  10 : Shared futex (PTHREAD_PROCESS_SHARED)
 30  *       (but private mapping on an mm, and reference taken on it)
 31 */
 32 
 33 #define FUT_OFF_INODE    1 /* We set bit 0 if key has a reference on inode */
 34 #define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */
 35 
 36 union futex_key {
 37         struct {
 38                 unsigned long pgoff;
 39                 struct inode *inode;
 40                 int offset;
 41         } shared;
 42         struct {
 43                 unsigned long address;
 44                 struct mm_struct *mm;
 45                 int offset;
 46         } private;
 47         struct {
 48                 unsigned long word;
 49                 void *ptr;
 50                 int offset;
 51         } both;
 52 };
 53 
 54 #define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = NULL } }
 55 
 56 #ifdef CONFIG_FUTEX
 57 extern void exit_robust_list(struct task_struct *curr);
 58 #ifdef CONFIG_HAVE_FUTEX_CMPXCHG
 59 #define futex_cmpxchg_enabled 1
 60 #else
 61 extern int futex_cmpxchg_enabled;
 62 #endif
 63 #else
 64 static inline void exit_robust_list(struct task_struct *curr)
 65 {
 66 }
 67 #endif
 68 
 69 #ifdef CONFIG_FUTEX_PI
 70 extern void exit_pi_state_list(struct task_struct *curr);
 71 #else
 72 static inline void exit_pi_state_list(struct task_struct *curr)
 73 {
 74 }
 75 #endif
 76 
 77 #endif
 78 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp