Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 1 | From 64ad80e6d95871f17be4cd01da15581f41ac0b2b Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 27 May 2019 21:10:34 -0700 |
| 4 | Subject: [PATCH] riscv: Disable atomic operations |
| 5 | |
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 7 | --- |
| 8 | js/src/jit/AtomicOperations.h | 2 ++ |
| 9 | 1 file changed, 2 insertions(+) |
| 10 | |
| 11 | --- a/js/src/jit/AtomicOperations.h |
| 12 | +++ b/js/src/jit/AtomicOperations.h |
| 13 | @@ -393,6 +393,8 @@ inline bool AtomicOperations::isLockfree |
| 14 | #include "jit/none/AtomicOperations-feeling-lucky.h" |
| 15 | #elif defined(__s390__) || defined(__s390x__) |
| 16 | #include "jit/none/AtomicOperations-feeling-lucky.h" |
| 17 | +#elif defined(__riscv) |
| 18 | +#include "jit/none/AtomicOperations-feeling-lucky.h" |
| 19 | #else |
| 20 | #error "No AtomicOperations support provided for this platform" |
| 21 | #endif |
| 22 | --- a/js/src/jit/none/AtomicOperations-feeling-lucky.h |
| 23 | +++ b/js/src/jit/none/AtomicOperations-feeling-lucky.h |
| 24 | @@ -80,6 +80,14 @@ |
| 25 | #define GNUC_COMPATIBLE |
| 26 | #endif |
| 27 | |
| 28 | +#ifdef __riscv |
| 29 | +#define GNUC_COMPATIBLE |
| 30 | +#ifdef __riscv_xlen == 64 |
| 31 | +#define HAS_64BIT_ATOMICS |
| 32 | +#define HAS_64BIT_LOCKFREE |
| 33 | +#endif |
| 34 | +#endif |
| 35 | + |
| 36 | // The default implementation tactic for gcc/clang is to use the newer |
| 37 | // __atomic intrinsics added for use in C++11 <atomic>. Where that |
| 38 | // isn't available, we use GCC's older __sync functions instead. |