diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-05-08 03:26:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:03 -0400 |
commit | 9adef58b1d4fbb58d7daed931b6790c5a3b7543a (patch) | |
tree | 23e5ea2b0a140d244f2ed203b4954309d052e43d /include/linux | |
parent | aa5bd7e929325dbb48be43c3dccf7d1da433e38e (diff) |
futex: get_futex_key, get_key_refs and drop_key_refs
lguest uses the convenient futex infrastructure for inter-domain I/O, so
expose get_futex_key, get_key_refs (renamed get_futex_key_refs) and
drop_key_refs (renamed drop_futex_key_refs). Also means we need to expose the
union that these use.
No code changes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/futex.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/futex.h b/include/linux/futex.h index 3f153b4e156c..820125c628c1 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -100,6 +100,35 @@ long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, | |||
100 | extern int | 100 | extern int |
101 | handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); | 101 | handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); |
102 | 102 | ||
103 | /* | ||
104 | * Futexes are matched on equal values of this key. | ||
105 | * The key type depends on whether it's a shared or private mapping. | ||
106 | * Don't rearrange members without looking at hash_futex(). | ||
107 | * | ||
108 | * offset is aligned to a multiple of sizeof(u32) (== 4) by definition. | ||
109 | * We set bit 0 to indicate if it's an inode-based key. | ||
110 | */ | ||
111 | union futex_key { | ||
112 | struct { | ||
113 | unsigned long pgoff; | ||
114 | struct inode *inode; | ||
115 | int offset; | ||
116 | } shared; | ||
117 | struct { | ||
118 | unsigned long address; | ||
119 | struct mm_struct *mm; | ||
120 | int offset; | ||
121 | } private; | ||
122 | struct { | ||
123 | unsigned long word; | ||
124 | void *ptr; | ||
125 | int offset; | ||
126 | } both; | ||
127 | }; | ||
128 | int get_futex_key(u32 __user *uaddr, union futex_key *key); | ||
129 | void get_futex_key_refs(union futex_key *key); | ||
130 | void drop_futex_key_refs(union futex_key *key); | ||
131 | |||
103 | #ifdef CONFIG_FUTEX | 132 | #ifdef CONFIG_FUTEX |
104 | extern void exit_robust_list(struct task_struct *curr); | 133 | extern void exit_robust_list(struct task_struct *curr); |
105 | extern void exit_pi_state_list(struct task_struct *curr); | 134 | extern void exit_pi_state_list(struct task_struct *curr); |