Luca
Fork of mbed-rtos by
rtx/TARGET_CORTEX_A/rt_TypeDef.h@123:58563e6cba1e, 2016-11-14 (annotated)
- Committer:
- c1728p9
- Date:
- Mon Nov 14 17:14:42 2016 -0600
- Revision:
- 123:58563e6cba1e
- Parent:
- 103:5a85840ab54e
Configure RTOS to behave as it did before 5.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 48:e9a2c7cb57a4 | 1 | /*---------------------------------------------------------------------------- |
mbed_official | 48:e9a2c7cb57a4 | 2 | * RL-ARM - RTX |
mbed_official | 48:e9a2c7cb57a4 | 3 | *---------------------------------------------------------------------------- |
mbed_official | 48:e9a2c7cb57a4 | 4 | * Name: RT_TYPEDEF.H |
mbed_official | 48:e9a2c7cb57a4 | 5 | * Purpose: Type Definitions |
mbed_official | 92:bc9729798a19 | 6 | * Rev.: V4.73 (plus large stack) |
mbed_official | 48:e9a2c7cb57a4 | 7 | *---------------------------------------------------------------------------- |
mbed_official | 48:e9a2c7cb57a4 | 8 | * |
mbed_official | 92:bc9729798a19 | 9 | * Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH |
mbed_official | 48:e9a2c7cb57a4 | 10 | * All rights reserved. |
mbed_official | 48:e9a2c7cb57a4 | 11 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 48:e9a2c7cb57a4 | 12 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 48:e9a2c7cb57a4 | 13 | * - Redistributions of source code must retain the above copyright |
mbed_official | 48:e9a2c7cb57a4 | 14 | * notice, this list of conditions and the following disclaimer. |
mbed_official | 48:e9a2c7cb57a4 | 15 | * - Redistributions in binary form must reproduce the above copyright |
mbed_official | 48:e9a2c7cb57a4 | 16 | * notice, this list of conditions and the following disclaimer in the |
mbed_official | 48:e9a2c7cb57a4 | 17 | * documentation and/or other materials provided with the distribution. |
mbed_official | 68:d3d0e710b443 | 18 | * - Neither the name of ARM nor the names of its contributors may be used |
mbed_official | 68:d3d0e710b443 | 19 | * to endorse or promote products derived from this software without |
mbed_official | 48:e9a2c7cb57a4 | 20 | * specific prior written permission. |
mbed_official | 48:e9a2c7cb57a4 | 21 | * |
mbed_official | 68:d3d0e710b443 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 68:d3d0e710b443 | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 48:e9a2c7cb57a4 | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
mbed_official | 48:e9a2c7cb57a4 | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE |
mbed_official | 48:e9a2c7cb57a4 | 26 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
mbed_official | 68:d3d0e710b443 | 27 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
mbed_official | 68:d3d0e710b443 | 28 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
mbed_official | 68:d3d0e710b443 | 29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
mbed_official | 68:d3d0e710b443 | 30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
mbed_official | 48:e9a2c7cb57a4 | 31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
mbed_official | 48:e9a2c7cb57a4 | 32 | * POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 48:e9a2c7cb57a4 | 33 | *---------------------------------------------------------------------------*/ |
mbed_official | 48:e9a2c7cb57a4 | 34 | |
mbed_official | 48:e9a2c7cb57a4 | 35 | /* Types */ |
mbed_official | 48:e9a2c7cb57a4 | 36 | typedef char S8; |
mbed_official | 48:e9a2c7cb57a4 | 37 | typedef unsigned char U8; |
mbed_official | 48:e9a2c7cb57a4 | 38 | typedef short S16; |
mbed_official | 48:e9a2c7cb57a4 | 39 | typedef unsigned short U16; |
mbed_official | 48:e9a2c7cb57a4 | 40 | typedef int S32; |
mbed_official | 48:e9a2c7cb57a4 | 41 | typedef unsigned int U32; |
mbed_official | 48:e9a2c7cb57a4 | 42 | typedef long long S64; |
mbed_official | 48:e9a2c7cb57a4 | 43 | typedef unsigned long long U64; |
mbed_official | 48:e9a2c7cb57a4 | 44 | typedef unsigned char BIT; |
mbed_official | 48:e9a2c7cb57a4 | 45 | typedef unsigned int BOOL; |
mbed_official | 48:e9a2c7cb57a4 | 46 | typedef void (*FUNCP)(void); |
mbed_official | 48:e9a2c7cb57a4 | 47 | |
mbed_official | 48:e9a2c7cb57a4 | 48 | typedef U32 OS_TID; |
mbed_official | 48:e9a2c7cb57a4 | 49 | typedef void *OS_ID; |
mbed_official | 48:e9a2c7cb57a4 | 50 | typedef U32 OS_RESULT; |
mbed_official | 48:e9a2c7cb57a4 | 51 | |
mbed_official | 48:e9a2c7cb57a4 | 52 | typedef struct OS_TCB { |
mbed_official | 48:e9a2c7cb57a4 | 53 | /* General part: identical for all implementations. */ |
mbed_official | 48:e9a2c7cb57a4 | 54 | U8 cb_type; /* Control Block Type */ |
mbed_official | 48:e9a2c7cb57a4 | 55 | U8 state; /* Task state */ |
mbed_official | 48:e9a2c7cb57a4 | 56 | U8 prio; /* Execution priority */ |
mbed_official | 48:e9a2c7cb57a4 | 57 | U8 task_id; /* Task ID value for optimized TCB access */ |
mbed_official | 48:e9a2c7cb57a4 | 58 | struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */ |
mbed_official | 48:e9a2c7cb57a4 | 59 | struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */ |
mbed_official | 48:e9a2c7cb57a4 | 60 | struct OS_TCB *p_dlnk; /* Link pointer for delay list */ |
mbed_official | 48:e9a2c7cb57a4 | 61 | struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */ |
mbed_official | 48:e9a2c7cb57a4 | 62 | U16 delta_time; /* Time until time out */ |
mbed_official | 48:e9a2c7cb57a4 | 63 | U16 interval_time; /* Time interval for periodic waits */ |
mbed_official | 48:e9a2c7cb57a4 | 64 | U16 events; /* Event flags */ |
mbed_official | 48:e9a2c7cb57a4 | 65 | U16 waits; /* Wait flags */ |
mbed_official | 48:e9a2c7cb57a4 | 66 | void **msg; /* Direct message passing when task waits */ |
mbed_official | 92:bc9729798a19 | 67 | struct OS_MUCB *p_mlnk; /* Link pointer for mutex owner list */ |
mbed_official | 92:bc9729798a19 | 68 | U8 prio_base; /* Base priority */ |
mbed_official | 48:e9a2c7cb57a4 | 69 | |
mbed_official | 48:e9a2c7cb57a4 | 70 | /* Hardware dependant part: specific for Cortex processor */ |
mbed_official | 92:bc9729798a19 | 71 | U8 stack_frame; /* Stack frame: 0x0 Basic, 0x1 Extended, 0x2 VFP/D16 stacked, 0x4 NEON/D32 stacked */ |
mbed_official | 103:5a85840ab54e | 72 | #if defined (__ICCARM__) |
mbed_official | 103:5a85840ab54e | 73 | #ifndef __LARGE_PRIV_STACK |
mbed_official | 103:5a85840ab54e | 74 | U16 priv_stack; /* Private stack size, 0= system assigned */ |
mbed_official | 103:5a85840ab54e | 75 | #else |
mbed_official | 92:bc9729798a19 | 76 | U16 reserved; /* Reserved (padding) */ |
mbed_official | 92:bc9729798a19 | 77 | U32 priv_stack; /* Private stack size for LARGE_STACK, 0= system assigned */ |
mbed_official | 103:5a85840ab54e | 78 | #endif /* __LARGE_PRIV_STACK */ |
mbed_official | 103:5a85840ab54e | 79 | #else |
mbed_official | 103:5a85840ab54e | 80 | U16 reserved; /* Reserved (padding) */ |
mbed_official | 103:5a85840ab54e | 81 | U32 priv_stack; /* Private stack size for LARGE_STACK, 0= system assigned */ |
mbed_official | 103:5a85840ab54e | 82 | #endif |
mbed_official | 48:e9a2c7cb57a4 | 83 | U32 tsk_stack; /* Current task Stack pointer (R13) */ |
mbed_official | 48:e9a2c7cb57a4 | 84 | U32 *stack; /* Pointer to Task Stack memory block */ |
mbed_official | 48:e9a2c7cb57a4 | 85 | |
mbed_official | 48:e9a2c7cb57a4 | 86 | /* Task entry point used for uVision debugger */ |
mbed_official | 48:e9a2c7cb57a4 | 87 | FUNCP ptask; /* Task entry address */ |
c1728p9 | 123:58563e6cba1e | 88 | void *argv; /* Task argument */ |
mbed_official | 48:e9a2c7cb57a4 | 89 | } *P_TCB; |
mbed_official | 48:e9a2c7cb57a4 | 90 | #define TCB_TID 3 /* 'task id' offset */ |
mbed_official | 92:bc9729798a19 | 91 | #define TCB_STACKF 37 /* 'stack_frame' offset */ |
mbed_official | 103:5a85840ab54e | 92 | #if defined (__ICCARM__) |
mbed_official | 103:5a85840ab54e | 93 | #ifndef __LARGE_PRIV_STACK |
mbed_official | 103:5a85840ab54e | 94 | #define TCB_TSTACK 40 /* 'tsk_stack' offset */ |
mbed_official | 103:5a85840ab54e | 95 | #else |
mbed_official | 92:bc9729798a19 | 96 | #define TCB_TSTACK 44 /* 'tsk_stack' offset for LARGE_STACK */ |
mbed_official | 103:5a85840ab54e | 97 | #endif /* __LARGE_PRIV_STACK */ |
mbed_official | 103:5a85840ab54e | 98 | #else |
mbed_official | 103:5a85840ab54e | 99 | #define TCB_TSTACK 44 /* 'tsk_stack' offset for LARGE_STACK */ |
mbed_official | 103:5a85840ab54e | 100 | #endif |
mbed_official | 48:e9a2c7cb57a4 | 101 | |
mbed_official | 48:e9a2c7cb57a4 | 102 | typedef struct OS_PSFE { /* Post Service Fifo Entry */ |
mbed_official | 48:e9a2c7cb57a4 | 103 | void *id; /* Object Identification */ |
mbed_official | 48:e9a2c7cb57a4 | 104 | U32 arg; /* Object Argument */ |
mbed_official | 48:e9a2c7cb57a4 | 105 | } *P_PSFE; |
mbed_official | 48:e9a2c7cb57a4 | 106 | |
mbed_official | 48:e9a2c7cb57a4 | 107 | typedef struct OS_PSQ { /* Post Service Queue */ |
mbed_official | 48:e9a2c7cb57a4 | 108 | U8 first; /* FIFO Head Index */ |
mbed_official | 48:e9a2c7cb57a4 | 109 | U8 last; /* FIFO Tail Index */ |
mbed_official | 48:e9a2c7cb57a4 | 110 | U8 count; /* Number of stored items in FIFO */ |
mbed_official | 48:e9a2c7cb57a4 | 111 | U8 size; /* FIFO Size */ |
mbed_official | 48:e9a2c7cb57a4 | 112 | struct OS_PSFE q[1]; /* FIFO Content */ |
mbed_official | 48:e9a2c7cb57a4 | 113 | } *P_PSQ; |
mbed_official | 48:e9a2c7cb57a4 | 114 | |
mbed_official | 48:e9a2c7cb57a4 | 115 | typedef struct OS_TSK { |
mbed_official | 48:e9a2c7cb57a4 | 116 | P_TCB run; /* Current running task */ |
mbed_official | 92:bc9729798a19 | 117 | P_TCB new_tsk; /* Scheduled task to run */ |
mbed_official | 48:e9a2c7cb57a4 | 118 | } *P_TSK; |
mbed_official | 48:e9a2c7cb57a4 | 119 | |
mbed_official | 48:e9a2c7cb57a4 | 120 | typedef struct OS_ROBIN { /* Round Robin Control */ |
mbed_official | 48:e9a2c7cb57a4 | 121 | P_TCB task; /* Round Robin task */ |
mbed_official | 48:e9a2c7cb57a4 | 122 | U16 time; /* Round Robin switch time */ |
mbed_official | 48:e9a2c7cb57a4 | 123 | U16 tout; /* Round Robin timeout */ |
mbed_official | 48:e9a2c7cb57a4 | 124 | } *P_ROBIN; |
mbed_official | 48:e9a2c7cb57a4 | 125 | |
mbed_official | 48:e9a2c7cb57a4 | 126 | typedef struct OS_XCB { |
mbed_official | 48:e9a2c7cb57a4 | 127 | U8 cb_type; /* Control Block Type */ |
mbed_official | 48:e9a2c7cb57a4 | 128 | struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */ |
mbed_official | 48:e9a2c7cb57a4 | 129 | struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */ |
mbed_official | 48:e9a2c7cb57a4 | 130 | struct OS_TCB *p_dlnk; /* Link pointer for delay list */ |
mbed_official | 48:e9a2c7cb57a4 | 131 | struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */ |
mbed_official | 48:e9a2c7cb57a4 | 132 | U16 delta_time; /* Time until time out */ |
mbed_official | 48:e9a2c7cb57a4 | 133 | } *P_XCB; |
mbed_official | 48:e9a2c7cb57a4 | 134 | |
mbed_official | 48:e9a2c7cb57a4 | 135 | typedef struct OS_MCB { |
mbed_official | 48:e9a2c7cb57a4 | 136 | U8 cb_type; /* Control Block Type */ |
mbed_official | 48:e9a2c7cb57a4 | 137 | U8 state; /* State flag variable */ |
mbed_official | 48:e9a2c7cb57a4 | 138 | U8 isr_st; /* State flag variable for isr functions */ |
mbed_official | 48:e9a2c7cb57a4 | 139 | struct OS_TCB *p_lnk; /* Chain of tasks waiting for message */ |
mbed_official | 48:e9a2c7cb57a4 | 140 | U16 first; /* Index of the message list begin */ |
mbed_official | 48:e9a2c7cb57a4 | 141 | U16 last; /* Index of the message list end */ |
mbed_official | 48:e9a2c7cb57a4 | 142 | U16 count; /* Actual number of stored messages */ |
mbed_official | 48:e9a2c7cb57a4 | 143 | U16 size; /* Maximum number of stored messages */ |
mbed_official | 48:e9a2c7cb57a4 | 144 | void *msg[1]; /* FIFO for Message pointers 1st element */ |
mbed_official | 48:e9a2c7cb57a4 | 145 | } *P_MCB; |
mbed_official | 48:e9a2c7cb57a4 | 146 | |
mbed_official | 48:e9a2c7cb57a4 | 147 | typedef struct OS_SCB { |
mbed_official | 48:e9a2c7cb57a4 | 148 | U8 cb_type; /* Control Block Type */ |
mbed_official | 48:e9a2c7cb57a4 | 149 | U8 mask; /* Semaphore token mask */ |
mbed_official | 48:e9a2c7cb57a4 | 150 | U16 tokens; /* Semaphore tokens */ |
mbed_official | 48:e9a2c7cb57a4 | 151 | struct OS_TCB *p_lnk; /* Chain of tasks waiting for tokens */ |
mbed_official | 48:e9a2c7cb57a4 | 152 | } *P_SCB; |
mbed_official | 48:e9a2c7cb57a4 | 153 | |
mbed_official | 48:e9a2c7cb57a4 | 154 | typedef struct OS_MUCB { |
mbed_official | 48:e9a2c7cb57a4 | 155 | U8 cb_type; /* Control Block Type */ |
mbed_official | 48:e9a2c7cb57a4 | 156 | U16 level; /* Call nesting level */ |
mbed_official | 48:e9a2c7cb57a4 | 157 | struct OS_TCB *p_lnk; /* Chain of tasks waiting for mutex */ |
mbed_official | 48:e9a2c7cb57a4 | 158 | struct OS_TCB *owner; /* Mutex owner task */ |
mbed_official | 92:bc9729798a19 | 159 | struct OS_MUCB *p_mlnk; /* Chain of mutexes by owner task */ |
mbed_official | 48:e9a2c7cb57a4 | 160 | } *P_MUCB; |
mbed_official | 48:e9a2c7cb57a4 | 161 | |
mbed_official | 48:e9a2c7cb57a4 | 162 | typedef struct OS_XTMR { |
mbed_official | 48:e9a2c7cb57a4 | 163 | struct OS_TMR *next; |
mbed_official | 48:e9a2c7cb57a4 | 164 | U16 tcnt; |
mbed_official | 48:e9a2c7cb57a4 | 165 | } *P_XTMR; |
mbed_official | 48:e9a2c7cb57a4 | 166 | |
mbed_official | 48:e9a2c7cb57a4 | 167 | typedef struct OS_TMR { |
mbed_official | 48:e9a2c7cb57a4 | 168 | struct OS_TMR *next; /* Link pointer to Next timer */ |
mbed_official | 48:e9a2c7cb57a4 | 169 | U16 tcnt; /* Timer delay count */ |
mbed_official | 48:e9a2c7cb57a4 | 170 | U16 info; /* User defined call info */ |
mbed_official | 48:e9a2c7cb57a4 | 171 | } *P_TMR; |
mbed_official | 48:e9a2c7cb57a4 | 172 | |
mbed_official | 48:e9a2c7cb57a4 | 173 | typedef struct OS_BM { |
mbed_official | 48:e9a2c7cb57a4 | 174 | void *free; /* Pointer to first free memory block */ |
mbed_official | 48:e9a2c7cb57a4 | 175 | void *end; /* Pointer to memory block end */ |
mbed_official | 48:e9a2c7cb57a4 | 176 | U32 blk_size; /* Memory block size */ |
mbed_official | 48:e9a2c7cb57a4 | 177 | } *P_BM; |
mbed_official | 48:e9a2c7cb57a4 | 178 | |
mbed_official | 48:e9a2c7cb57a4 | 179 | /* Definitions */ |
mbed_official | 48:e9a2c7cb57a4 | 180 | #define __TRUE 1 |
mbed_official | 48:e9a2c7cb57a4 | 181 | #define __FALSE 0 |
mbed_official | 48:e9a2c7cb57a4 | 182 | #define NULL ((void *) 0) |
mbed_official | 48:e9a2c7cb57a4 | 183 | |
mbed_official | 48:e9a2c7cb57a4 | 184 | /*---------------------------------------------------------------------------- |
mbed_official | 48:e9a2c7cb57a4 | 185 | * end of file |
mbed_official | 48:e9a2c7cb57a4 | 186 | *---------------------------------------------------------------------------*/ |
mbed_official | 48:e9a2c7cb57a4 | 187 |