-
Notifications
You must be signed in to change notification settings - Fork 5
/
postgres-e2k.patch
34 lines (29 loc) · 982 Bytes
/
postgres-e2k.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 9714ab1479bf76c06118f8e7369cb1113df337c3 Mon Sep 17 00:00:00 2001
From: Ilya Kurdyukov <[email protected]>
Date: Thu, 18 Feb 2021 19:06:01 +0700
Subject: [PATCH] Elbrus (e2k) spinlock code
---
src/include/storage/s_lock.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 254c40d..4d4dbea 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -440,6 +440,17 @@ do \
#endif /* __sparc__ */
+/* Elbrus */
+#ifdef __e2k__
+#define HAS_TEST_AND_SET
+typedef int slock_t;
+/* There is no need to check for sync_lock availability. */
+#define TAS(lock) __sync_lock_test_and_set(lock, 1)
+#define S_UNLOCK(lock) __sync_lock_release(lock)
+#define SPIN_DELAY() do { __asm__ __volatile__ ("nop" : : ); } while(0)
+#endif
+
+
/* PowerPC */
#if defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__) || defined(__powerpc64__)
#define HAS_TEST_AND_SET
--
2.17.1