diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2008-05-13 20:01:27 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2008-05-13 20:01:27 +0000 |
commit | 13cbd9c97efdd801d6a355ae093c858dbcae9ea4 (patch) | |
tree | f230e0408b5364ef56a7bda21630cb827fe45bc8 /sys/compat/linux/linux_futex.h | |
parent | 8f4fa78ec6a09ea5742e967e8b84878ce0f685f3 (diff) | |
download | FreeBSD-src-13cbd9c97efdd801d6a355ae093c858dbcae9ea4.zip FreeBSD-src-13cbd9c97efdd801d6a355ae093c858dbcae9ea4.tar.gz |
Implement robust futexes. Most of the code is modelled after
what Linux does. This is because robust futexes are mostly
userspace thing which we cannot alter. Two syscalls maintain
pointer to userspace list and when process exits a routine
walks this list waking up processes sleeping on futexes
from that list.
Reviewed by: kib (mentor)
MFC after: 1 month
Diffstat (limited to 'sys/compat/linux/linux_futex.h')
-rw-r--r-- | sys/compat/linux/linux_futex.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_futex.h b/sys/compat/linux/linux_futex.h index 3ca6f3b..0f7a393 100644 --- a/sys/compat/linux/linux_futex.h +++ b/sys/compat/linux/linux_futex.h @@ -63,4 +63,22 @@ #define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */ #define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */ +/* This is defined by Linux user-space */ + +struct linux_robust_list { + struct linux_robust_list *next; +}; + +struct linux_robust_list_head { + struct linux_robust_list list; + l_ulong futex_offset; + struct linux_robust_list *pending_list; +}; + +#define FUTEX_WAITERS 0x80000000 +#define FUTEX_OWNER_DIED 0x40000000 +#define FUTEX_TID_MASK 0x3fffffff + +void release_futexes(struct proc *); + #endif /* !_LINUX_FUTEX_H */ |