From e18e9d0af30c99c7374b623086119148137f5613 Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Sat, 20 Mar 2021 13:16:25 -0700 Subject: [PATCH] Rework ck_ec tests when invoking FUTEX_WAIT_BITSET Send FUTEX_BITSET_MATCH_ANY as the SYS_futex `val3` argument instead of the deadline pointer, as deadline can be NULL which will result in the futex call failing with EINVAL (val3 must have at least one bit set). --- regressions/ck_ec/benchmark/ck_ec.c | 4 ++-- regressions/ck_ec/validate/ck_ec_smoke_test.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/regressions/ck_ec/benchmark/ck_ec.c b/regressions/ck_ec/benchmark/ck_ec.c index 2c6b5d3c..655f9d8a 100644 --- a/regressions/ck_ec/benchmark/ck_ec.c +++ b/regressions/ck_ec/benchmark/ck_ec.c @@ -121,7 +121,7 @@ static void wait32(const struct ck_ec_wait_state *state, assert(state->ops == &test_ops); syscall(SYS_futex, address, FUTEX_WAIT_BITSET, expected, deadline, - NULL, deadline, 0); + NULL, FUTEX_BITSET_MATCH_ANY, 0); return; } @@ -143,7 +143,7 @@ static void wait64(const struct ck_ec_wait_state *state, syscall(SYS_futex, low_half, FUTEX_WAIT_BITSET, (uint32_t)expected, deadline, - NULL, deadline, 0); + NULL, FUTEX_BITSET_MATCH_ANY, 0); return; } diff --git a/regressions/ck_ec/validate/ck_ec_smoke_test.c b/regressions/ck_ec/validate/ck_ec_smoke_test.c index fadfd853..3aca1626 100644 --- a/regressions/ck_ec/validate/ck_ec_smoke_test.c +++ b/regressions/ck_ec/validate/ck_ec_smoke_test.c @@ -46,7 +46,7 @@ static void wait32(const struct ck_ec_wait_state *state, assert(state->ops == &test_ops); syscall(SYS_futex, address, FUTEX_WAIT_BITSET, expected, deadline, - NULL, deadline, 0); + NULL, FUTEX_BITSET_MATCH_ANY, 0); return; } @@ -68,7 +68,7 @@ static void wait64(const struct ck_ec_wait_state *state, syscall(SYS_futex, low_half, FUTEX_WAIT_BITSET, (uint32_t)expected, deadline, - NULL, deadline, 0); + NULL, FUTEX_BITSET_MATCH_ANY, 0); return; }