aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcherednik <dcherednik@ydb.tech>2022-11-24 15:29:40 +0300
committerdcherednik <dcherednik@ydb.tech>2022-11-24 15:29:40 +0300
commit5fbd67db573577fafc46098602461037b0828c71 (patch)
tree8c8005aa1ccb7c61d8f67deb4fd84ae564ed2ddd
parent1458e9d8a23fc7bd6f98d67e60c7a7cbf52d19c2 (diff)
downloadydb-5fbd67db573577fafc46098602461037b0828c71.tar.gz
add missed arch-arm.h file for pg_wrapper.
-rw-r--r--ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics.h2
-rw-r--r--ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics/arch-arm.h32
2 files changed, 33 insertions, 1 deletions
diff --git a/ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics.h b/ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics.h
index 41f0fbef8c5..b820d4e966e 100644
--- a/ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics.h
+++ b/ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics.h
@@ -65,7 +65,7 @@
*/
#if defined(__arm__) || defined(__arm) || \
defined(__aarch64__) || defined(__aarch64)
-#error #include "port/atomics/arch-arm.h"
+#include "port/atomics/arch-arm.h"
#elif defined(__i386__) || defined(__i386) || defined(__x86_64__)
#include "port/atomics/arch-x86.h"
#elif defined(__ia64__) || defined(__ia64)
diff --git a/ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics/arch-arm.h b/ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics/arch-arm.h
new file mode 100644
index 00000000000..7449f8404a0
--- /dev/null
+++ b/ydb/library/yql/parser/pg_wrapper/postgresql/src/include/port/atomics/arch-arm.h
@@ -0,0 +1,32 @@
+/*-------------------------------------------------------------------------
+ *
+ * arch-arm.h
+ * Atomic operations considerations specific to ARM
+ *
+ * Portions Copyright (c) 2013-2022, PostgreSQL Global Development Group
+ *
+ * NOTES:
+ *
+ * src/include/port/atomics/arch-arm.h
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* intentionally no include guards, should only be included by atomics.h */
+#ifndef INSIDE_ATOMICS_H
+#error "should be included via atomics.h"
+#endif
+
+/*
+ * 64 bit atomics on ARM32 are implemented using kernel fallbacks and thus
+ * might be slow, so disable entirely. On ARM64 that problem doesn't exist.
+ */
+#if !defined(__aarch64__)
+#define PG_DISABLE_64_BIT_ATOMICS
+#else
+/*
+ * Architecture Reference Manual for ARMv8 states aligned read/write to/from
+ * general purpose register is atomic.
+ */
+#define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
+#endif /* __aarch64__ */