2 * FreeRTOS Kernel V10.4.4
3 * Copyright (C) 2020 Synopsys, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: MIT
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 * https://www.FreeRTOS.org
25 * https://github.com/FreeRTOS
38 /* record stack high address for stack check */
39 #ifndef configRECORD_STACK_HIGH_ADDRESS
40 #define configRECORD_STACK_HIGH_ADDRESS 1
43 /*-----------------------------------------------------------
44 * Port specific definitions.
46 * The settings in this file configure FreeRTOS correctly for the
47 * given hardware and compiler.
49 * These settings should not be altered.
50 *-----------------------------------------------------------
53 /* Type definitions. */
55 #define portFLOAT float
56 #define portDOUBLE double
58 #define portSHORT short
59 #define portSTACK_TYPE unsigned int
60 #define portBASE_TYPE portLONG
63 #define Asm __asm__ volatile
70 #define NULL 0 /* invalid pointer */
74 #define true 1 /* true */
78 #define false 0 /* false */
81 typedef portSTACK_TYPE StackType_t;
82 typedef long BaseType_t;
83 typedef unsigned long UBaseType_t;
85 #if ( configUSE_16_BIT_TICKS == 1 )
86 typedef uint16_t TickType_t;
87 #define portMAX_DELAY ( TickType_t ) 0xffff
89 typedef unsigned int TickType_t;
90 #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
93 #define portNO_CRITICAL_NESTING ( ( uint32_t ) 0 )
94 #define portSTACK_GROWTH ( -1 )
95 #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
96 #define portBYTE_ALIGNMENT 8
97 #define portNOP() Asm( "nop_s" );
98 #define IPM_ENABLE_ALL 1
100 #define portYIELD_FROM_ISR() vPortYieldFromIsr()
101 #define portYIELD() vPortYield()
103 /* Critical section management. */
104 #define portDISABLE_INTERRUPTS() \
107 Asm( "" ::: "memory" ); \
110 #define portENABLE_INTERRUPTS() \
112 Asm( "" ::: "memory" ); \
116 extern volatile unsigned int ulCriticalNesting;
118 #define portENTER_CRITICAL() \
120 portDISABLE_INTERRUPTS() \
121 ulCriticalNesting++; \
125 #define portEXIT_CRITICAL() \
127 if( ulCriticalNesting > portNO_CRITICAL_NESTING ) \
129 ulCriticalNesting--; \
130 if( ulCriticalNesting == portNO_CRITICAL_NESTING ) \
132 portENABLE_INTERRUPTS() \
138 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
139 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
141 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() do {} while( 0 ) /* we use the timer */
142 #define portALT_GET_RUN_TIME_COUNTER_VALUE( dest ) ( dest = xTickCount )
144 #if defined( __MW__ )
145 extern void task_end_hook( void * pxTCB );
146 #define portCLEAN_UP_TCB( pxTCB ) task_end_hook( ( void * ) pxTCB )
148 #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB
151 void vPortYield( void );
152 void vPortYieldFromIsr( void );
160 #endif /* PORTMACRO_H */