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