2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2021 Michael Jeanson <michael.jeanson@efficios.com>
8 #ifndef _LTTNG_UST_ARCH_H
9 #define _LTTNG_UST_ARCH_H
12 * Architecture detection using compiler defines.
14 * The following defines are used internally for architecture specific code.
16 * LTTNG_UST_ARCH_X86 : All x86 variants 32 and 64 bits
17 * LTTNG_UST_ARCH_I386 : Specific to the i386
18 * LTTNG_UST_ARCH_AMD64 : All 64 bits x86 variants
19 * LTTNG_UST_ARCH_K1OM : Specific to the Xeon Phi / MIC
21 * LTTNG_UST_ARCH_PPC : All PowerPC variants 32 and 64 bits
22 * LTTNG_UST_ARCH_PPC64 : Specific to 64 bits variants
24 * LTTNG_UST_ARCH_S390 : All IBM s390 / s390x variants
26 * LTTNG_UST_ARCH_SPARC64 : All Sun SPARC variants
28 * LTTNG_UST_ARCH_ALPHA : All DEC Alpha variants
29 * LTTNG_UST_ARCH_IA64 : All Intel Itanium variants
30 * LTTNG_UST_ARCH_ARM : All ARM 32 bits variants
31 * LTTNG_UST_ARCH_ARMV7 : All ARMv7 ISA variants
32 * LTTNG_UST_ARCH_AARCH64 : All ARM 64 bits variants
33 * LTTNG_UST_ARCH_MIPS : All MIPS variants
34 * LTTNG_UST_ARCH_NIOS2 : All Intel / Altera NIOS II variants
35 * LTTNG_UST_ARCH_TILE : All Tilera TILE variants
36 * LTTNG_UST_ARCH_HPPA : All HP PA-RISC variants
37 * LTTNG_UST_ARCH_M68K : All Motorola 68000 variants
38 * LTTNG_UST_ARCH_RISCV : All RISC-V variants
41 #if (defined(__INTEL_OFFLOAD) || defined(__TARGET_ARCH_MIC) || defined(__MIC__))
43 #define LTTNG_UST_ARCH_X86 1
44 #define LTTNG_UST_ARCH_AMD64 1
45 #define LTTNG_UST_ARCH_K1OM 1
47 #elif (defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64))
49 #define LTTNG_UST_ARCH_X86 1
50 #define LTTNG_UST_ARCH_AMD64 1
52 #elif (defined(__i486__) || defined(__i586__) || defined(__i686__))
54 #define LTTNG_UST_ARCH_X86 1
56 #elif (defined(__i386__) || defined(__i386))
58 #define LTTNG_UST_ARCH_X86 1
59 #define LTTNG_UST_ARCH_I386 1
61 #elif (defined(__powerpc64__) || defined(__ppc64__))
63 #define LTTNG_UST_ARCH_PPC 1
64 #define LTTNG_UST_ARCH_PPC64 1
66 #elif (defined(__powerpc__) || defined(__powerpc) || defined(__ppc__))
68 #define LTTNG_UST_ARCH_PPC 1
70 #elif (defined(__s390__) || defined(__s390x__) || defined(__zarch__))
72 #define LTTNG_UST_ARCH_S390 1
74 #elif (defined(__sparc__) || defined(__sparc) || defined(__sparc64__))
76 #define LTTNG_UST_ARCH_SPARC64 1
78 #elif (defined(__alpha__) || defined(__alpha))
80 #define LTTNG_UST_ARCH_ALPHA 1
82 #elif (defined(__ia64__) || defined(__ia64))
84 #define LTTNG_UST_ARCH_IA64 1
86 #elif (defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__))
88 #define LTTNG_UST_ARCH_ARMV7 1
89 #define LTTNG_UST_ARCH_ARM 1
91 #elif (defined(__arm__) || defined(__arm))
93 #define LTTNG_UST_ARCH_ARM 1
95 #elif defined(__aarch64__)
97 #define LTTNG_UST_ARCH_AARCH64 1
99 #elif (defined(__mips__) || defined(__mips))
101 #define LTTNG_UST_ARCH_MIPS 1
103 #elif (defined(__nios2__) || defined(__nios2))
105 #define LTTNG_UST_ARCH_NIOS2 1
107 #elif (defined(__tile__) || defined(__tilegx__))
109 #define LTTNG_UST_ARCH_TILE 1
111 #elif (defined(__hppa__) || defined(__HPPA__) || defined(__hppa))
113 #define LTTNG_UST_ARCH_HPPA 1
115 #elif defined(__m68k__)
117 #define LTTNG_UST_ARCH_M68K 1
119 #elif defined(__riscv)
121 #define LTTNG_UST_ARCH_RISCV 1
125 /* Unrecognised architecture, use safe defaults */
126 #define LTTNG_UST_ARCH_UNKNOWN 1
132 * Per architecture global settings.
134 * LTTNG_UST_ARCH_HAS_EFFICIENT_UNALIGNED_ACCESS:
135 * The architecture has working and efficient unaligned memory access, the
136 * content of the ringbuffers will packed instead of following the natural
137 * alignment of the architecture.
140 #if defined(LTTNG_UST_ARCH_X86)
141 #define LTTNG_UST_ARCH_HAS_EFFICIENT_UNALIGNED_ACCESS 1
144 #if defined(LTTNG_UST_ARCH_PPC)
145 #define LTTNG_UST_ARCH_HAS_EFFICIENT_UNALIGNED_ACCESS 1
148 #endif /* _LTTNG_UST_ARCH_H */
This page took 0.035628 seconds and 4 git commands to generate.