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