2 FreeRTOS V7.4.2 - Copyright (C) 2013 Real Time Engineers Ltd.
4 FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
5 http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
7 ***************************************************************************
9 * FreeRTOS tutorial books are available in pdf and paperback. *
10 * Complete, revised, and edited pdf reference manuals are also *
13 * Purchasing FreeRTOS documentation will not only help you, by *
14 * ensuring you get running as quickly as possible and with an *
15 * in-depth knowledge of how to use FreeRTOS, it will also help *
16 * the FreeRTOS project to continue with its mission of providing *
17 * professional grade, cross platform, de facto standard solutions *
18 * for microcontrollers - completely free of charge! *
20 * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
22 * Thank you for using FreeRTOS, and thank you for your support! *
24 ***************************************************************************
27 This file is part of the FreeRTOS distribution.
29 FreeRTOS is free software; you can redistribute it and/or modify it under
30 the terms of the GNU General Public License (version 2) as published by the
31 Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
33 >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
34 distribute a combined work that includes FreeRTOS without being obliged to
35 provide the source code for proprietary components outside of the FreeRTOS
38 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
39 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
40 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
41 details. You should have received a copy of the GNU General Public License
42 and the FreeRTOS license exception along with FreeRTOS; if not it can be
43 viewed here: http://www.freertos.org/a00114.html and also obtained by
44 writing to Real Time Engineers Ltd., contact details for whom are available
45 on the FreeRTOS WEB site.
49 ***************************************************************************
51 * Having a problem? Start by reading the FAQ "My application does *
52 * not run, what could be wrong?" *
54 * http://www.FreeRTOS.org/FAQHelp.html *
56 ***************************************************************************
59 http://www.FreeRTOS.org - Documentation, books, training, latest versions,
60 license and Real Time Engineers Ltd. contact details.
62 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
63 including FreeRTOS+Trace - an indispensable productivity tool, and our new
64 fully thread aware and reentrant UDP/IP stack.
66 http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
67 Integrity Systems, who sell the code with commercial support,
68 indemnification and middleware, under the OpenRTOS brand.
70 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
71 engineered and independently SIL3 certified version for use in safety and
72 mission critical applications that require provable dependability.
75 /*-----------------------------------------------------------
76 * Portable layer API. Each function must be defined for each port.
77 *----------------------------------------------------------*/
82 /* Include the macro file relevant to the port being used. */
83 #include "os/portmacro.h"
85 #if portBYTE_ALIGNMENT == 8
86 #define portBYTE_ALIGNMENT_MASK ( 0x0007 )
89 #if portBYTE_ALIGNMENT == 4
90 #define portBYTE_ALIGNMENT_MASK ( 0x0003 )
93 #if portBYTE_ALIGNMENT == 2
94 #define portBYTE_ALIGNMENT_MASK ( 0x0001 )
97 #if portBYTE_ALIGNMENT == 1
98 #define portBYTE_ALIGNMENT_MASK ( 0x0000 )
101 #ifndef portBYTE_ALIGNMENT_MASK
102 #error "Invalid portBYTE_ALIGNMENT definition"
105 #ifndef portNUM_CONFIGURABLE_REGIONS
106 #define portNUM_CONFIGURABLE_REGIONS 1
113 #include "os/mpu_wrappers.h"
116 * Setup the stack of a new task so it is ready to be placed under the
117 * scheduler control. The registers have to be placed on the stack in
118 * the order that the port expects to find them.
121 #if( portUSING_MPU_WRAPPERS == 1 )
122 portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters, portBASE_TYPE xRunPrivileged ) PRIVILEGED_FUNCTION;
124 portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );
128 * Map to the memory management routines required for the port.
130 void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
131 void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
132 void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
133 size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
136 * Setup the hardware ready for the scheduler to take control. This generally
137 * sets up a tick interrupt and sets timers for the correct tick frequency.
139 portBASE_TYPE xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
142 * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
143 * the hardware is left in its original condition after the scheduler stops
146 void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
149 * The structures and methods of manipulating the MPU are contained within the
152 * Fills the xMPUSettings structure with the memory region information
153 * contained in xRegions.
155 #if( portUSING_MPU_WRAPPERS == 1 )
156 struct xMEMORY_REGION;
157 void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned short usStackDepth ) PRIVILEGED_FUNCTION;
164 #endif /* PORTABLE_H */