1 /* SPDX-License-Identifier: MIT */
2 /* SPDX-FileCopyrightText: 2016-2022 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> */
8 #include <rseq/thread-pointer.h>
11 * Architecture detection using compiler defines.
13 * The following defines are used internally for architecture specific code.
15 * URCU_ARCH_X86 : All x86 variants 32 and 64 bits
16 * URCU_ARCH_I386 : Specific to the i386
17 * URCU_ARCH_AMD64 : All 64 bits x86 variants
19 * URCU_ARCH_PPC : All PowerPC variants 32 and 64 bits
20 * URCU_ARCH_PPC64 : Specific to 64 bits variants
22 * URCU_ARCH_S390 : All IBM s390 / s390x variants
23 * URCU_ARCH_S390X : Specific to z/Architecture 64 bits
25 * URCU_ARCH_ARM : All ARM 32 bits variants
26 * URCU_ARCH_AARCH64 : All ARM 64 bits variants
27 * URCU_ARCH_MIPS : All MIPS variants
28 * URCU_ARCH_RISCV : All RISC-V variants
34 #if (defined(__amd64__) \
36 || defined(__x86_64__) \
39 #define RSEQ_ARCH_X86 1
40 #define RSEQ_ARCH_AMD64 1
41 #include <rseq/arch/x86.h>
43 #elif (defined(__i386__) || defined(__i386))
45 #define RSEQ_ARCH_X86 1
46 #include <rseq/arch/x86.h>
48 #elif (defined(__arm__) || defined(__arm))
50 #define RSEQ_ARCH_ARM 1
51 #include <rseq/arch/arm.h>
53 #elif defined(__aarch64__)
55 #define RSEQ_ARCH_AARCH64 1
56 #include <rseq/arch/aarch64.h>
58 #elif (defined(__powerpc64__) || defined(__ppc64__))
60 #define RSEQ_ARCH_PPC 1
61 #define RSEQ_ARCH_PPC64 1
62 #include <rseq/arch/ppc.h>
64 #elif (defined(__powerpc__) \
65 || defined(__powerpc) \
68 #define RSEQ_ARCH_PPC 1
69 #include <rseq/arch/ppc.h>
71 #elif (defined(__mips__) || defined(__mips))
73 #define RSEQ_ARCH_MIPS 1
74 #include <rseq/arch/mips.h>
76 #elif defined(__s390__)
78 # if (defined(__s390x__) || defined(__zarch__))
79 # define RSEQ_ARCH_S390X 1
82 #define RSEQ_ARCH_S390 1
83 #include <rseq/arch/s390.h>
85 #elif defined(__riscv)
87 #define RSEQ_ARCH_RISCV 1
88 #include <rseq/arch/riscv.h>
91 #error "Cannot build: unrecognized architecture, see <rseq/arch.h>."
94 #endif /* _RSEQ_ARCH_H */
This page took 0.031994 seconds and 4 git commands to generate.