Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mwdt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Synopsys.
3 * Author: Eugeniy Paltsev <[email protected]>
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_MWDT_H_
9#define ZEPHYR_INCLUDE_TOOLCHAIN_MWDT_H_
10
11#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_H_
12#error Please do not include toolchain-specific headers directly, use <zephyr/toolchain.h> instead
13#endif
14
15#ifndef _LINKER
16#if defined(_ASMLANGUAGE)
17
19
20#define FUNC_CODE()
21#define FUNC_INSTR(a)
22
23.macro section_var_mwdt, section, symbol
24 .section .\&section\&.\&symbol, "aw"
25 symbol :
26.endm
27
28.macro section_func_mwdt, section, symbol
29 .section .\&section\&.\&symbol, "ax"
30 FUNC_CODE()
31 PERFOPT_ALIGN
32 symbol :
33 FUNC_INSTR(symbol)
34.endm
35
36.macro section_subsec_func_mwdt, section, subsection, symbol
37 .section .\&section\&.\&subsection, "ax"
38 PERFOPT_ALIGN
39 symbol :
40.endm
41
42#define SECTION_VAR(sect, sym) section_var_mwdt sect, sym
43#define SECTION_FUNC(sect, sym) section_func_mwdt sect, sym
44#define SECTION_SUBSEC_FUNC(sect, subsec, sym) \
45 section_subsec_func_mwdt sect, subsec, sym
46
47.macro glbl_text_mwdt, symbol
48 .globl symbol
49 .type symbol, @function
50.endm
51
52.macro glbl_data_mwdt, symbol
53 .globl symbol
54 .type symbol, @object
55.endm
56
57.macro weak_data_mwdt, symbol
58 .weak symbol
59 .type symbol, @object
60.endm
61
62#define GTEXT(sym) glbl_text_mwdt sym
63#define GDATA(sym) glbl_data_mwdt sym
64#define WDATA(sym) weak_data_mwdt sym
65
66#else /* defined(_ASMLANGUAGE) */
67
68/* MWDT toolchain misses ssize_t definition which is used by Zephyr */
69#ifndef _SSIZE_T_DEFINED
70#define _SSIZE_T_DEFINED
71#ifdef CONFIG_64BIT
72 typedef long ssize_t;
73#else
74 typedef int ssize_t;
75#endif
76#endif /* _SSIZE_T_DEFINED */
77
78#ifdef CONFIG_NEWLIB_LIBC
79 #error "ARC MWDT doesn't support building with CONFIG_NEWLIB_LIBC as it doesn't have newlib"
80#endif /* CONFIG_NEWLIB_LIBC */
81
82#ifdef CONFIG_NATIVE_APPLICATION
83 #error "ARC MWDT doesn't support building Zephyr as an native application"
84#endif /* CONFIG_NATIVE_APPLICATION */
85
86
87#define __no_optimization __attribute__((optnone))
88#define __fallthrough __attribute__((fallthrough))
89
90#define TOOLCHAIN_HAS_C_GENERIC 1
91#define TOOLCHAIN_HAS_C_AUTO_TYPE 1
92
94
95#undef BUILD_ASSERT
96#if defined(__cplusplus) && (__cplusplus >= 201103L)
97#define BUILD_ASSERT(EXPR, MSG...) static_assert(EXPR, "" MSG)
98#elif defined(__cplusplus)
99/* For cpp98 */
100#define BUILD_ASSERT(EXPR, MSG...)
101#else
102#define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
103#endif
104
105#define __builtin_arc_nop() _nop()
106
107#endif /* _ASMLANGUAGE */
108
109#endif /* !_LINKER */
110#endif /* ZEPHYR_INCLUDE_TOOLCHAIN_MWDT_H_ */
Common toolchain abstraction.
GCC toolchain abstraction.
__SIZE_TYPE__ ssize_t
Definition: types.h:28