]> git.sur5r.net Git - freertos/blob - FreeRTOS/Source/portable/ThirdParty/GCC/RISC-V/portmacro.h
Removing unnecessary ThirdParty ports -- Wiced_CY and nrf52840-dk.
[freertos] / FreeRTOS / Source / portable / ThirdParty / GCC / RISC-V / portmacro.h
1 /*\r
2     FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution and was contributed\r
8     to the project by Technolution B.V. (www.technolution.nl,\r
9     freertos-riscv@technolution.eu) under the terms of the FreeRTOS\r
10     contributors license.\r
11 \r
12     FreeRTOS is free software; you can redistribute it and/or modify it under\r
13     the terms of the GNU General Public License (version 2) as published by the\r
14     Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
15 \r
16     ***************************************************************************\r
17     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
18     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
19     >>!   obliged to provide the source code for proprietary components     !<<\r
20     >>!   outside of the FreeRTOS kernel.                                   !<<\r
21     ***************************************************************************\r
22 \r
23     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
24     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
25     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
26     link: http://www.freertos.org/a00114.html\r
27 \r
28     ***************************************************************************\r
29      *                                                                       *\r
30      *    FreeRTOS provides completely free yet professionally developed,    *\r
31      *    robust, strictly quality controlled, supported, and cross          *\r
32      *    platform software that is more than just the market leader, it     *\r
33      *    is the industry's de facto standard.                               *\r
34      *                                                                       *\r
35      *    Help yourself get started quickly while simultaneously helping     *\r
36      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
37      *    tutorial book, reference manual, or both:                          *\r
38      *    http://www.FreeRTOS.org/Documentation                              *\r
39      *                                                                       *\r
40     ***************************************************************************\r
41 \r
42     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
43     the FAQ page "My application does not run, what could be wrong?".  Have you\r
44     defined configASSERT()?\r
45 \r
46     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
47     embedded software for free we request you assist our global community by\r
48     participating in the support forum.\r
49 \r
50     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
51     be as productive as possible as early as possible.  Now you can receive\r
52     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
53     Ltd, and the world's leading authority on the world's leading RTOS.\r
54 \r
55     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
56     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
57     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
58 \r
59     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
60     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
61 \r
62     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
63     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
64     licenses offer ticketed support, indemnification and commercial middleware.\r
65 \r
66     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
67     engineered and independently SIL3 certified version for use in safety and\r
68     mission critical applications that require provable dependability.\r
69 \r
70     1 tab == 4 spaces!\r
71 */\r
72 \r
73 \r
74 #ifndef PORTMACRO_H\r
75 #define PORTMACRO_H\r
76 \r
77 #ifdef __cplusplus\r
78 extern "C" {\r
79 #endif\r
80 \r
81 /*-----------------------------------------------------------\r
82  * Port specific definitions.\r
83  *\r
84  * The settings in this file configure FreeRTOS correctly for the\r
85  * given hardware and compiler.\r
86  *\r
87  * These settings should not be altered.\r
88  *-----------------------------------------------------------\r
89  */\r
90 \r
91 /* Type definitions. */\r
92 #define portCHAR                char\r
93 #define portFLOAT               float\r
94 #define portDOUBLE              double\r
95 #define portLONG                long\r
96 #define portSHORT               short\r
97 #define portBASE_TYPE   long\r
98 \r
99 #ifdef __riscv64\r
100         #define portSTACK_TYPE  uint64_t\r
101         #define portPOINTER_SIZE_TYPE   uint64_t\r
102 #else\r
103         #define portSTACK_TYPE  uint32_t\r
104         #define portPOINTER_SIZE_TYPE   uint32_t\r
105 #endif\r
106 \r
107 typedef portSTACK_TYPE StackType_t;\r
108 typedef long BaseType_t;\r
109 typedef unsigned long UBaseType_t;\r
110 \r
111 #if( configUSE_16_BIT_TICKS == 1 )\r
112         typedef uint16_t TickType_t;\r
113         #define portMAX_DELAY ( TickType_t ) 0xffff\r
114 #else\r
115         typedef uint32_t TickType_t;\r
116         #define portMAX_DELAY ( TickType_t ) 0xffffffffUL\r
117 #endif\r
118 /*-----------------------------------------------------------*/\r
119 \r
120 /* Architecture specifics. */\r
121 #define portSTACK_GROWTH                        ( -1 )\r
122 #define portTICK_PERIOD_MS                      ( ( TickType_t ) (1000 / configTICK_RATE_HZ) )\r
123 #ifdef __riscv64\r
124         #define portBYTE_ALIGNMENT      8\r
125 #else\r
126         #define portBYTE_ALIGNMENT      4\r
127 #endif\r
128 #define portCRITICAL_NESTING_IN_TCB                                     1\r
129 /*-----------------------------------------------------------*/\r
130 \r
131 \r
132 /* Scheduler utilities. */\r
133 extern void vPortYield( void );\r
134 #define portYIELD()                                     vPortYield()\r
135 /*-----------------------------------------------------------*/\r
136 \r
137 \r
138 /* Critical section management. */\r
139 extern int vPortSetInterruptMask( void );\r
140 extern void vPortClearInterruptMask( int );\r
141 \r
142 extern void vPortEnterCritical( void );\r
143 extern void vPortExitCritical( void );\r
144 \r
145 #define portDISABLE_INTERRUPTS()                                __asm volatile  ( "csrc mstatus,8" )\r
146 #define portENABLE_INTERRUPTS()                                 __asm volatile  ( "csrs mstatus,8" )\r
147 \r
148 #define portENTER_CRITICAL()            vPortEnterCritical()\r
149 #define portEXIT_CRITICAL()                     vPortExitCritical()\r
150 \r
151 #define portSET_INTERRUPT_MASK_FROM_ISR()       vPortSetInterruptMask()\r
152 \r
153 #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue )       vPortClearInterruptMask( uxSavedStatusValue )\r
154 \r
155 #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) vPortYield()\r
156 /*-----------------------------------------------------------*/\r
157 \r
158 /* Task function macros as described on the FreeRTOS.org WEB site. */\r
159 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )\r
160 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )\r
161 \r
162 #define portNOP() __asm volatile        ( " nop " )\r
163 \r
164 #ifdef __cplusplus\r
165 }\r
166 #endif\r
167 \r
168 #endif /* PORTMACRO_H */\r
169 \r