]> git.sur5r.net Git - freertos/blob - Source/include/portable.h
Update to V5.1.2.
[freertos] / Source / include / portable.h
1 /*\r
2         FreeRTOS.org V5.1.2 - Copyright (C) 2003-2009 Richard Barry.\r
3 \r
4         This file is part of the FreeRTOS.org distribution.\r
5 \r
6         FreeRTOS.org is free software; you can redistribute it and/or modify\r
7         it under the terms of the GNU General Public License as published by\r
8         the Free Software Foundation; either version 2 of the License, or\r
9         (at your option) any later version.\r
10 \r
11         FreeRTOS.org is distributed in the hope that it will be useful,\r
12         but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14         GNU General Public License for more details.\r
15 \r
16         You should have received a copy of the GNU General Public License\r
17         along with FreeRTOS.org; if not, write to the Free Software\r
18         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 \r
20         A special exception to the GPL can be applied should you wish to distribute\r
21         a combined work that includes FreeRTOS.org, without being obliged to provide\r
22         the source code for any proprietary components.  See the licensing section\r
23         of http:www.FreeRTOS.org for full details of how and when the exception\r
24         can be applied.\r
25 \r
26     ***************************************************************************\r
27     ***************************************************************************\r
28     *                                                                         *\r
29     * Get the FreeRTOS eBook!  See http://www.FreeRTOS.org/Documentation      *\r
30         *                                                                         *\r
31         * This is a concise, step by step, 'hands on' guide that describes both   *\r
32         * general multitasking concepts and FreeRTOS specifics. It presents and   *\r
33         * explains numerous examples that are written using the FreeRTOS API.     *\r
34         * Full source code for all the examples is provided in an accompanying    *\r
35         * .zip file.                                                              *\r
36     *                                                                         *\r
37     ***************************************************************************\r
38     ***************************************************************************\r
39 \r
40         Please ensure to read the configuration and relevant port sections of the\r
41         online documentation.\r
42 \r
43         http://www.FreeRTOS.org - Documentation, latest information, license and\r
44         contact details.\r
45 \r
46         http://www.SafeRTOS.com - A version that is certified for use in safety\r
47         critical systems.\r
48 \r
49         http://www.OpenRTOS.com - Commercial support, development, porting,\r
50         licensing and training services.\r
51 */\r
52 \r
53 /*-----------------------------------------------------------\r
54  * Portable layer API.  Each function must be defined for each port.\r
55  *----------------------------------------------------------*/\r
56 \r
57 #ifndef PORTABLE_H\r
58 #define PORTABLE_H\r
59 \r
60 /* Include the macro file relevant to the port being used. */\r
61 \r
62 #ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT\r
63         #include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h"\r
64         typedef void ( __interrupt __far *pxISR )();\r
65 #endif\r
66 \r
67 #ifdef OPEN_WATCOM_FLASH_LITE_186_PORT\r
68         #include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h"\r
69         typedef void ( __interrupt __far *pxISR )();\r
70 #endif\r
71 \r
72 #ifdef GCC_MEGA_AVR\r
73         #include "../portable/GCC/ATMega323/portmacro.h"\r
74 #endif\r
75 \r
76 #ifdef IAR_MEGA_AVR\r
77         #include "../portable/IAR/ATMega323/portmacro.h"\r
78 #endif\r
79 \r
80 #ifdef MPLAB_PIC24_PORT\r
81         #include "..\..\Source\portable\MPLAB\PIC24_dsPIC\portmacro.h"\r
82 #endif\r
83 \r
84 #ifdef MPLAB_DSPIC_PORT\r
85         #include "..\..\Source\portable\MPLAB\PIC24_dsPIC\portmacro.h"\r
86 #endif\r
87 \r
88 #ifdef MPLAB_PIC18F_PORT\r
89         #include "..\..\Source\portable\MPLAB\PIC18F\portmacro.h"\r
90 #endif\r
91 \r
92 #ifdef MPLAB_PIC32MX_PORT\r
93         #include "..\..\Source\portable\MPLAB\PIC32MX\portmacro.h"\r
94 #endif\r
95 \r
96 #ifdef _FEDPICC\r
97         #include "libFreeRTOS/Include/portmacro.h"\r
98 #endif\r
99 \r
100 #ifdef SDCC_CYGNAL\r
101         #include "../../Source/portable/SDCC/Cygnal/portmacro.h"\r
102 #endif\r
103 \r
104 #ifdef GCC_ARM7\r
105         #include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h"\r
106 #endif\r
107 \r
108 #ifdef GCC_ARM7_ECLIPSE\r
109         #include "portmacro.h"\r
110 #endif\r
111 \r
112 #ifdef ROWLEY_LPC23xx\r
113         #include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h"\r
114 #endif\r
115 \r
116 #ifdef IAR_MSP430\r
117         #include "..\..\Source\portable\IAR\MSP430\portmacro.h" \r
118 #endif\r
119         \r
120 #ifdef GCC_MSP430\r
121         #include "../../Source/portable/GCC/MSP430F449/portmacro.h"\r
122 #endif\r
123 \r
124 #ifdef ROWLEY_MSP430\r
125         #include "../../Source/portable/Rowley/MSP430F449/portmacro.h"\r
126 #endif\r
127 \r
128 #ifdef ARM7_LPC21xx_KEIL_RVDS\r
129         #include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h"\r
130 #endif\r
131 \r
132 #ifdef SAM7_GCC\r
133         #include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h"\r
134 #endif\r
135 \r
136 #ifdef SAM7_IAR\r
137         #include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h"\r
138 #endif\r
139 \r
140 #ifdef SAM9XE_IAR\r
141         #include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h"\r
142 #endif\r
143 \r
144 #ifdef LPC2000_IAR\r
145         #include "..\..\Source\portable\IAR\LPC2000\portmacro.h"\r
146 #endif\r
147 \r
148 #ifdef STR71X_IAR\r
149         #include "..\..\Source\portable\IAR\STR71x\portmacro.h"\r
150 #endif\r
151 \r
152 #ifdef STR75X_IAR\r
153         #include "..\..\Source\portable\IAR\STR75x\portmacro.h"\r
154 #endif\r
155         \r
156 #ifdef STR75X_GCC\r
157         #include "..\..\Source\portable\GCC\STR75x\portmacro.h"\r
158 #endif\r
159 \r
160 #ifdef STR91X_IAR\r
161         #include "..\..\Source\portable\IAR\STR91x\portmacro.h"\r
162 #endif\r
163         \r
164 #ifdef GCC_H8S\r
165         #include "../../Source/portable/GCC/H8S2329/portmacro.h"\r
166 #endif\r
167 \r
168 #ifdef GCC_AT91FR40008\r
169         #include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h"\r
170 #endif\r
171 \r
172 #ifdef RVDS_ARMCM3_LM3S102\r
173         #include "../../Source/portable/RVDS/ARM_CM3/portmacro.h"\r
174 #endif\r
175 \r
176 #ifdef GCC_ARMCM3_LM3S102\r
177         #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"\r
178 #endif\r
179 \r
180 #ifdef GCC_ARMCM3\r
181         #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"\r
182 #endif\r
183 \r
184 #ifdef IAR_ARM_CM3\r
185         #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"\r
186 #endif\r
187 \r
188 #ifdef IAR_ARMCM3_LM\r
189         #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"\r
190 #endif\r
191         \r
192 #ifdef HCS12_CODE_WARRIOR\r
193         #include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"\r
194 #endif  \r
195 \r
196 #ifdef MICROBLAZE_GCC\r
197         #include "../../Source/portable/GCC/MicroBlaze/portmacro.h"\r
198 #endif\r
199 \r
200 #ifdef TERN_EE\r
201         #include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h"\r
202 #endif\r
203 \r
204 #ifdef GCC_HCS12\r
205         #include "../../Source/portable/GCC/HCS12/portmacro.h"\r
206 #endif\r
207 \r
208 #ifdef GCC_MCF5235\r
209     #include "../../Source/portable/GCC/MCF5235/portmacro.h"\r
210 #endif\r
211 \r
212 #ifdef COLDFIRE_V2_GCC\r
213         #include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h"\r
214 #endif\r
215 \r
216 #ifdef COLDFIRE_V2_CODEWARRIOR\r
217         #include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h"\r
218 #endif\r
219 \r
220 #ifdef GCC_PPC405\r
221         #include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h"\r
222 #endif\r
223 \r
224 #ifdef _16FX_SOFTUNE\r
225         #include "..\..\Source\portable\Softune\MB96340\portmacro.h"\r
226 #endif\r
227 \r
228 #ifdef BCC_INDUSTRIAL_PC_PORT\r
229         /* A short file name has to be used in place of the normal\r
230         FreeRTOSConfig.h when using the Borland compiler. */\r
231         #include "frconfig.h"\r
232         #include "..\portable\BCC\16BitDOS\PC\prtmacro.h"\r
233     typedef void ( __interrupt __far *pxISR )();\r
234 #endif\r
235 \r
236 #ifdef BCC_FLASH_LITE_186_PORT\r
237         /* A short file name has to be used in place of the normal\r
238         FreeRTOSConfig.h when using the Borland compiler. */\r
239         #include "frconfig.h"\r
240         #include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h"\r
241     typedef void ( __interrupt __far *pxISR )();\r
242 #endif\r
243 \r
244 #ifdef __GNUC__\r
245    #ifdef __AVR32_AVR32A__\r
246            #include "portmacro.h"\r
247    #endif\r
248 #endif\r
249 \r
250 #ifdef __ICCAVR32__\r
251    #ifdef __CORE__\r
252       #if __CORE__ == __AVR32A__\r
253               #include "portmacro.h"\r
254       #endif\r
255    #endif\r
256 #endif\r
257 \r
258 #ifdef __91467D\r
259         #include "portmacro.h"\r
260 #endif\r
261 \r
262 #ifdef __96340\r
263         #include "portmacro.h"\r
264 #endif\r
265 \r
266 \r
267 #ifdef __IAR_V850ES_Fx3__\r
268         #include "../../Source/portable/IAR/V850ES/portmacro.h"\r
269 #endif\r
270 \r
271 #ifdef __IAR_V850ES_Jx3__\r
272         #include "../../Source/portable/IAR/V850ES/portmacro.h"\r
273 #endif\r
274 \r
275 #ifdef __IAR_V850ES_Jx3_L__\r
276         #include "../../Source/portable/IAR/V850ES/portmacro.h"\r
277 #endif\r
278 \r
279 #ifdef __IAR_V850ES_Jx2__\r
280         #include "../../Source/portable/IAR/V850ES/portmacro.h"\r
281 #endif\r
282 \r
283 #ifdef __IAR_V850ES_Hx2__\r
284         #include "../../Source/portable/IAR/V850ES/portmacro.h"\r
285 #endif\r
286 \r
287 #ifdef __IAR_78K0R_Kx3__\r
288         #include "../../Source/portable/IAR/78K0R/portmacro.h"\r
289 #endif\r
290         \r
291 #ifdef __IAR_78K0R_Kx3L__\r
292         #include "../../Source/portable/IAR/78K0R/portmacro.h"\r
293 #endif\r
294         \r
295 #ifdef __cplusplus\r
296 extern "C" {\r
297 #endif\r
298 \r
299 /*\r
300  * Setup the stack of a new task so it is ready to be placed under the\r
301  * scheduler control.  The registers have to be placed on the stack in\r
302  * the order that the port expects to find them.\r
303  */\r
304 portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );\r
305 \r
306 /*\r
307  * Map to the memory management routines required for the port.\r
308  */\r
309 void *pvPortMalloc( size_t xSize );\r
310 void vPortFree( void *pv );\r
311 void vPortInitialiseBlocks( void );\r
312 \r
313 /*\r
314  * Setup the hardware ready for the scheduler to take control.  This generally\r
315  * sets up a tick interrupt and sets timers for the correct tick frequency.\r
316  */\r
317 portBASE_TYPE xPortStartScheduler( void );\r
318 \r
319 /*\r
320  * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so\r
321  * the hardware is left in its original condition after the scheduler stops\r
322  * executing.\r
323  */\r
324 void vPortEndScheduler( void );\r
325 \r
326 #ifdef __cplusplus\r
327 }\r
328 #endif\r
329 \r
330 #endif /* PORTABLE_H */\r
331 \r