iLLD_TC27xD  1.0
CompilerDcc.h
Go to the documentation of this file.
1 /**
2  * \file CompilerDcc.h
3  *
4  * \version iLLD_1_0_0_11_0
5  * \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
6  *
7  *
8  * IMPORTANT NOTICE
9  *
10  *
11  * Infineon Technologies AG (Infineon) is supplying this file for use
12  * exclusively with Infineon's microcontroller products. This file can be freely
13  * distributed within development tools that are supporting such microcontroller
14  * products.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
17  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
19  * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
20  * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
21  *
22  */
23 
24 #ifndef COMPILERDCC_H
25 #define COMPILERDCC_H 1
26 
27 /******************************************************************************/
28 
29 #include <stddef.h>
30 
31 /*Linker definitions which are specific to Dcc */
32 /* IFX_CFG_USE_COMPILER_DEFAULT_LINKER shall be defined in Ifx_Cfg.h
33  * to use the default compiler linker varaibles and startup */
34 #ifndef IFX_CFG_USE_COMPILER_DEFAULT_LINKER
35 
36 /*Start: Core 0 definitions ********************************************** */
37 
38 /*C extern defintions */
39 #define IFXCOMPILER_CORE_LINKER_SYMBOLS(cpu) \
40  extern unsigned int __USTACK##cpu[]; /**< user stack end */ \
41  extern unsigned int __ISTACK##cpu[]; /**< interrupt stack end */ \
42  extern unsigned int __INTTAB_CPU##cpu[]; /**< interrupt vector table */ \
43  extern unsigned int __TRAPTAB_CPU##cpu[]; /**< trap vector table */ \
44  extern unsigned int __CSA##cpu[]; /**< context save area begin */ \
45  extern unsigned int __CSA##cpu##_END[]; /**< context save area end */
46 
47 #define __USTACK(cpu) __USTACK##cpu
48 #define __ISTACK(cpu) __ISTACK##cpu
49 #define __INTTAB_CPU(cpu) __INTTAB_CPU##cpu
50 #define __TRAPTAB_CPU(cpu) __TRAPTAB_CPU##cpu
51 #define __CSA(cpu) __CSA##cpu
52 #define __CSA_END(cpu) __CSA##cpu##_END
53 
54 #define IFXCOMPILER_COMMON_LINKER_SYMBOLS() \
55  __asm("\t .weak __A8_MEM, __A9_MEM"); /**< ASM extern definitions */
56 
57 /*Wrapper macros for the tool specific definitions */
58 #if defined(IFX_USE_SW_MANAGED_INT)
59 #define __INTTAB(cpu) ((unsigned int)__INTTAB_CPU##cpu | (unsigned int)0x1FE0)
60 #else
61 #define __INTTAB(cpu) __INTTAB_CPU##cpu
62 #endif /*defined(IFX_USE_SW_MANAGED_INT) */
63 
64 #define __TRAPTAB(cpu) __TRAPTAB_CPU##cpu
65 
66 #define __SDATA1(cpu) _SMALL_DATA_
67 #define __SDATA2(cpu) _LITERAL_DATA_
68 #define __SDATA3(cpu) __A8_MEM
69 #define __SDATA4(cpu) __A9_MEM
70 
71 #endif /*IFX_CFG_USE_COMPILER_DEFAULT_LINKER*/
72 
73 /******************************************************************************/
74 #define IFX_INLINE __inline__
75 
76 /* FXIME check how to pack structure members */
77 #define IFX_PACKED
78 
79 #define COMPILER_NAME "DCC"
80 #define COMPILER_VERSION __VERSION__
81 
82 #define COMPILER_REVISION 0
83 #define IFX_INTERRUPT_FAST IFX_INTERRUPT
84 
85 #if defined(IFX_USE_SW_MANAGED_INT)
86 
87 #ifndef IFX_INTERRUPT
88 #define IFX_INTERRUPT(isr, vectabNum, prio) void isr(void)
89 #endif
90 
91 #else
92 /* *INDENT-OFF* */
93 
94 #ifndef IFX_INTERRUPT
95 #define IFX_INTERRUPT(isr, vectabNum, prio) IFX_INTERRUPT_INTERNAL(isr, vectabNum, prio)
96 #endif
97 #endif /*defined(IFX_USE_SW_MANAGED_INT)*/
98 
99 #ifndef IFX_INTERRUPT_INTERNAL
100 #define IFX_INTERRUPT_INTERNAL(isr, vectabNum, prio) \
101 void __interrupt(prio) __vector_table(vectabNum) isr(void)
102 #endif
103 
104 /*Macro IFX_INTERRUPT_LEGACY is to be used for compiler version pror to 5.9.3.0*/
105 #define IFX_INTERRUPT_LEGACY(isr, vectabNum, prio) \
106 __asm ("\t.align\t 5\n\t\
107 .section .int."#prio"\n \t.sectionlink .inttab"#vectabNum".intvec."#prio"\n\
108 #$$bf\n\
109 __intvec_tc"#vectabNum"_"#prio":\n\
110  movh.a\t %a14,"#isr"@ha\n\
111  lea\t %a14,[%a14]"#isr"@l\n\
112  ji\t %a14\n\
113 #$$ef\n\t\
114 .section .intend."#prio"\n \t.sectionlink .text");\
115 __interrupt__ void isr (void)
116 
117 /* *INDENT-ON* */
118 
119 /******************************************************************************/
120 
121 #define IFX_ALIGN(n) __attribute__ ((aligned(n)))
122 
123 /******************************************************************************/
124 /*Memory qualifiers*/
125 #ifndef IFX_FAR_ABS
126 #define IFX_FAR_ABS
127 #endif
129 #ifndef IFX_NEAR_ABS
130 #define IFX_NEAR_ABS
131 #endif
132 
133 #ifndef IFX_REL_A0
134 #define IFX_REL_A0
135 #endif
136 
137 #ifndef IFX_REL_A1
138 #define IFX_REL_A1
139 #endif
140 
141 #ifndef IFX_REL_A1
142 #define IFX_REL_A1
143 #endif
144 
145 #ifndef IFX_REL_A9
146 #define IFX_REL_A9
147 #endif
148 /******************************************************************************/
149 
150 #endif /* COMPILERDCC_H */