ARC: toolchain: handle difference in macros for MWDT and ARC GNU
Create include/toolchain/mwdt.h to handle difference in several macros for MWDT and ARC GNU toolchains. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
This commit is contained in:
parent
c2bb7db3fd
commit
2167ffbe45
2 changed files with 81 additions and 0 deletions
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
#if defined(__XCC__)
|
#if defined(__XCC__)
|
||||||
#include <toolchain/xcc.h>
|
#include <toolchain/xcc.h>
|
||||||
|
#elif defined(__CCAC__)
|
||||||
|
#include <toolchain/mwdt.h>
|
||||||
#elif defined(__GNUC__) || (defined(_LINKER) && defined(__GCC_LINKER_CMD__))
|
#elif defined(__GNUC__) || (defined(_LINKER) && defined(__GCC_LINKER_CMD__))
|
||||||
#include <toolchain/gcc.h>
|
#include <toolchain/gcc.h>
|
||||||
#else
|
#else
|
||||||
|
|
79
include/toolchain/mwdt.h
Normal file
79
include/toolchain/mwdt.h
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020 Synopsys.
|
||||||
|
* Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_MWDT_H_
|
||||||
|
#define ZEPHYR_INCLUDE_TOOLCHAIN_MWDT_H_
|
||||||
|
|
||||||
|
#ifndef _LINKER
|
||||||
|
#if defined(_ASMLANGUAGE)
|
||||||
|
|
||||||
|
#include <toolchain/common.h>
|
||||||
|
|
||||||
|
#define FUNC_CODE()
|
||||||
|
#define FUNC_INSTR(a)
|
||||||
|
|
||||||
|
.macro section_var_mwdt, section, symbol
|
||||||
|
.section .\§ion\&.\&symbol, "aw"
|
||||||
|
symbol :
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro section_func_mwdt, section, symbol
|
||||||
|
.section .\§ion\&.\&symbol, "ax"
|
||||||
|
FUNC_CODE()
|
||||||
|
PERFOPT_ALIGN
|
||||||
|
symbol :
|
||||||
|
FUNC_INSTR(symbol)
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro section_subsec_func_mwdt, section, subsection, symbol
|
||||||
|
.section .\§ion\&.\&subsection, "ax"
|
||||||
|
PERFOPT_ALIGN
|
||||||
|
symbol :
|
||||||
|
.endm
|
||||||
|
|
||||||
|
#define SECTION_VAR(sect, sym) section_var_mwdt sect, sym
|
||||||
|
#define SECTION_FUNC(sect, sym) section_func_mwdt sect, sym
|
||||||
|
#define SECTION_SUBSEC_FUNC(sect, subsec, sym) \
|
||||||
|
section_subsec_func_mwdt sect, subsec, sym
|
||||||
|
|
||||||
|
.macro glbl_text_mwdt, symbol
|
||||||
|
.globl symbol
|
||||||
|
.type symbol, @function
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro glbl_data_mwdt, symbol
|
||||||
|
.globl symbol
|
||||||
|
.type symbol, @object
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro weak_data_mwdt, symbol
|
||||||
|
.weak symbol
|
||||||
|
.type symbol, @object
|
||||||
|
.endm
|
||||||
|
|
||||||
|
#define GTEXT(sym) glbl_text_mwdt sym
|
||||||
|
#define GDATA(sym) glbl_data_mwdt sym
|
||||||
|
#define WDATA(sym) weak_data_mwdt sym
|
||||||
|
|
||||||
|
#else /* defined(_ASMLANGUAGE) */
|
||||||
|
|
||||||
|
#include <toolchain/gcc.h>
|
||||||
|
|
||||||
|
/* Metaware toolchain has _Static_assert. However it not able to calculate
|
||||||
|
* conditional expression in build time for some realy complex cases. ARC GNU
|
||||||
|
* toolchain works fine in this cases, so it looks like MWDT bug. So, disable
|
||||||
|
* BUILD_ASSERT macro until we fix that issue in MWDT toolchain.
|
||||||
|
*/
|
||||||
|
#undef BUILD_ASSERT
|
||||||
|
#define BUILD_ASSERT(EXPR, MSG...)
|
||||||
|
|
||||||
|
#define __builtin_arc_nop() _nop()
|
||||||
|
|
||||||
|
#endif /* _ASMLANGUAGE */
|
||||||
|
|
||||||
|
#endif /* !_LINKER */
|
||||||
|
#endif /* ZEPHYR_INCLUDE_TOOLCHAIN_MWDT_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue