]> begriffs open source - cmsis-freertos/blob - Source/portable/GCC/PPC405_Xilinx/portmacro.h
Updated pack to FreeRTOS 10.3.1
[cmsis-freertos] / Source / portable / GCC / PPC405_Xilinx / portmacro.h
1 /*
2  * FreeRTOS Kernel V10.3.1
3  * Copyright (C) 2020 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
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:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
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.
21  *
22  * http://www.FreeRTOS.org
23  * http://aws.amazon.com/freertos
24  *
25  * 1 tab == 4 spaces!
26  */
27
28 #ifndef PORTMACRO_H
29 #define PORTMACRO_H
30
31 #include "xexception_l.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /*-----------------------------------------------------------
38  * Port specific definitions.
39  *
40  * The settings in this file configure FreeRTOS correctly for the
41  * given hardware and compiler.
42  *
43  * These settings should not be altered.
44  *-----------------------------------------------------------
45  */
46
47 /* Type definitions. */
48 #define portCHAR                char
49 #define portFLOAT               float
50 #define portDOUBLE              double
51 #define portLONG                long
52 #define portSHORT               short
53 #define portSTACK_TYPE  uint32_t
54 #define portBASE_TYPE   long
55
56 typedef portSTACK_TYPE StackType_t;
57 typedef long BaseType_t;
58 typedef unsigned long UBaseType_t;
59
60 #if( configUSE_16_BIT_TICKS == 1 )
61         typedef uint16_t TickType_t;
62         #define portMAX_DELAY ( TickType_t ) 0xffff
63 #else
64         typedef uint32_t TickType_t;
65         #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
66 #endif
67 /*-----------------------------------------------------------*/
68
69 /* This port uses the critical nesting count from the TCB rather than
70 maintaining a separate value and then saving this value in the task stack. */
71 #define portCRITICAL_NESTING_IN_TCB             1
72
73 /* Interrupt control macros. */
74 #define portDISABLE_INTERRUPTS()                XExc_mDisableExceptions( XEXC_NON_CRITICAL );
75 #define portENABLE_INTERRUPTS()                 XExc_mEnableExceptions( XEXC_NON_CRITICAL );
76
77 /*-----------------------------------------------------------*/
78
79 /* Critical section macros. */
80 void vTaskEnterCritical( void );
81 void vTaskExitCritical( void );
82 #define portENTER_CRITICAL()                    vTaskEnterCritical()
83 #define portEXIT_CRITICAL()                             vTaskExitCritical()
84
85 /*-----------------------------------------------------------*/
86
87 /* Task utilities. */
88 void vPortYield( void );
89 #define portYIELD() asm volatile ( "SC \n\t NOP" )
90 #define portYIELD_FROM_ISR() vTaskSwitchContext()
91
92 /*-----------------------------------------------------------*/
93
94 /* Hardware specifics. */
95 #define portBYTE_ALIGNMENT                      8
96 #define portSTACK_GROWTH                        ( -1 )
97 #define portTICK_PERIOD_MS                      ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
98 #define portNOP()                                       asm volatile ( "NOP" )
99
100 /* There are 32 * 32bit floating point regieters, plus the FPSCR to save. */
101 #define portNO_FLOP_REGISTERS_TO_SAVE  ( 32 + 1 )
102
103 /*-----------------------------------------------------------*/
104
105 /* Task function macros as described on the FreeRTOS.org WEB site. */
106 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
107 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
108
109 /* Port specific interrupt handling functions. */
110 void vPortSetupInterruptController( void );
111 BaseType_t xPortInstallInterruptHandler( uint8_t ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef );
112
113 #ifdef __cplusplus
114 }
115 #endif
116
117 #endif /* PORTMACRO_H */
118