Zephyr API Documentation
4.1.99
A Scalable Open Source RTOS
4.1.99
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
▼
Zephyr API Documentation
►
Introduction
Deprecated List
►
Topics
►
Data Structures
▼
Files
▼
File List
►
doc
►
kernel
►
lib
►
subsys
▼
zephyr
►
acpi
►
app_memory
►
arch
►
audio
►
bluetooth
►
canbus
►
console
►
crypto
►
data
►
debug
►
devicetree
►
dfu
►
display
►
drivers
►
dsp
►
dt-bindings
►
fs
►
input
►
internal
►
ipc
►
kernel
►
linker
►
llext
►
logging
►
lorawan
►
math
►
mem_mgmt
►
mgmt
►
misc
►
modbus
►
modem
►
multi_heap
►
net
►
platform
►
pm
►
pmci
►
portability
►
posix
►
psa
►
random
►
retention
►
rtio
►
sd
►
sensing
►
settings
►
shell
►
sip_svc
►
stats
►
storage
►
sys
►
task_wdt
►
timing
▼
toolchain
►
iar
armclang.h
►
common.h
►
gcc.h
►
iar.h
►
llvm.h
mwdt.h
►
xcc.h
xcc_missing_defs.h
zephyr_stdint.h
►
tracing
►
usb
►
usb_c
►
xen
►
zbus
►
zvfs
►
bindesc.h
►
cache.h
►
device.h
►
devicetree.h
►
fatal.h
►
fatal_types.h
►
init.h
►
irq.h
►
irq_multilevel.h
►
irq_nextlevel.h
►
irq_offload.h
►
kernel.h
kernel_includes.h
►
kernel_structs.h
►
kernel_version.h
►
net_buf.h
►
shared_irq.h
►
smf.h
►
spinlock.h
►
sw_isr_table.h
►
sys_clock.h
►
syscall.h
►
toolchain.h
types.h
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
xcc.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_XCC_H_
8
#define ZEPHYR_INCLUDE_TOOLCHAIN_XCC_H_
9
10
#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_H_
11
#error Please do not include toolchain-specific headers directly, use <zephyr/toolchain.h> instead
12
#endif
13
14
/*
15
* XCC does not support using deprecated attribute in enum,
16
* so just nullify it here to avoid compilation errors.
17
*/
18
#define __deprecated
19
20
#define __in_section_unique(seg) \
21
__attribute__((section("." STRINGIFY(seg) "." STRINGIFY(__COUNTER__))))
22
23
#define __in_section_unique_named(seg, name) \
24
__attribute__((section("." STRINGIFY(seg) \
25
"." STRINGIFY(__COUNTER__) \
26
"." STRINGIFY(name))))
27
28
/* toolchain/gcc.h errors out if __BYTE_ORDER__ cannot be determined
29
* there. However, __BYTE_ORDER__ is actually being defined later in
30
* this file. So define __BYTE_ORDER__ to skip the check in gcc.h
31
* and undefine after including gcc.h.
32
*
33
* Clang has it defined so there is no need to work around.
34
*/
35
#ifndef __clang__
36
#define __BYTE_ORDER__
37
#endif
38
39
#ifdef __clang__
40
#include <
zephyr/toolchain/llvm.h
>
41
#else
42
#include <
zephyr/toolchain/gcc.h
>
43
#endif
44
45
#ifdef __clang__
46
/* For some reasons, xt-clang does not like "%hhd" or "%hd" (for example)
47
* being fed int data (same goes for unsigned ones) and will always complain
48
* about mismatched types. GCC and newer LLVM/Clang do not complain.
49
* This could be due to xt-clang being based on older LLVM/Clang.
50
* So skip the check.
51
*/
52
#ifdef __printf_like
53
#undef __printf_like
54
#define __printf_like(f, a)
55
#endif
56
#endif
57
58
#ifndef __clang__
59
#undef __BYTE_ORDER__
60
#endif
61
62
#include <
stdbool.h
>
63
64
#ifndef __INT8_C
65
#define __INT8_C(x) x
66
#endif
67
68
#ifndef INT8_C
69
#define INT8_C(x) __INT8_C(x)
70
#endif
71
72
#ifndef __UINT8_C
73
#define __UINT8_C(x) x ## U
74
#endif
75
76
#ifndef UINT8_C
77
#define UINT8_C(x) __UINT8_C(x)
78
#endif
79
80
#ifndef __INT16_C
81
#define __INT16_C(x) x
82
#endif
83
84
#ifndef INT16_C
85
#define INT16_C(x) __INT16_C(x)
86
#endif
87
88
#ifndef __UINT16_C
89
#define __UINT16_C(x) x ## U
90
#endif
91
92
#ifndef UINT16_C
93
#define UINT16_C(x) __UINT16_C(x)
94
#endif
95
96
#ifndef __INT32_C
97
#define __INT32_C(x) x
98
#endif
99
100
#ifndef INT32_C
101
#define INT32_C(x) __INT32_C(x)
102
#endif
103
104
#ifndef __UINT32_C
105
#define __UINT32_C(x) x ## U
106
#endif
107
108
#ifndef UINT32_C
109
#define UINT32_C(x) __UINT32_C(x)
110
#endif
111
112
#ifndef __INT64_C
113
#define __INT64_C(x) x
114
#endif
115
116
#ifndef INT64_C
117
#define INT64_C(x) __INT64_C(x)
118
#endif
119
120
#ifndef __UINT64_C
121
#define __UINT64_C(x) x ## ULL
122
#endif
123
124
#ifndef UINT64_C
125
#define UINT64_C(x) __UINT64_C(x)
126
#endif
127
128
#ifndef __INTMAX_C
129
#define __INTMAX_C(x) x
130
#endif
131
132
#ifndef INTMAX_C
133
#define INTMAX_C(x) __INTMAX_C(x)
134
#endif
135
136
#ifndef __UINTMAX_C
137
#define __UINTMAX_C(x) x ## ULL
138
#endif
139
140
#ifndef UINTMAX_C
141
#define UINTMAX_C(x) __UINTMAX_C(x)
142
#endif
143
144
#ifndef __COUNTER__
145
/* XCC (GCC-based compiler) doesn't support __COUNTER__
146
* but this should be good enough
147
*/
148
#define __COUNTER__ __LINE__
149
#endif
150
151
#ifndef __GCC_LINKER_CMD__
152
#include <xtensa/config/core.h>
153
154
/*
155
* XCC does not define the following macros with the expected names, but the
156
* HAL defines similar ones. Thus we include it and define the missing macros
157
* ourselves.
158
*/
159
#if XCHAL_MEMORY_ORDER == XTHAL_BIGENDIAN
160
#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
161
#elif XCHAL_MEMORY_ORDER == XTHAL_LITTLEENDIAN
162
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
163
#else
164
#error "Cannot determine __BYTE_ORDER__"
165
#endif
166
167
#endif
/* __GCC_LINKER_CMD__ */
168
169
#define __builtin_unreachable() __builtin_trap()
170
171
/* Not a full barrier, just a SW barrier */
172
#define __sync_synchronize() do { __asm__ __volatile__ ("" ::: "memory"); } \
173
while (false)
174
175
#endif
gcc.h
GCC toolchain abstraction.
llvm.h
stdbool.h
zephyr
toolchain
xcc.h
Generated on Sat May 17 2025 00:06:38 for Zephyr API Documentation by
1.12.0