]> begriffs open source - freertos/blob - portable/BCC/16BitDOS/PC/prtmacro.h
SMP version (#401)
[freertos] / portable / BCC / 16BitDOS / PC / prtmacro.h
1 /*
2  * FreeRTOS Kernel V202110.00
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  * https://www.FreeRTOS.org
23  * https://github.com/FreeRTOS
24  *
25  * 1 tab == 4 spaces!
26  */
27
28 #ifndef PORTMACRO_H
29 #define PORTMACRO_H
30
31 /*-----------------------------------------------------------
32  * Port specific definitions.
33  *
34  * The settings in this file configure FreeRTOS correctly for the
35  * given hardware and compiler.
36  *
37  * These settings should not be altered.
38  *-----------------------------------------------------------
39  */
40
41 /* Type definitions. */
42 #define portCHAR                char
43 #define portFLOAT               long
44 #define portDOUBLE              long
45 #define portLONG                long
46 #define portSHORT               int
47 #define portSTACK_TYPE  uint16_t
48 #define portBASE_TYPE   portSHORT
49
50 typedef portSTACK_TYPE StackType_t;
51 typedef short BaseType_t;
52 typedef unsigned short UBaseType_t;
53
54 #if( configUSE_16_BIT_TICKS == 1 )
55         typedef uint16_t TickType_t;
56         #define portMAX_DELAY ( TickType_t ) 0xffff
57 #else
58         typedef uint32_t TickType_t;
59         #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
60 #endif
61 /*-----------------------------------------------------------*/
62
63 /* Critical section management. */
64 #define portENTER_CRITICAL()                    __asm{ pushf }  \
65                                                                                 __asm{ cli       }      \
66
67 #define portEXIT_CRITICAL()                             __asm{ popf }
68
69 #define portDISABLE_INTERRUPTS()                __asm{ cli }
70
71 #define portENABLE_INTERRUPTS()                 __asm{ sti }
72 /*-----------------------------------------------------------*/
73
74 /* Hardware specifics. */
75 #define portNOP()                               __asm{ nop }
76 #define portSTACK_GROWTH                ( -1 )
77 #define portSWITCH_INT_NUMBER   0x80
78 #define portYIELD()                             __asm{ int portSWITCH_INT_NUMBER }
79 #define portDOS_TICK_RATE               ( 18.20648 )
80 #define portTICK_PERIOD_MS              ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
81 #define portTICKS_PER_DOS_TICK  ( ( uint16_t ) ( ( ( portDOUBLE ) configTICK_RATE_HZ / portDOS_TICK_RATE ) + 0.5 ) )
82 #define portINITIAL_SW                  ( ( portSTACK_TYPE ) 0x0202 )   /* Start the tasks with interrupts enabled. */
83 #define portBYTE_ALIGNMENT              ( 2 )
84 /*-----------------------------------------------------------*/
85
86 /* Compiler specifics. */
87 #define portINPUT_BYTE( xAddr )                         inp( xAddr )
88 #define portOUTPUT_BYTE( xAddr, ucValue )       outp( xAddr, ucValue )
89
90 /*-----------------------------------------------------------*/
91
92 /* Task function macros as described on the FreeRTOS.org WEB site. */
93 #define portTASK_FUNCTION_PROTO( vTaskFunction, pvParameters ) void vTaskFunction( void *pvParameters )
94 #define portTASK_FUNCTION( vTaskFunction, pvParameters ) void vTaskFunction( void *pvParameters )
95
96 #endif /* PORTMACRO_H */
97