From 758b62cfb2ede5fa2187e4cab899691505179d43 Mon Sep 17 00:00:00 2001 From: Moyang Wang Date: Mon, 2 Apr 2018 16:23:02 -0400 Subject: sim, kern: support FUTEX_CMP_REQUEUE This patch supports FUTEX_CMP_REQUEUE operation. Below is its description from Linux man page: futex syscall: int futex(int *uaddr, int futex_op, int val, const struct timespec *timeout, int *uaddr2, int val3); This operation first checks whether the location uaddr still contains the value val3. If not, the operation fails with the error EAGAIN. Otherwise, the operation wakes up a maximum of val waiters that are waiting on the futex at uaddr. If there are more than val waiters, then the remaining waiters are removed from the wait queue of the source futex at uaddr and added to the wait queue of the target futex at uaddr2. The val2 argument specifies an upper limit on the number of waiters that are requeued to the futex at uaddr2. Reference: http://man7.org/linux/man-pages/man2/futex.2.html Change-Id: I6d2ebd19a935b656d19d8342f7ab450c0d2031f4 Reviewed-on: https://gem5-review.googlesource.com/c/9629 Reviewed-by: Brandon Potter Maintainer: Brandon Potter --- src/kern/linux/linux.hh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/kern') diff --git a/src/kern/linux/linux.hh b/src/kern/linux/linux.hh index 2da596814..4ed39028b 100644 --- a/src/kern/linux/linux.hh +++ b/src/kern/linux/linux.hh @@ -241,6 +241,8 @@ class Linux : public OperatingSystem // For futex system call static const unsigned TGT_FUTEX_WAIT = 0; static const unsigned TGT_FUTEX_WAKE = 1; + static const unsigned TGT_FUTEX_REQUEUE = 3; + static const unsigned TGT_FUTEX_CMP_REQUEUE = 4; static const unsigned TGT_FUTEX_WAIT_BITSET = 9; static const unsigned TGT_FUTEX_WAKE_BITSET = 10; static const unsigned TGT_EAGAIN = 11; -- cgit v1.2.3