From 06552fa3a2b12f02fa86354e8f6674efc71eb905 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Wed, 1 Feb 2017 17:27:00 +0300 Subject: [PATCH] locks: Mask futexes aligned System call sys_futex() requires that (from futex(2)): "On all platforms, futexes are four-byte integers that must be aligned on a four-byte boundary". travis-ci: success for locks: Mask futexes aligned Signed-off-by: Kirill Tkhai Signed-off-by: Pavel Emelyanov --- include/common/lock.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/common/lock.h b/include/common/lock.h index e1a0a81cd..cb48ea602 100644 --- a/include/common/lock.h +++ b/include/common/lock.h @@ -7,6 +7,7 @@ #include #include #include "common/asm/atomic.h" +#include "common/compiler.h" #define LOCK_BUG_ON(condition) \ if ((condition)) \ @@ -29,7 +30,7 @@ static inline long sys_futex (uint32_t *addr1, int op, uint32_t val1, typedef struct { atomic_t raw; -} futex_t; +} __aligned(sizeof(int)) futex_t; #define FUTEX_ABORT_FLAG (0x80000000) #define FUTEX_ABORT_RAW (-1U)