2 * FreeRTOS Kernel V10.4.3
3 * Copyright (C) 2020 Synopsys, Inc. or its affiliates. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * https://www.FreeRTOS.org
23 * https://github.com/FreeRTOS
36 /* record stack high address for stack check */
37 #ifndef configRECORD_STACK_HIGH_ADDRESS
38 #define configRECORD_STACK_HIGH_ADDRESS 1
41 /*-----------------------------------------------------------
42 * Port specific definitions.
44 * The settings in this file configure FreeRTOS correctly for the
45 * given hardware and compiler.
47 * These settings should not be altered.
48 *-----------------------------------------------------------
51 /* Type definitions. */
53 #define portFLOAT float
54 #define portDOUBLE double
56 #define portSHORT short
57 #define portSTACK_TYPE unsigned int
58 #define portBASE_TYPE portLONG
61 #define Asm __asm__ volatile
68 #define NULL 0 /* invalid pointer */
72 #define true 1 /* true */
76 #define false 0 /* false */
79 typedef portSTACK_TYPE StackType_t;
80 typedef long BaseType_t;
81 typedef unsigned long UBaseType_t;
83 #if ( configUSE_16_BIT_TICKS == 1 )
84 typedef uint16_t TickType_t;
85 #define portMAX_DELAY ( TickType_t ) 0xffff
87 typedef unsigned int TickType_t;
88 #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
91 #define portNO_CRITICAL_NESTING ( ( uint32_t ) 0 )
92 #define portSTACK_GROWTH ( -1 )
93 #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
94 #define portBYTE_ALIGNMENT 8
95 #define portNOP() Asm( "nop_s" );
96 #define IPM_ENABLE_ALL 1
98 #define portYIELD_FROM_ISR() vPortYieldFromIsr()
99 #define portYIELD() vPortYield()
101 /* Critical section management. */
102 #define portDISABLE_INTERRUPTS() \
105 Asm( "" ::: "memory" ); \
108 #define portENABLE_INTERRUPTS() \
110 Asm( "" ::: "memory" ); \
114 extern volatile unsigned int ulCriticalNesting;
116 #define portENTER_CRITICAL() \
118 portDISABLE_INTERRUPTS() \
119 ulCriticalNesting++; \
123 #define portEXIT_CRITICAL() \
125 if( ulCriticalNesting > portNO_CRITICAL_NESTING ) \
127 ulCriticalNesting--; \
128 if( ulCriticalNesting == portNO_CRITICAL_NESTING ) \
130 portENABLE_INTERRUPTS() \
136 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
137 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
139 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() do {} while( 0 ) /* we use the timer */
140 #define portALT_GET_RUN_TIME_COUNTER_VALUE( dest ) ( dest = xTickCount )
142 #if defined( __MW__ )
143 extern void task_end_hook( void * pxTCB );
144 #define portCLEAN_UP_TCB( pxTCB ) task_end_hook( ( void * ) pxTCB )
146 #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB
149 void vPortYield( void );
150 void vPortYieldFromIsr( void );
158 #endif /* PORTMACRO_H */