2 * FreeRTOS Kernel <DEVELOPMENT BRANCH>
3 * license and copyright intentionally withheld to promote copying into user code.
9 /*-----------------------------------------------------------
10 * Port specific definitions.
12 * The settings in this file configure FreeRTOS correctly for the
13 * given hardware and compiler.
15 * These settings should not be altered.
16 *-----------------------------------------------------------
19 /* Type definitions. */
21 #define portFLOAT float
22 #define portDOUBLE double
25 #define portSTACK_TYPE uint8_t
26 #define portBASE_TYPE char
28 #define portSTACK_GROWTH ( -1 )
29 #define portBYTE_ALIGNMENT 4
30 #define portPOINTER_SIZE_TYPE size_t
31 typedef portSTACK_TYPE StackType_t;
32 typedef signed char BaseType_t;
33 typedef unsigned char UBaseType_t;
35 #if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
36 typedef uint16_t TickType_t;
37 #define portMAX_DELAY ( TickType_t ) 0xffffU
38 #elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
39 typedef uint32_t TickType_t;
40 #define portMAX_DELAY ( TickType_t ) 0xffffffffU
41 #elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
42 typedef uint64_t TickType_t;
43 #define portMAX_DELAY ( TickType_t ) 0xffffffffffffffffU
45 #error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
48 /* Architecture specific optimisations. */
49 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
50 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
53 #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
55 /* Check the configuration. */
56 #if ( configMAX_PRIORITIES > 32 )
57 #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
60 /* Store/clear the ready priorities in a bit map. */
61 #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
62 #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
64 /*-----------------------------------------------------------*/
66 #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) \
71 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
73 /* Disable the interrupts */
74 #define portDISABLE_INTERRUPTS() do {} while( 0 )
76 /* Enable the interrupts */
77 #define portENABLE_INTERRUPTS() do {} while( 0 )
79 #if ( configNUMBER_OF_CORES == 1 )
80 /* preserve current interrupt state and then disable interrupts */
81 #define portENTER_CRITICAL() do {} while( 0 )
83 /* restore previously preserved interrupt state */
84 #define portEXIT_CRITICAL() do {} while( 0 )
87 /* The port can maintain the critical nesting count in TCB or maintain the critical
88 * nesting count in the port. */
89 #define portCRITICAL_NESTING_IN_TCB 1
91 /* vTaskEnterCritical and vTaskExitCritical should be used in the implementation
92 * of portENTER/EXIT_CRITICAL if the number of cores is more than 1 in the system. */
93 #define portENTER_CRITICAL vTaskEnterCritical
94 #define portEXIT_CRITICAL vTaskExitCritical
96 /* vTaskEnterCriticalFromISR and vTaskExitCriticalFromISR should be used in the
97 * implementation of portENTER/EXIT_CRITICAL_FROM_ISR if the number of cores is
98 * more than 1 in the system. */
99 #define portENTER_CRITICAL_FROM_ISR vTaskEnterCriticalFromISR
100 #define portEXIT_CRITICAL_FROM_ISR vTaskExitCriticalFromISR
102 #endif /* if ( configNUMBER_OF_CORES == 1 ) */
104 extern void vPortYield( void );
105 #define portYIELD() vPortYield()
107 /* Task function macros as described on the FreeRTOS.org WEB site. */
108 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters ) __attribute__( ( noreturn ) )
109 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
111 #if ( configNUMBER_OF_CORES > 1 )
112 /* Return the core ID on which the code is running. */
113 #define portGET_CORE_ID() 0
115 /* Set the interrupt mask. */
116 #define portSET_INTERRUPT_MASK() 0
118 /* Clear the interrupt mask. */
119 #define portCLEAR_INTERRUPT_MASK( x ) ( ( void ) ( x ) )
121 /* Request the core ID x to yield. */
122 #define portYIELD_CORE( x ) do {} while( 0 )
124 /* Acquire the TASK lock. TASK lock is a recursive lock.
125 * It should be able to be locked by the same core multiple times. */
126 #define portGET_TASK_LOCK( xCoreID ) do {} while( 0 )
128 /* Release the TASK lock. If a TASK lock is locked by the same core multiple times,
129 * it should be released as many times as it is locked. */
130 #define portRELEASE_TASK_LOCK( xCoreID ) do {} while( 0 )
132 /* Acquire the ISR lock. ISR lock is a recursive lock.
133 * It should be able to be locked by the same core multiple times. */
134 #define portGET_ISR_LOCK( xCoreID ) do {} while( 0 )
136 /* Release the ISR lock. If a ISR lock is locked by the same core multiple times, \
137 * it should be released as many times as it is locked. */
138 #define portRELEASE_ISR_LOCK( xCoreID ) do {} while( 0 )
140 #endif /* if ( configNUMBER_OF_CORES > 1 ) */
142 #endif /* PORTMACRO_H */