Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 1 | /*
|
Paul Bartell | 08dc6f6 | 2021-05-25 21:44:10 -0700 | [diff] [blame] | 2 | * FreeRTOS Kernel <DEVELOPMENT BRANCH>
|
Paul Bartell | adfc533 | 2021-05-25 21:46:15 -0700 | [diff] [blame] | 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
Richard Barry | cfc2688 | 2017-11-29 16:53:26 +0000 | [diff] [blame] | 4 | *
|
Paul Bartell | eec4233 | 2021-06-01 12:01:32 -0700 | [diff] [blame] | 5 | * SPDX-License-Identifier: MIT
|
| 6 | *
|
Richard Barry | cfc2688 | 2017-11-29 16:53:26 +0000 | [diff] [blame] | 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:
|
| 13 | *
|
| 14 | * The above copyright notice and this permission notice shall be included in all
|
Richard Barry | 1365193 | 2017-12-18 22:54:18 +0000 | [diff] [blame] | 15 | * copies or substantial portions of the Software.
|
Richard Barry | cfc2688 | 2017-11-29 16:53:26 +0000 | [diff] [blame] | 16 | *
|
| 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.
|
| 23 | *
|
alfred gedeon | 0b0a206 | 2020-08-20 14:59:28 -0700 | [diff] [blame] | 24 | * https://www.FreeRTOS.org
|
| 25 | * https://github.com/FreeRTOS
|
Richard Barry | cfc2688 | 2017-11-29 16:53:26 +0000 | [diff] [blame] | 26 | *
|
Richard Barry | cfc2688 | 2017-11-29 16:53:26 +0000 | [diff] [blame] | 27 | */
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 28 |
|
| 29 | #ifndef PORTMACRO_H
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 30 | #define PORTMACRO_H
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 31 |
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 32 | #ifdef __cplusplus
|
| 33 | extern "C" {
|
| 34 | #endif
|
Richard Barry | 620d399 | 2007-11-05 16:44:39 +0000 | [diff] [blame] | 35 |
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 36 | /*-----------------------------------------------------------
|
Richard Barry | 3e20aa7 | 2013-12-29 14:06:04 +0000 | [diff] [blame] | 37 | * Port specific definitions.
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 38 | *
|
| 39 | * The settings in this file configure FreeRTOS correctly for the
|
| 40 | * given hardware and compiler.
|
| 41 | *
|
| 42 | * These settings should not be altered.
|
| 43 | *-----------------------------------------------------------
|
| 44 | */
|
| 45 |
|
| 46 | /* Type definitions. */
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 47 | #define portCHAR char
|
| 48 | #define portFLOAT float
|
| 49 | #define portDOUBLE double
|
| 50 | #define portLONG long
|
| 51 | #define portSHORT short
|
| 52 | #define portSTACK_TYPE uint32_t
|
| 53 | #define portBASE_TYPE long
|
Richard Barry | 3e20aa7 | 2013-12-29 14:06:04 +0000 | [diff] [blame] | 54 |
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 55 | typedef portSTACK_TYPE StackType_t;
|
| 56 | typedef long BaseType_t;
|
| 57 | typedef unsigned long UBaseType_t;
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 58 |
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 59 | #if( configUSE_16_BIT_TICKS == 1 )
|
| 60 | typedef uint16_t TickType_t;
|
| 61 | #define portMAX_DELAY ( TickType_t ) 0xffff
|
| 62 | #else
|
| 63 | typedef uint32_t TickType_t;
|
| 64 | #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
|
Richard Barry | f407b70 | 2014-12-18 11:02:15 +0000 | [diff] [blame] | 65 |
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 66 | /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
|
| 67 | not need to be guarded with a critical section. */
|
| 68 | #define portTICK_TYPE_IS_ATOMIC 1
|
| 69 | #endif
|
Richard Barry | 3e20aa7 | 2013-12-29 14:06:04 +0000 | [diff] [blame] | 70 | /*-----------------------------------------------------------*/
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 71 |
|
| 72 | /* Interrupt control macros. */
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 73 | void microblaze_disable_interrupts( void );
|
| 74 | void microblaze_enable_interrupts( void );
|
| 75 | #define portDISABLE_INTERRUPTS() microblaze_disable_interrupts()
|
| 76 | #define portENABLE_INTERRUPTS() microblaze_enable_interrupts()
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 77 | /*-----------------------------------------------------------*/
|
| 78 |
|
| 79 | /* Critical section macros. */
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 80 | void vPortEnterCritical( void );
|
| 81 | void vPortExitCritical( void );
|
| 82 | #define portENTER_CRITICAL() { \
|
| 83 | extern UBaseType_t uxCriticalNesting; \
|
| 84 | microblaze_disable_interrupts(); \
|
| 85 | uxCriticalNesting++; \
|
| 86 | }
|
Richard Barry | 3e20aa7 | 2013-12-29 14:06:04 +0000 | [diff] [blame] | 87 |
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 88 | #define portEXIT_CRITICAL() { \
|
| 89 | extern UBaseType_t uxCriticalNesting; \
|
| 90 | /* Interrupts are disabled, so we can */ \
|
| 91 | /* access the variable directly. */ \
|
| 92 | uxCriticalNesting--; \
|
| 93 | if( uxCriticalNesting == 0 ) \
|
| 94 | { \
|
| 95 | /* The nesting has unwound and we \
|
| 96 | can enable interrupts again. */ \
|
| 97 | portENABLE_INTERRUPTS(); \
|
| 98 | } \
|
| 99 | }
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 100 |
|
| 101 | /*-----------------------------------------------------------*/
|
| 102 |
|
| 103 | /* Task utilities. */
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 104 | void vPortYield( void );
|
| 105 | #define portYIELD() vPortYield()
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 106 |
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 107 | void vTaskSwitchContext();
|
| 108 | #define portYIELD_FROM_ISR() vTaskSwitchContext()
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 109 | /*-----------------------------------------------------------*/
|
| 110 |
|
| 111 | /* Hardware specifics. */
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 112 | #define portBYTE_ALIGNMENT 4
|
| 113 | #define portSTACK_GROWTH ( -1 )
|
| 114 | #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
| 115 | #define portNOP() asm volatile ( "NOP" )
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 116 | /*-----------------------------------------------------------*/
|
| 117 |
|
| 118 | /* Task function macros as described on the FreeRTOS.org WEB site. */
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 119 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
|
| 120 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 121 |
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 122 | #ifdef __cplusplus
|
| 123 | }
|
| 124 | #endif
|
Richard Barry | 620d399 | 2007-11-05 16:44:39 +0000 | [diff] [blame] | 125 |
|
Richard Barry | b6df57c | 2006-05-02 09:39:15 +0000 | [diff] [blame] | 126 | #endif /* PORTMACRO_H */
|
alfred gedeon | 86653e2 | 2020-08-17 10:51:02 -0700 | [diff] [blame] | 127 |
|