forked from MCUSec/para-rehosting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathportmacro.h
77 lines (59 loc) · 2.19 KB
/
portmacro.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef PORTMACRO_H
#define PORTMACRO_H
#include <unistd.h>
#include <stdint.h>
#define portCHAR char
#define portFLOAT float
#define portDOUBLE double
#define portLONG int
#define portSHORT short
#define portSTACK_TYPE unsigned long
#define portBASE_TYPE long
#define portPOINTER_SIZE_TYPE size_t
typedef portSTACK_TYPE StackType_t;
typedef long BaseType_t;
typedef unsigned long UBaseType_t;
#if( configUSE_16_BIT_TICKS == 1 )
typedef uint16_t TickType_t;
#define portMAX_DELAY ( portTickType ) 0xffff
#else
typedef uint32_t TickType_t;
#define portMAX_DELAY ( portTickType ) 0xffffffff
#endif
portBASE_TYPE xPortStartScheduler( void );
void vPortEndScheduler();
void vPortDisableInterrupts( void );
void vPortEnableInterrupts( void );
void vPortEnterCritical( void );
void vPortExitCritical( void );
void vPortAddTaskHandle( void *pxTaskHandle );
void PMCU_FE_Yield();
#define portSTACK_GROWTH ( -1 )
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
#define portTICK_RATE_MICROSECONDS ( ( portTickType ) 1000000 / configTICK_RATE_HZ )
#define portINLINE __inline
#if defined( __x86_64__) || defined( _M_X64 )
#define portBYTE_ALIGNMENT 8
#else
#define portBYTE_ALIGNMENT 4
#endif
#define portREMOVE_STATIC_QUALIFIER
#define portYIELD() PMCU_FE_Yield()
#define portSET_INTERRUPT_MASK() ( vPortDisableInterrupts() )
#define portCLEAR_INTERRUPT_MASK() ( vPortEnableInterrupts() )
#define portDISABLE_INTERRUPTS() ( vPortDisableInterrupts() )
#define portENABLE_INTERRUPTS() ( vPortEnableInterrupts() )
#define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical()
#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
#endif
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
#error We are not supporting configUSE_PORT_OPTIMISED_TASK_SELECTION in the Linux Simulator.
#endif
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
#define portNOP()
#define portOUTPUT_BYTE( a, b )
#define traceTASK_CREATE( pxNewTCB ) vPortAddTaskHandle( pxNewTCB )
#endif