1b58112e5SPatrick WilliamsFrom ba079b8d6a50796db41bb0ddf4c22bfe022ef898 Mon Sep 17 00:00:00 2001
219323693SBrad BishopFrom: "Richard W.M. Jones" <rjones@redhat.com>
319323693SBrad BishopDate: Sun, 20 Nov 2016 15:04:52 +0000
4b58112e5SPatrick WilliamsSubject: [PATCH 1/5] Add support for RISC-V.
519323693SBrad Bishop
619323693SBrad BishopThe architecture is sufficiently similar to aarch64 that simply
719323693SBrad Bishopextending the existing aarch64 macro works.
8*03514f19SPatrick Williams
9*03514f19SPatrick WilliamsUpstream-Status: Pending
1019323693SBrad Bishop---
11b58112e5SPatrick Williams src/include/storage/s_lock.h | 5 +++--
12b58112e5SPatrick Williams 1 file changed, 3 insertions(+), 2 deletions(-)
1319323693SBrad Bishop
14595f6308SAndrew Geisslerdiff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
15b58112e5SPatrick Williamsindex c9fa84c..9b491e8 100644
1619323693SBrad Bishop--- a/src/include/storage/s_lock.h
1719323693SBrad Bishop+++ b/src/include/storage/s_lock.h
18b58112e5SPatrick Williams@@ -252,11 +252,12 @@ spin_delay(void)
1919323693SBrad Bishop
2019323693SBrad Bishop /*
2119323693SBrad Bishop  * On ARM and ARM64, we use __sync_lock_test_and_set(int *, int) if available.
2219323693SBrad Bishop+ * On RISC-V, the same.
2319323693SBrad Bishop  *
2419323693SBrad Bishop  * We use the int-width variant of the builtin because it works on more chips
2519323693SBrad Bishop  * than other widths.
2619323693SBrad Bishop  */
27b58112e5SPatrick Williams-#if defined(__arm__) || defined(__arm) || defined(__aarch64__)
28b58112e5SPatrick Williams+#if defined(__arm__) || defined(__arm) || defined(__aarch64__) || defined(__riscv)
2919323693SBrad Bishop #ifdef HAVE_GCC__SYNC_INT32_TAS
3019323693SBrad Bishop #define HAS_TEST_AND_SET
3119323693SBrad Bishop
32b58112e5SPatrick Williams@@ -290,7 +291,7 @@ spin_delay(void)
3319323693SBrad Bishop
34b58112e5SPatrick Williams #endif	 /* __aarch64__ */
3519323693SBrad Bishop #endif	 /* HAVE_GCC__SYNC_INT32_TAS */
36b58112e5SPatrick Williams-#endif	 /* __arm__ || __arm || __aarch64__ */
37b58112e5SPatrick Williams+#endif	 /* __arm__ || __arm || __aarch64__ || __riscv */
38b58112e5SPatrick Williams
3919323693SBrad Bishop
406aa7eec5SAndrew Geissler /* S/390 and S/390x Linux (32- and 64-bit zSeries) */
41595f6308SAndrew Geissler--
42b58112e5SPatrick Williams2.25.1
43595f6308SAndrew Geissler
44