2 FreeRTOS V6.0.5 - Copyright (C) 2010 Real Time Engineers Ltd.
\r
4 ***************************************************************************
\r
8 * + New to FreeRTOS, *
\r
9 * + Wanting to learn FreeRTOS or multitasking in general quickly *
\r
10 * + Looking for basic training, *
\r
11 * + Wanting to improve your FreeRTOS skills and productivity *
\r
13 * then take a look at the FreeRTOS eBook *
\r
15 * "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
\r
16 * http://www.FreeRTOS.org/Documentation *
\r
18 * A pdf reference manual is also available. Both are usually delivered *
\r
19 * to your inbox within 20 minutes to two hours when purchased between 8am *
\r
20 * and 8pm GMT (although please allow up to 24 hours in case of *
\r
21 * exceptional circumstances). Thank you for your support! *
\r
23 ***************************************************************************
\r
25 This file is part of the FreeRTOS distribution.
\r
27 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
28 the terms of the GNU General Public License (version 2) as published by the
\r
29 Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
\r
30 ***NOTE*** The exception to the GPL is included to allow you to distribute
\r
31 a combined work that includes FreeRTOS without being obliged to provide the
\r
32 source code for proprietary components outside of the FreeRTOS kernel.
\r
33 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
\r
34 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
35 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
36 more details. You should have received a copy of the GNU General Public
\r
37 License and the FreeRTOS license exception along with FreeRTOS; if not it
\r
38 can be viewed here: http://www.freertos.org/a00114.html and also obtained
\r
39 by writing to Richard Barry, contact details for whom are available on the
\r
44 http://www.FreeRTOS.org - Documentation, latest information, license and
\r
47 http://www.SafeRTOS.com - A version that is certified for use in safety
\r
50 http://www.OpenRTOS.com - Commercial support, development, porting,
\r
51 licensing and training services.
\r
54 /*-----------------------------------------------------------
\r
55 * Portable layer API. Each function must be defined for each port.
\r
56 *----------------------------------------------------------*/
\r
61 /* Include the macro file relevant to the port being used. */
\r
63 #ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
\r
64 #include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h"
\r
65 typedef void ( __interrupt __far *pxISR )();
\r
68 #ifdef OPEN_WATCOM_FLASH_LITE_186_PORT
\r
69 #include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h"
\r
70 typedef void ( __interrupt __far *pxISR )();
\r
74 #include "../portable/GCC/ATMega323/portmacro.h"
\r
78 #include "../portable/IAR/ATMega323/portmacro.h"
\r
81 #ifdef MPLAB_PIC24_PORT
\r
82 #include "..\..\Source\portable\MPLAB\PIC24_dsPIC\portmacro.h"
\r
85 #ifdef MPLAB_DSPIC_PORT
\r
86 #include "..\..\Source\portable\MPLAB\PIC24_dsPIC\portmacro.h"
\r
89 #ifdef MPLAB_PIC18F_PORT
\r
90 #include "..\..\Source\portable\MPLAB\PIC18F\portmacro.h"
\r
93 #ifdef MPLAB_PIC32MX_PORT
\r
94 #include "..\..\Source\portable\MPLAB\PIC32MX\portmacro.h"
\r
98 #include "libFreeRTOS/Include/portmacro.h"
\r
102 #include "../../Source/portable/SDCC/Cygnal/portmacro.h"
\r
106 #include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h"
\r
109 #ifdef GCC_ARM7_ECLIPSE
\r
110 #include "portmacro.h"
\r
113 #ifdef ROWLEY_LPC23xx
\r
114 #include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h"
\r
118 #include "..\..\Source\portable\IAR\MSP430\portmacro.h"
\r
122 #include "../../Source/portable/GCC/MSP430F449/portmacro.h"
\r
125 #ifdef ROWLEY_MSP430
\r
126 #include "../../Source/portable/Rowley/MSP430F449/portmacro.h"
\r
129 #ifdef ARM7_LPC21xx_KEIL_RVDS
\r
130 #include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h"
\r
134 #include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h"
\r
138 #include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h"
\r
142 #include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h"
\r
146 #include "..\..\Source\portable\IAR\LPC2000\portmacro.h"
\r
150 #include "..\..\Source\portable\IAR\STR71x\portmacro.h"
\r
154 #include "..\..\Source\portable\IAR\STR75x\portmacro.h"
\r
158 #include "..\..\Source\portable\GCC\STR75x\portmacro.h"
\r
162 #include "..\..\Source\portable\IAR\STR91x\portmacro.h"
\r
166 #include "../../Source/portable/GCC/H8S2329/portmacro.h"
\r
169 #ifdef GCC_AT91FR40008
\r
170 #include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h"
\r
173 #ifdef RVDS_ARMCM3_LM3S102
\r
174 #include "../../Source/portable/RVDS/ARM_CM3/portmacro.h"
\r
177 #ifdef GCC_ARMCM3_LM3S102
\r
178 #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
\r
182 #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
\r
186 #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
\r
189 #ifdef IAR_ARMCM3_LM
\r
190 #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
\r
193 #ifdef HCS12_CODE_WARRIOR
\r
194 #include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"
\r
197 #ifdef MICROBLAZE_GCC
\r
198 #include "../../Source/portable/GCC/MicroBlaze/portmacro.h"
\r
202 #include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h"
\r
206 #include "../../Source/portable/GCC/HCS12/portmacro.h"
\r
210 #include "../../Source/portable/GCC/MCF5235/portmacro.h"
\r
213 #ifdef COLDFIRE_V2_GCC
\r
214 #include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h"
\r
217 #ifdef COLDFIRE_V2_CODEWARRIOR
\r
218 #include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h"
\r
222 #include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h"
\r
226 #include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h"
\r
229 #ifdef _16FX_SOFTUNE
\r
230 #include "..\..\Source\portable\Softune\MB96340\portmacro.h"
\r
233 #ifdef BCC_INDUSTRIAL_PC_PORT
\r
234 /* A short file name has to be used in place of the normal
\r
235 FreeRTOSConfig.h when using the Borland compiler. */
\r
236 #include "frconfig.h"
\r
237 #include "..\portable\BCC\16BitDOS\PC\prtmacro.h"
\r
238 typedef void ( __interrupt __far *pxISR )();
\r
241 #ifdef BCC_FLASH_LITE_186_PORT
\r
242 /* A short file name has to be used in place of the normal
\r
243 FreeRTOSConfig.h when using the Borland compiler. */
\r
244 #include "frconfig.h"
\r
245 #include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h"
\r
246 typedef void ( __interrupt __far *pxISR )();
\r
250 #ifdef __AVR32_AVR32A__
\r
251 #include "portmacro.h"
\r
255 #ifdef __ICCAVR32__
\r
257 #if __CORE__ == __AVR32A__
\r
258 #include "portmacro.h"
\r
264 #include "portmacro.h"
\r
268 #include "portmacro.h"
\r
272 #ifdef __IAR_V850ES_Fx3__
\r
273 #include "../../Source/portable/IAR/V850ES/portmacro.h"
\r
276 #ifdef __IAR_V850ES_Jx3__
\r
277 #include "../../Source/portable/IAR/V850ES/portmacro.h"
\r
280 #ifdef __IAR_V850ES_Jx3_L__
\r
281 #include "../../Source/portable/IAR/V850ES/portmacro.h"
\r
284 #ifdef __IAR_V850ES_Jx2__
\r
285 #include "../../Source/portable/IAR/V850ES/portmacro.h"
\r
288 #ifdef __IAR_V850ES_Hx2__
\r
289 #include "../../Source/portable/IAR/V850ES/portmacro.h"
\r
292 #ifdef __IAR_78K0R_Kx3__
\r
293 #include "../../Source/portable/IAR/78K0R/portmacro.h"
\r
296 #ifdef __IAR_78K0R_Kx3L__
\r
297 #include "../../Source/portable/IAR/78K0R/portmacro.h"
\r
300 /* Catch all to ensure portmacro.h is included in the build. Newer demos
\r
301 have the path as part of the project options, rather than as relative from
\r
302 the project location. If portENTER_CRITICAL() has not been defined then
\r
303 portmacro.h has not yet been included - as every portmacro.h provides a
\r
304 portENTER_CRITICAL() definition. Check the demo application for your demo
\r
305 to find the path to the correct portmacro.h file. */
\r
306 #ifndef portENTER_CRITICAL
\r
307 #include "portmacro.h"
\r
310 #if portBYTE_ALIGNMENT == 8
\r
311 #define portBYTE_ALIGNMENT_MASK ( 0x0007 )
\r
314 #if portBYTE_ALIGNMENT == 4
\r
315 #define portBYTE_ALIGNMENT_MASK ( 0x0003 )
\r
318 #if portBYTE_ALIGNMENT == 2
\r
319 #define portBYTE_ALIGNMENT_MASK ( 0x0001 )
\r
322 #if portBYTE_ALIGNMENT == 1
\r
323 #define portBYTE_ALIGNMENT_MASK ( 0x0000 )
\r
326 #ifndef portBYTE_ALIGNMENT_MASK
\r
327 #error "Invalid portBYTE_ALIGNMENT definition"
\r
330 #ifndef portNUM_CONFIGURABLE_REGIONS
\r
331 #define portNUM_CONFIGURABLE_REGIONS 1
\r
338 #include "mpu_wrappers.h"
\r
341 * Setup the stack of a new task so it is ready to be placed under the
\r
342 * scheduler control. The registers have to be placed on the stack in
\r
343 * the order that the port expects to find them.
\r
346 #if( portUSING_MPU_WRAPPERS == 1 )
\r
347 portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters, portBASE_TYPE xRunPrivileged ) PRIVILEGED_FUNCTION;
\r
349 portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );
\r
353 * Map to the memory management routines required for the port.
\r
355 void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
\r
356 void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
\r
357 void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
\r
358 size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
\r
361 * Setup the hardware ready for the scheduler to take control. This generally
\r
362 * sets up a tick interrupt and sets timers for the correct tick frequency.
\r
364 portBASE_TYPE xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
\r
367 * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
\r
368 * the hardware is left in its original condition after the scheduler stops
\r
371 void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
\r
374 * The structures and methods of manipulating the MPU are contained within the
\r
377 * Fills the xMPUSettings structure with the memory region information
\r
378 * contained in xRegions.
\r
380 #if( portUSING_MPU_WRAPPERS == 1 )
\r
381 struct xMEMORY_REGION;
\r
382 void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned short usStackDepth ) PRIVILEGED_FUNCTION;
\r
389 #endif /* PORTABLE_H */
\r