blob: d6c9aac69d416d9b4bdc0cea09cc9f74158567bd [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From ff0f4756f1a98202726c65745aca38354864e033 Mon Sep 17 00:00:00 2001
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Dec 2015 14:35:35 -0800
Brad Bishop19323692019-04-05 15:28:33 -04004Subject: [PATCH 04/30] nativesdk-glibc: Allow 64 bit atomics for x86
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05005
6The fix consist of allowing 64bit atomic ops for x86.
7This should be safe for i586 and newer CPUs.
8It also makes the synchronization more efficient.
9
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010Upstream-Status: Inappropriate [OE-Specific]
11
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050012Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
Brad Bishop19323692019-04-05 15:28:33 -040016 sysdeps/x86/atomic-machine.h | 3 +--
17 1 file changed, 1 insertion(+), 2 deletions(-)
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050018
Brad Bishop19323692019-04-05 15:28:33 -040019diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h
20index aa60ca4cd6..3e42e00183 100644
21--- a/sysdeps/x86/atomic-machine.h
22+++ b/sysdeps/x86/atomic-machine.h
23@@ -58,15 +58,14 @@ typedef uintmax_t uatomic_max_t;
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050024 #endif
25
Brad Bishop19323692019-04-05 15:28:33 -040026 #define USE_ATOMIC_COMPILER_BUILTINS 1
27+# define __HAVE_64B_ATOMICS 1
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028
Brad Bishop19323692019-04-05 15:28:33 -040029 #ifdef __x86_64__
30-# define __HAVE_64B_ATOMICS 1
31 # define SP_REG "rsp"
32 # define SEG_REG "fs"
33 # define BR_CONSTRAINT "q"
34 # define IBR_CONSTRAINT "iq"
35 #else
36-# define __HAVE_64B_ATOMICS 0
37 # define SP_REG "esp"
38 # define SEG_REG "gs"
39 # define BR_CONSTRAINT "r"
40--
412.20.1
42