]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - rpp/lib/os/7.0.2_tms570/include/os/portable.h
Yet another place to fix
[pes-rpp/rpp-test-sw.git] / rpp / lib / os / 7.0.2_tms570 / include / os / portable.h
1 /*
2     FreeRTOS V7.0.2 - Copyright (C) 2011 Real Time Engineers Ltd.
3
4
5     ***************************************************************************
6      *                                                                       *
7      *    FreeRTOS tutorial books are available in pdf and paperback.        *
8      *    Complete, revised, and edited pdf reference manuals are also       *
9      *    available.                                                         *
10      *                                                                       *
11      *    Purchasing FreeRTOS documentation will not only help you, by       *
12      *    ensuring you get running as quickly as possible and with an        *
13      *    in-depth knowledge of how to use FreeRTOS, it will also help       *
14      *    the FreeRTOS project to continue with its mission of providing     *
15      *    professional grade, cross platform, de facto standard solutions    *
16      *    for microcontrollers - completely free of charge!                  *
17      *                                                                       *
18      *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *
19      *                                                                       *
20      *    Thank you for using FreeRTOS, and thank you for your support!      *
21      *                                                                       *
22     ***************************************************************************
23
24
25     This file is part of the FreeRTOS distribution.
26
27     FreeRTOS is free software; you can redistribute it and/or modify it under
28     the terms of the GNU General Public License (version 2) as published by the
29     Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
30     >>>NOTE<<< The modification to the GPL is included to allow you to
31     distribute a combined work that includes FreeRTOS without being obliged to
32     provide the source code for proprietary components outside of the FreeRTOS
33     kernel.  FreeRTOS is distributed in the hope that it will be useful, but
34     WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
35     or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
36     more details. You should have received a copy of the GNU General Public
37     License and the FreeRTOS license exception along with FreeRTOS; if not it
38     can be viewed here: http://www.freertos.org/a00114.html and also obtained
39     by writing to Richard Barry, contact details for whom are available on the
40     FreeRTOS WEB site.
41
42     1 tab == 4 spaces!
43
44     http://www.FreeRTOS.org - Documentation, latest information, license and
45     contact details.
46
47     http://www.SafeRTOS.com - A version that is certified for use in safety
48     critical systems.
49
50     http://www.OpenRTOS.com - Commercial support, development, porting,
51     licensing and training services.
52 */
53
54 /*-----------------------------------------------------------
55  * Portable layer API.  Each function must be defined for each port.
56  *----------------------------------------------------------*/
57
58 #ifndef PORTABLE_H
59 #define PORTABLE_H
60
61 /* Include the macro file relevant to the port being used. */
62 #include "os/portmacro.h"
63
64 #if portBYTE_ALIGNMENT == 8
65     #define portBYTE_ALIGNMENT_MASK ( 0x0007 )
66 #endif
67
68 #if portBYTE_ALIGNMENT == 4
69     #define portBYTE_ALIGNMENT_MASK ( 0x0003 )
70 #endif
71
72 #if portBYTE_ALIGNMENT == 2
73     #define portBYTE_ALIGNMENT_MASK ( 0x0001 )
74 #endif
75
76 #if portBYTE_ALIGNMENT == 1
77     #define portBYTE_ALIGNMENT_MASK ( 0x0000 )
78 #endif
79
80 #ifndef portBYTE_ALIGNMENT_MASK
81     #error "Invalid portBYTE_ALIGNMENT definition"
82 #endif
83
84 #ifndef portNUM_CONFIGURABLE_REGIONS
85     #define portNUM_CONFIGURABLE_REGIONS 1
86 #endif
87
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91
92 #include "os/mpu_wrappers.h"
93
94 /*
95  * Setup the stack of a new task so it is ready to be placed under the
96  * scheduler control.  The registers have to be placed on the stack in
97  * the order that the port expects to find them.
98  *
99  */
100 #if( portUSING_MPU_WRAPPERS == 1 )
101     portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters, portBASE_TYPE xRunPrivileged ) PRIVILEGED_FUNCTION;
102 #else
103     portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );
104 #endif
105
106 /*
107  * Map to the memory management routines required for the port.
108  */
109 void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
110 void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
111 void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
112 size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
113
114 /*
115  * Setup the hardware ready for the scheduler to take control.  This generally
116  * sets up a tick interrupt and sets timers for the correct tick frequency.
117  */
118 portBASE_TYPE xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
119
120 /*
121  * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
122  * the hardware is left in its original condition after the scheduler stops
123  * executing.
124  */
125 void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
126
127 /*
128  * The structures and methods of manipulating the MPU are contained within the
129  * port layer.
130  *
131  * Fills the xMPUSettings structure with the memory region information
132  * contained in xRegions.
133  */
134 #if( portUSING_MPU_WRAPPERS == 1 )
135     struct xMEMORY_REGION;
136     void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned short usStackDepth ) PRIVILEGED_FUNCTION;
137 #endif
138
139 #ifdef __cplusplus
140 }
141 #endif
142
143 #endif /* PORTABLE_H */
144