[libcxx-commits] [PATCH] D94909: [VE] Define FUTEX values
Kazushi Marukawa via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 18 04:48:07 PST 2021
kaz7 created this revision.
kaz7 added reviewers: ldionne, simoll, k-ishizaka.
kaz7 added projects: libc++, VE.
Herald added a subscriber: jfb.
kaz7 requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Define FUTEX values in atomic.cpp since VEOS doesn't have its own
futex.h. Detailes are written in the source code comments.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D94909
Files:
libcxx/src/atomic.cpp
Index: libcxx/src/atomic.cpp
===================================================================
--- libcxx/src/atomic.cpp
+++ libcxx/src/atomic.cpp
@@ -16,7 +16,18 @@
#ifdef __linux__
#include <unistd.h>
+#if defined(__ve__)
+// VE doesn't have linux/futex.h. But, VEOS implements some FUTEX system calls.
+// These system calls are good enough for libcxx. Therefore, we define FUTEX
+// flags here locally to compile libcxx using FUTEX system calls.
+# define FUTEX_WAIT 0
+# define FUTEX_WAKE 1
+# define FUTEX_PRIVATE_FLAG 128
+# define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
+# define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
+#else
#include <linux/futex.h>
+#endif
#include <sys/syscall.h>
#else // <- Add other operating systems here
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94909.317329.patch
Type: text/x-patch
Size: 799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210118/f093c8f8/attachment.bin>
More information about the libcxx-commits
mailing list