Public headers: use SPDX identifiers
[urcu.git] / include / urcu / arch.h
index 620743c0f68fb33dd004d3266bcf900e2a96b898..45ba6a222fe507b5910a307e667d72d27545672e 100644 (file)
@@ -1,22 +1,6 @@
-/*
- * urcu/arch.h
- *
- * Copyright (c) 2020 Michael Jeanson <michael.jeanson@efficios.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
+// SPDX-FileCopyrightText: 2020 Michael Jeanson <mjeanson@efficios.com>
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
 
 #ifndef _URCU_ARCH_H
 #define _URCU_ARCH_H
 #define URCU_ARCH_AMD64 1
 #include <urcu/arch/x86.h>
 
-#elif (defined(__i486__) || defined(__i586__) || defined(__i686__))
-
-#define URCU_ARCH_X86 1
-#include <urcu/arch/x86.h>
-
 #elif (defined(__i386__) || defined(__i386))
 
 #define URCU_ARCH_X86 1
+
+/*
+ * URCU_ARCH_X86_NO_CAS enables a compat layer that will detect the presence of
+ * the cmpxchg instructions at runtime and provide a compat mode based on a
+ * pthread mutex when it isn't.
+ *
+ * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 was introduced in GCC 4.3 and Clang 3.3,
+ * building with older compilers will result in the compat layer always being
+ * used on x86-32.
+ */
+#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#define URCU_ARCH_X86_NO_CAS 1
+/* For backwards compat */
 #define URCU_ARCH_I386 1
+#endif
+
 #include <urcu/arch/x86.h>
 
 #elif (defined(__powerpc64__) || defined(__ppc64__))
This page took 0.022732 seconds and 4 git commands to generate.