iLLD_TC29x  1.0
CompilerTasking.h
Go to the documentation of this file.
1 /**
2  * \file CompilerTasking.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 COMPILERTASKING_H
25 #define COMPILERTASKING_H 1
26 
27 /******************************************************************************/
28 
29 #include <stddef.h>
30 
31 /*Linker definitions which are specific to Tasking */
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: Common definitions ********************************************** */
37 #define IFXCOMPILER_COMMON_LINKER_SYMBOLS() \
38  __asm("\t .extern _SMALL_DATA_, _LITERAL_DATA_, _A8_DATA_, _A9_DATA_");
39 
40 /*End: Common definitions ********************************************** */
41 
42 /*Start: Core 0 definitions ********************************************** */
43 
44 #define IFXCOMPILER_CORE_LINKER_SYMBOLS(cpu) \
45  __asm("\t .extern __USTACK"#cpu); /**< user stack end is required as asm to be used with setreg macro */ \
46  extern unsigned int __ISTACK##cpu[]; /**< interrupt stack end */ \
47  extern unsigned int __INTTAB_CPU##cpu[]; /**< interrupt vector table */ \
48  extern unsigned int __TRAPTAB_CPU##cpu[]; /**< trap vector table */ \
49  extern unsigned int __CSA##cpu[]; /**< context save area begin */ \
50  extern unsigned int __CSA##cpu##_END[]; /**< context save area end */
51 
52 #define __USTACK(cpu) __USTACK##cpu
53 #define __ISTACK(cpu) __ISTACK##cpu
54 #define __INTTAB_CPU(cpu) __INTTAB_CPU##cpu
55 #define __TRAPTAB_CPU(cpu) __TRAPTAB_CPU##cpu
56 #define __CSA(cpu) __CSA##cpu
57 #define __CSA_END(cpu) __CSA##cpu##_END
58 
59 /*Wrapper macros for the tool specific definitions */
60 #if defined(IFX_USE_SW_MANAGED_INT)
61 #define __INTTAB(cpu) ((unsigned int)__INTTAB_CPU##cpu | (unsigned int)0x1FE0)
62 #else
63 #define __INTTAB(cpu) __INTTAB_CPU##cpu
64 #endif /*defined(IFX_USE_SW_MANAGED_INT) */
65 
66 #define __TRAPTAB(cpu) __TRAPTAB_CPU##cpu
67 
68 #define __SDATA1(cpu) _SMALL_DATA_
69 #define __SDATA2(cpu) _LITERAL_DATA_
70 #define __SDATA3(cpu) _A8_DATA_
71 #define __SDATA4(cpu) _A9_DATA_
72 
73 #endif /*IFX_CFG_USE_COMPILER_DEFAULT_LINKER*/
74 
75 /******************************************************************************/
76 #ifdef __cplusplus
77 #define IFX_INLINE static inline
78 #else
79 #define IFX_INLINE inline
80 #endif
81 
82 /* FXIME check how to pack structure members */
83 #define IFX_PACKED
84 
85 #define COMPILER_NAME "TASKING"
86 #define COMPILER_VERSION __VERSION__
87 
88 /* Note that __REVISION__ is only available for tasking compiler! */
89 #define COMPILER_REVISION __REVISION__
90 
91 /******************************************************************************/
92 
93 #if defined(IFX_USE_SW_MANAGED_INT)
94 
95 #ifndef IFX_INTERRUPT
96 #define IFX_INTERRUPT(isr, vectabNum, prio) void isr(void)
97 #endif
98 
99 #else
100 /* *INDENT-OFF* */
101 #ifndef IFX_INTERRUPT
102 #define IFX_INTERRUPT(isr, vectabNum, prio) IFX_INTERRUPT_INTERNAL(isr, vectabNum, prio)
103 #endif
104 #define IFX_INTERRUPT_FAST(isr, vectabNum, prio) void __interrupt_fast(prio) __vector_table(vectabNum) isr(void)
105 
106 #endif /*defined(IFX_USE_SW_MANAGED_INT)*/
107 
108 #define IFX_INTERRUPT_INTERNAL(isr, vectabNum, prio) void __interrupt(prio) __vector_table(vectabNum) isr(void)
109 
110 /* *INDENT-ON* */
111 
112 /******************************************************************************/
113 
114 #define IFX_ALIGN(n) __attribute__ ((__align(n)))
115 
116 /******************************************************************************/
117 /*Memory qualifiers*/
118 #ifndef IFX_FAR_ABS
119 #define IFX_FAR_ABS __far
120 #endif
121 
122 #ifndef IFX_NEAR_ABS
123 #define IFX_NEAR_ABS __near
124 #endif
126 #ifndef IFX_REL_A0
127 #define IFX_REL_A0 __a0
128 #endif
130 #ifndef IFX_REL_A1
131 #define IFX_REL_A1 __a1
132 #endif
134 #ifndef IFX_REL_A1
135 #define IFX_REL_A1 __a8
136 #endif
138 #ifndef IFX_REL_A9
139 #define IFX_REL_A9 __a9
140 #endif
141 /******************************************************************************/
142 
143 #endif /* COMPILERTASKING_H */