diff mbox series

[5/8] linux-user: Implement PI futexes

Message ID 20220829021006.67305-6-richard.henderson@linaro.org
State New
Headers show
Series linux-user: Futex improvements | expand

Commit Message

Richard Henderson Aug. 29, 2022, 2:10 a.m. UTC
Define the missing FUTEX_* constants in syscall_defs.h

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall_defs.h |  3 +++
 linux-user/syscall.c      | 10 ++++++++++
 2 files changed, 13 insertions(+)

Comments

Laurent Vivier Sept. 27, 2022, 10:29 a.m. UTC | #1
Le 29/08/2022 à 04:10, Richard Henderson a écrit :
> Define the missing FUTEX_* constants in syscall_defs.h
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   linux-user/syscall_defs.h |  3 +++
>   linux-user/syscall.c      | 10 ++++++++++
>   2 files changed, 13 insertions(+)
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox series

Patch

diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 85b0f33e91..9a6d7893d9 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2699,6 +2699,9 @@  struct target_drm_i915_getparam {
 #define FUTEX_TRYLOCK_PI        8
 #define FUTEX_WAIT_BITSET       9
 #define FUTEX_WAKE_BITSET       10
+#define FUTEX_WAIT_REQUEUE_PI   11
+#define FUTEX_CMP_REQUEUE_PI    12
+#define FUTEX_LOCK_PI2          13
 
 #define FUTEX_PRIVATE_FLAG      128
 #define FUTEX_CLOCK_REALTIME    256
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f50cc70f1a..d2d18d29a6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7773,8 +7773,17 @@  static int do_futex(CPUState *cpu, bool time64, target_ulong uaddr,
     case FUTEX_WAIT_BITSET:
         val = tswap32(val);
         break;
+    case FUTEX_WAIT_REQUEUE_PI:
+        val = tswap32(val);
+        haddr2 = g2h(cpu, uaddr2);
+        break;
+    case FUTEX_LOCK_PI:
+    case FUTEX_LOCK_PI2:
+        break;
     case FUTEX_WAKE:
     case FUTEX_WAKE_BITSET:
+    case FUTEX_TRYLOCK_PI:
+    case FUTEX_UNLOCK_PI:
         timeout = 0;
         break;
     case FUTEX_FD:
@@ -7782,6 +7791,7 @@  static int do_futex(CPUState *cpu, bool time64, target_ulong uaddr,
         timeout = 0;
         break;
     case FUTEX_CMP_REQUEUE:
+    case FUTEX_CMP_REQUEUE_PI:
         val3 = tswap32(val3);
         /* fall through */
     case FUTEX_REQUEUE: