my version

Dependents:   aps_so_c2

Fork of mbed-rtos by mbed official

Committer:
feupos
Date:
Sat Nov 18 18:27:08 2017 +0000
Revision:
127:bf4dda6a6a1b
Parent:
80:2dab120a94c2
ok

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 80:2dab120a94c2 1 /*----------------------------------------------------------------------------
mbed_official 80:2dab120a94c2 2 * RL-ARM - RTX
mbed_official 80:2dab120a94c2 3 *----------------------------------------------------------------------------
mbed_official 80:2dab120a94c2 4 * Name: RT_TYPEDEF.H
mbed_official 80:2dab120a94c2 5 * Purpose: Type Definitions
mbed_official 80:2dab120a94c2 6 * Rev.: V4.60
mbed_official 80:2dab120a94c2 7 *----------------------------------------------------------------------------
mbed_official 80:2dab120a94c2 8 *
mbed_official 80:2dab120a94c2 9 * Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH
mbed_official 80:2dab120a94c2 10 * All rights reserved.
mbed_official 80:2dab120a94c2 11 * Redistribution and use in source and binary forms, with or without
mbed_official 80:2dab120a94c2 12 * modification, are permitted provided that the following conditions are met:
mbed_official 80:2dab120a94c2 13 * - Redistributions of source code must retain the above copyright
mbed_official 80:2dab120a94c2 14 * notice, this list of conditions and the following disclaimer.
mbed_official 80:2dab120a94c2 15 * - Redistributions in binary form must reproduce the above copyright
mbed_official 80:2dab120a94c2 16 * notice, this list of conditions and the following disclaimer in the
mbed_official 80:2dab120a94c2 17 * documentation and/or other materials provided with the distribution.
mbed_official 80:2dab120a94c2 18 * - Neither the name of ARM nor the names of its contributors may be used
mbed_official 80:2dab120a94c2 19 * to endorse or promote products derived from this software without
mbed_official 80:2dab120a94c2 20 * specific prior written permission.
mbed_official 80:2dab120a94c2 21 *
mbed_official 80:2dab120a94c2 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 80:2dab120a94c2 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 80:2dab120a94c2 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
mbed_official 80:2dab120a94c2 25 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
mbed_official 80:2dab120a94c2 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
mbed_official 80:2dab120a94c2 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
mbed_official 80:2dab120a94c2 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
mbed_official 80:2dab120a94c2 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
mbed_official 80:2dab120a94c2 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
mbed_official 80:2dab120a94c2 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 80:2dab120a94c2 32 * POSSIBILITY OF SUCH DAMAGE.
mbed_official 80:2dab120a94c2 33 *---------------------------------------------------------------------------*/
mbed_official 80:2dab120a94c2 34 #ifndef RT_TYPE_DEF_H
mbed_official 80:2dab120a94c2 35 #define RT_TYPE_DEF_H
mbed_official 80:2dab120a94c2 36
mbed_official 80:2dab120a94c2 37 #include "os_tcb.h"
mbed_official 80:2dab120a94c2 38
mbed_official 80:2dab120a94c2 39 typedef U32 OS_TID;
mbed_official 80:2dab120a94c2 40 typedef void *OS_ID;
mbed_official 80:2dab120a94c2 41 typedef U32 OS_RESULT;
mbed_official 80:2dab120a94c2 42
mbed_official 80:2dab120a94c2 43 #define TCB_STACKF 32 /* 'stack_frame' offset */
mbed_official 80:2dab120a94c2 44 #define TCB_TSTACK 40 /* 'tsk_stack' offset */
mbed_official 80:2dab120a94c2 45
mbed_official 80:2dab120a94c2 46 typedef struct OS_PSFE { /* Post Service Fifo Entry */
mbed_official 80:2dab120a94c2 47 void *id; /* Object Identification */
mbed_official 80:2dab120a94c2 48 U32 arg; /* Object Argument */
mbed_official 80:2dab120a94c2 49 } *P_PSFE;
mbed_official 80:2dab120a94c2 50
mbed_official 80:2dab120a94c2 51 typedef struct OS_PSQ { /* Post Service Queue */
mbed_official 80:2dab120a94c2 52 U8 first; /* FIFO Head Index */
mbed_official 80:2dab120a94c2 53 U8 last; /* FIFO Tail Index */
mbed_official 80:2dab120a94c2 54 U8 count; /* Number of stored items in FIFO */
mbed_official 80:2dab120a94c2 55 U8 size; /* FIFO Size */
mbed_official 80:2dab120a94c2 56 struct OS_PSFE q[1]; /* FIFO Content */
mbed_official 80:2dab120a94c2 57 } *P_PSQ;
mbed_official 80:2dab120a94c2 58
mbed_official 80:2dab120a94c2 59 typedef struct OS_TSK {
mbed_official 80:2dab120a94c2 60 P_TCB run; /* Current running task */
mbed_official 80:2dab120a94c2 61 P_TCB new_tsk; /* Scheduled task to run */
mbed_official 80:2dab120a94c2 62 } *P_TSK;
mbed_official 80:2dab120a94c2 63
mbed_official 80:2dab120a94c2 64 typedef struct OS_ROBIN { /* Round Robin Control */
mbed_official 80:2dab120a94c2 65 P_TCB task; /* Round Robin task */
mbed_official 80:2dab120a94c2 66 U16 time; /* Round Robin switch time */
mbed_official 80:2dab120a94c2 67 U16 tout; /* Round Robin timeout */
mbed_official 80:2dab120a94c2 68 } *P_ROBIN;
mbed_official 80:2dab120a94c2 69
mbed_official 80:2dab120a94c2 70 typedef struct OS_XCB {
mbed_official 80:2dab120a94c2 71 U8 cb_type; /* Control Block Type */
mbed_official 80:2dab120a94c2 72 struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */
mbed_official 80:2dab120a94c2 73 struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */
mbed_official 80:2dab120a94c2 74 struct OS_TCB *p_dlnk; /* Link pointer for delay list */
mbed_official 80:2dab120a94c2 75 struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */
mbed_official 80:2dab120a94c2 76 U16 delta_time; /* Time until time out */
mbed_official 80:2dab120a94c2 77 } *P_XCB;
mbed_official 80:2dab120a94c2 78
mbed_official 80:2dab120a94c2 79 typedef struct OS_MCB {
mbed_official 80:2dab120a94c2 80 U8 cb_type; /* Control Block Type */
mbed_official 80:2dab120a94c2 81 U8 state; /* State flag variable */
mbed_official 80:2dab120a94c2 82 U8 isr_st; /* State flag variable for isr functions */
mbed_official 80:2dab120a94c2 83 struct OS_TCB *p_lnk; /* Chain of tasks waiting for message */
mbed_official 80:2dab120a94c2 84 U16 first; /* Index of the message list begin */
mbed_official 80:2dab120a94c2 85 U16 last; /* Index of the message list end */
mbed_official 80:2dab120a94c2 86 U16 count; /* Actual number of stored messages */
mbed_official 80:2dab120a94c2 87 U16 size; /* Maximum number of stored messages */
mbed_official 80:2dab120a94c2 88 void *msg[1]; /* FIFO for Message pointers 1st element */
mbed_official 80:2dab120a94c2 89 } *P_MCB;
mbed_official 80:2dab120a94c2 90
mbed_official 80:2dab120a94c2 91 typedef struct OS_SCB {
mbed_official 80:2dab120a94c2 92 U8 cb_type; /* Control Block Type */
mbed_official 80:2dab120a94c2 93 U8 mask; /* Semaphore token mask */
mbed_official 80:2dab120a94c2 94 U16 tokens; /* Semaphore tokens */
mbed_official 80:2dab120a94c2 95 struct OS_TCB *p_lnk; /* Chain of tasks waiting for tokens */
mbed_official 80:2dab120a94c2 96 } *P_SCB;
mbed_official 80:2dab120a94c2 97
mbed_official 80:2dab120a94c2 98 typedef struct OS_MUCB {
mbed_official 80:2dab120a94c2 99 U8 cb_type; /* Control Block Type */
mbed_official 80:2dab120a94c2 100 U8 prio; /* Owner task default priority */
mbed_official 80:2dab120a94c2 101 U16 level; /* Call nesting level */
mbed_official 80:2dab120a94c2 102 struct OS_TCB *p_lnk; /* Chain of tasks waiting for mutex */
mbed_official 80:2dab120a94c2 103 struct OS_TCB *owner; /* Mutex owner task */
mbed_official 80:2dab120a94c2 104 } *P_MUCB;
mbed_official 80:2dab120a94c2 105
mbed_official 80:2dab120a94c2 106 typedef struct OS_XTMR {
mbed_official 80:2dab120a94c2 107 struct OS_TMR *next;
mbed_official 80:2dab120a94c2 108 U16 tcnt;
mbed_official 80:2dab120a94c2 109 } *P_XTMR;
mbed_official 80:2dab120a94c2 110
mbed_official 80:2dab120a94c2 111 typedef struct OS_TMR {
mbed_official 80:2dab120a94c2 112 struct OS_TMR *next; /* Link pointer to Next timer */
mbed_official 80:2dab120a94c2 113 U16 tcnt; /* Timer delay count */
mbed_official 80:2dab120a94c2 114 U16 info; /* User defined call info */
mbed_official 80:2dab120a94c2 115 } *P_TMR;
mbed_official 80:2dab120a94c2 116
mbed_official 80:2dab120a94c2 117 typedef struct OS_BM {
mbed_official 80:2dab120a94c2 118 void *free; /* Pointer to first free memory block */
mbed_official 80:2dab120a94c2 119 void *end; /* Pointer to memory block end */
mbed_official 80:2dab120a94c2 120 U32 blk_size; /* Memory block size */
mbed_official 80:2dab120a94c2 121 } *P_BM;
mbed_official 80:2dab120a94c2 122
mbed_official 80:2dab120a94c2 123 /* Definitions */
mbed_official 80:2dab120a94c2 124 #define __TRUE 1
mbed_official 80:2dab120a94c2 125 #define __FALSE 0
mbed_official 80:2dab120a94c2 126 #define NULL ((void *) 0)
mbed_official 80:2dab120a94c2 127
mbed_official 80:2dab120a94c2 128 #endif