diff --git a/include/arch/xtensa/arch.h b/include/arch/xtensa/arch.h index db0e9d0f00b..42fac77d635 100644 --- a/include/arch/xtensa/arch.h +++ b/include/arch/xtensa/arch.h @@ -26,21 +26,6 @@ extern "C" { #include #include -/* - * XCC does not define the following macros with the expected names, but the - * file machine/endian.h from XT_LIB defines similar ones. Thus we include it - * and define the missing macros ourselves. - */ -#ifndef __BYTE_ORDER__ -#define __BYTE_ORDER__ XCHAL_MEMORY_ORDER -#endif -#ifndef __ORDER_BIG_ENDIAN__ -#define __ORDER_BIG_ENDIAN__ XTHAL_BIGENDIAN -#endif -#ifndef __ORDER_LITTLE_ENDIAN__ -#define __ORDER_LITTLE_ENDIAN__ XTHAL_LITTLEENDIAN -#endif - #define STACK_ALIGN 16 #define OCTET_TO_SIZEOFUNIT(X) (X) #define SIZEOFUNIT_TO_OCTET(X) (X) diff --git a/include/toolchain.h b/include/toolchain.h index 11c90024b2a..3bea0dbc29e 100644 --- a/include/toolchain.h +++ b/include/toolchain.h @@ -15,7 +15,9 @@ #ifndef _TOOLCHAIN_H #define _TOOLCHAIN_H -#if defined(__GNUC__) || (defined(_LINKER) && defined(__GCC_LINKER_CMD__)) +#if defined(__XCC__) +#include +#elif defined(__GNUC__) || (defined(_LINKER) && defined(__GCC_LINKER_CMD__)) #include #else #include diff --git a/include/toolchain/xcc.h b/include/toolchain/xcc.h new file mode 100644 index 00000000000..7dfbb0ec083 --- /dev/null +++ b/include/toolchain/xcc.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2017 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _XCC_TOOLCHAIN_H_ +#define _XCC_TOOLCHAIN_H_ + +#include + +#ifndef __GCC_LINKER_CMD__ +#include + +/* + * XCC does not define the following macros with the expected names, but the + * HAL defines similar ones. Thus we include it and define the missing macros + * ourselves. + */ +#ifndef __BYTE_ORDER__ +#define __BYTE_ORDER__ XCHAL_MEMORY_ORDER +#endif +#ifndef __ORDER_BIG_ENDIAN__ +#define __ORDER_BIG_ENDIAN__ XTHAL_BIGENDIAN +#endif +#ifndef __ORDER_LITTLE_ENDIAN__ +#define __ORDER_LITTLE_ENDIAN__ XTHAL_LITTLEENDIAN +#endif + +#endif /* __GCC_LINKER_CMD__ */ + +#endif