Commit | Line | Data |
---|---|---|
d3d3857f MJ |
1 | // SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation. |
2 | // SPDX-FileCopyrightText: 2009-2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
3 | // | |
4 | // SPDX-License-Identifier: LGPL-2.1-or-later | |
5 | ||
3aea2ae0 MD |
6 | #ifndef _URCU_ARCH_AARCH64_H |
7 | #define _URCU_ARCH_AARCH64_H | |
8 | ||
9 | /* | |
10 | * arch/aarch64.h: definitions for aarch64 architecture | |
3aea2ae0 MD |
11 | */ |
12 | ||
13 | #include <urcu/compiler.h> | |
14 | #include <urcu/config.h> | |
15 | #include <urcu/syscall-compat.h> | |
16 | ||
17 | #ifdef __cplusplus | |
18 | extern "C" { | |
19 | #endif | |
20 | ||
21 | #include <stdlib.h> | |
22 | #include <sys/time.h> | |
23 | ||
3aea2ae0 | 24 | /* |
84f4ccb4 MD |
25 | * On Linux, define the membarrier system call number if not yet available in |
26 | * the system headers. aarch64 implements asm-generic/unistd.h system call | |
3aea2ae0 MD |
27 | * numbers. |
28 | */ | |
84f4ccb4 | 29 | #if (defined(__linux__) && !defined(__NR_membarrier)) |
3aea2ae0 MD |
30 | #define __NR_membarrier 283 |
31 | #endif | |
32 | ||
ddec79fd MD |
33 | /* |
34 | * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 | |
ae0b76db MJ |
35 | * |
36 | * Backported in RHEL7 gcc 4.8.5-11 | |
ddec79fd | 37 | */ |
ae0b76db MJ |
38 | #if defined(URCU_GCC_VERSION) && defined(__GNUC_RH_RELEASE__) |
39 | # if (URCU_GCC_VERSION == 40805) && (__GNUC_RH_RELEASE__ >= 11) | |
40 | # define URCU_GCC_PATCHED_63293 | |
41 | # endif | |
42 | #endif | |
43 | ||
ddec79fd | 44 | #ifdef URCU_GCC_VERSION |
ae0b76db | 45 | # if URCU_GCC_VERSION < 50100 && !defined(URCU_GCC_PATCHED_63293) |
ddec79fd MD |
46 | # error Your gcc version performs unsafe access to deallocated stack |
47 | # endif | |
48 | #endif | |
49 | ||
e8363ee3 MD |
50 | #define caa_cpu_relax() __asm__ __volatile__ ("yield" : : : "memory") |
51 | ||
3aea2ae0 MD |
52 | #ifdef __cplusplus |
53 | } | |
54 | #endif | |
55 | ||
56 | #include <urcu/arch/generic.h> | |
57 | ||
58 | #endif /* _URCU_ARCH_AARCH64_H */ |