|
Zephyr API 3.6.99
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
7#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_COMMON_H_
8#define ZEPHYR_INCLUDE_TOOLCHAIN_COMMON_H_
10#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_H_
11#error Please do not include toolchain-specific headers directly, use <zephyr/toolchain.h> instead
23#define EXTERN_C extern "C"
25#define EXTERN_C extern
31#define TASK_ENTRY_CPP extern "C"
36#define ZRESTRICT restrict
54 #define REQUIRES(sym) .set sym ## _Requires, sym
56 #define REQUIRES(sym) __asm__ (".set " # sym "_Requires, " # sym "\n\t");
60 #define SECTION .section
70 #if defined(CONFIG_X86)
73 #define PERFOPT_ALIGN .balign 16
75 #define PERFOPT_ALIGN .balign 1
78 #elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
80 #define PERFOPT_ALIGN .balign 4
82 #elif defined(CONFIG_ARC)
87 #define PERFOPT_ALIGN .align 4
89 #elif defined(CONFIG_NIOS2) || defined(CONFIG_RISCV) || \
90 defined(CONFIG_XTENSA) || defined(CONFIG_MIPS)
91 #define PERFOPT_ALIGN .balign 4
93 #elif defined(CONFIG_ARCH_POSIX)
95 #elif defined(CONFIG_SPARC)
97 #define PERFOPT_ALIGN .align 4
101 #error Architecture unsupported
105 #define GC_SECTION(sym) SECTION .text.##sym, "ax"
111#if !defined(_ASMLANGUAGE)
112 #ifdef CONFIG_COVERAGE
127 #define ALWAYS_INLINE inline
129 #define ALWAYS_INLINE inline __attribute__((always_inline))
133#define Z_STRINGIFY(x) #x
134#define STRINGIFY(s) Z_STRINGIFY(s)
137#define _DO_CONCAT(x, y) x ## y
138#define _CONCAT(x, y) _DO_CONCAT(x, y)
149#ifndef ZTEST_UNITTEST
150#define __syscall static inline
151#define __syscall_always_inline static inline __attribute__((always_inline))
154#define __syscall_always_inline
172#define BUILD_ASSERT(EXPR, MSG...) \
173 enum _CONCAT(__build_assert_enum, __COUNTER__) { \
174 _CONCAT(__build_assert, __COUNTER__) = 1 / !!(EXPR) \
195#define Z_DECL_ALIGN(type) __aligned(__alignof(type)) type
198#define IS_PTR_ALIGNED_BYTES(ptr, bytes) ((((uintptr_t)ptr) % bytes) == 0)
201#define IS_PTR_ALIGNED(ptr, type) IS_PTR_ALIGNED_BYTES(ptr, __alignof(type))
210#define LINKER_KEEP(symbol) \
211 static const void * const symbol##_ptr __used \
212 __attribute__((__section__(".symbol_to_keep"))) = (void *)&symbol