Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 1 | From 19e3e45eb1838ee80af13c3d27fcff446773211e Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 31 Dec 2015 14:35:35 -0800 |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 4 | Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | |
| 6 | The fix consist of allowing 64bit atomic ops for x86. |
| 7 | This should be safe for i586 and newer CPUs. |
| 8 | It also makes the synchronization more efficient. |
| 9 | |
| 10 | Upstream-Status: Inappropriate [OE-Specific] |
| 11 | |
| 12 | Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> |
| 13 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 15 | --- |
| 16 | sysdeps/x86/atomic-machine.h | 3 +-- |
| 17 | 1 file changed, 1 insertion(+), 2 deletions(-) |
| 18 | |
| 19 | diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 20 | index 695222e4fa..9d39bfdbd5 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | --- a/sysdeps/x86/atomic-machine.h |
| 22 | +++ b/sysdeps/x86/atomic-machine.h |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 23 | @@ -52,15 +52,14 @@ typedef uintmax_t uatomic_max_t; |
| 24 | #define LOCK_PREFIX "lock;" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 25 | |
| 26 | #define USE_ATOMIC_COMPILER_BUILTINS 1 |
| 27 | +# define __HAVE_64B_ATOMICS 1 |
| 28 | |
| 29 | #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" |