7#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_XCC_H_
8#define ZEPHYR_INCLUDE_TOOLCHAIN_XCC_H_
22#if __clang_major__ >= 10
23#define __fallthrough __attribute__((fallthrough))
26#define TOOLCHAIN_CLANG_VERSION \
27 ((__clang_major__ * 10000) + (__clang_minor__ * 100) + \
30#if TOOLCHAIN_CLANG_VERSION >= 30800
31#define TOOLCHAIN_HAS_C_GENERIC 1
32#define TOOLCHAIN_HAS_C_AUTO_TYPE 1
49#define INT8_C(x) __INT8_C(x)
53#define __UINT8_C(x) x ## U
57#define UINT8_C(x) __UINT8_C(x)
65#define INT16_C(x) __INT16_C(x)
69#define __UINT16_C(x) x ## U
73#define UINT16_C(x) __UINT16_C(x)
81#define INT32_C(x) __INT32_C(x)
85#define __UINT32_C(x) x ## U
89#define UINT32_C(x) __UINT32_C(x)
97#define INT64_C(x) __INT64_C(x)
101#define __UINT64_C(x) x ## ULL
105#define UINT64_C(x) __UINT64_C(x)
109#define __INTMAX_C(x) x
113#define INTMAX_C(x) __INTMAX_C(x)
117#define __UINTMAX_C(x) x ## ULL
121#define UINTMAX_C(x) __UINTMAX_C(x)
128#define __COUNTER__ __LINE__
131#undef __in_section_unique
132#define __in_section_unique(seg) \
133 __attribute__((section("." STRINGIFY(seg) "." STRINGIFY(__COUNTER__))))
135#undef __in_section_unique_named
136#define __in_section_unique_named(seg, name) \
137 __attribute__((section("." STRINGIFY(seg) \
138 "." STRINGIFY(__COUNTER__) \
139 "." STRINGIFY(name))))
141#ifndef __GCC_LINKER_CMD__
142#include <xtensa/config/core.h>
149#if XCHAL_MEMORY_ORDER == XTHAL_BIGENDIAN
150#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
151#elif XCHAL_MEMORY_ORDER == XTHAL_LITTLEENDIAN
152#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
154#error "Cannot determine __BYTE_ORDER__"
159#define __builtin_unreachable() __builtin_trap()
162#define __sync_synchronize() do { __asm__ __volatile__ ("" ::: "memory"); } \
GCC toolchain abstraction.