]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/rtos/rtx/TARGET_CORTEX_A/rt_TypeDef.h
1 /*----------------------------------------------------------------------------
3 *----------------------------------------------------------------------------
5 * Purpose: Type Definitions
7 *----------------------------------------------------------------------------
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.
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 *---------------------------------------------------------------------------*/
37 typedef unsigned char U8
;
39 typedef unsigned short U16
;
41 typedef unsigned int U32
;
42 typedef long long S64
;
43 typedef unsigned long long U64
;
44 typedef unsigned char BIT
;
45 typedef unsigned int BOOL
;
46 typedef void (*FUNCP
)(void);
50 typedef U32 OS_RESULT
;
52 typedef struct OS_TCB
{
53 /* General part: identical for all implementations. */
54 U8 cb_type
; /* Control Block Type */
55 U8 state
; /* Task state */
56 U8 prio
; /* Execution priority */
57 U8 task_id
; /* Task ID value for optimized TCB access */
58 struct OS_TCB
*p_lnk
; /* Link pointer for ready/sem. wait list */
59 struct OS_TCB
*p_rlnk
; /* Link pointer for sem./mbx lst backwards */
60 struct OS_TCB
*p_dlnk
; /* Link pointer for delay list */
61 struct OS_TCB
*p_blnk
; /* Link pointer for delay list backwards */
62 U16 delta_time
; /* Time until time out */
63 U16 interval_time
; /* Time interval for periodic waits */
64 U16 events
; /* Event flags */
65 U16 waits
; /* Wait flags */
66 void **msg
; /* Direct message passing when task waits */
68 /* Hardware dependant part: specific for Cortex processor */
69 U8 stack_frame
; /* Stack frame: 0x1 Basic/Extended, 0x2 FP stacked/not stacked */
71 U16 priv_stack
; /* Private stack size, 0= system assigned */
72 U32 tsk_stack
; /* Current task Stack pointer (R13) */
73 U32
*stack
; /* Pointer to Task Stack memory block */
75 /* Task entry point used for uVision debugger */
76 FUNCP ptask
; /* Task entry address */
78 #define TCB_TID 3 /* 'task id' offset */
79 #define TCB_STACKF 32 /* 'stack_frame' offset */
80 #define TCB_TSTACK 36 /* 'tsk_stack' offset */
82 typedef struct OS_PSFE
{ /* Post Service Fifo Entry */
83 void *id
; /* Object Identification */
84 U32 arg
; /* Object Argument */
87 typedef struct OS_PSQ
{ /* Post Service Queue */
88 U8 first
; /* FIFO Head Index */
89 U8 last
; /* FIFO Tail Index */
90 U8 count
; /* Number of stored items in FIFO */
91 U8 size
; /* FIFO Size */
92 struct OS_PSFE q
[1]; /* FIFO Content */
95 typedef struct OS_TSK
{
96 P_TCB run
; /* Current running task */
97 P_TCB
new; /* Scheduled task to run */
100 typedef struct OS_ROBIN
{ /* Round Robin Control */
101 P_TCB task
; /* Round Robin task */
102 U16 time
; /* Round Robin switch time */
103 U16 tout
; /* Round Robin timeout */
106 typedef struct OS_XCB
{
107 U8 cb_type
; /* Control Block Type */
108 struct OS_TCB
*p_lnk
; /* Link pointer for ready/sem. wait list */
109 struct OS_TCB
*p_rlnk
; /* Link pointer for sem./mbx lst backwards */
110 struct OS_TCB
*p_dlnk
; /* Link pointer for delay list */
111 struct OS_TCB
*p_blnk
; /* Link pointer for delay list backwards */
112 U16 delta_time
; /* Time until time out */
115 typedef struct OS_MCB
{
116 U8 cb_type
; /* Control Block Type */
117 U8 state
; /* State flag variable */
118 U8 isr_st
; /* State flag variable for isr functions */
119 struct OS_TCB
*p_lnk
; /* Chain of tasks waiting for message */
120 U16 first
; /* Index of the message list begin */
121 U16 last
; /* Index of the message list end */
122 U16 count
; /* Actual number of stored messages */
123 U16 size
; /* Maximum number of stored messages */
124 void *msg
[1]; /* FIFO for Message pointers 1st element */
127 typedef struct OS_SCB
{
128 U8 cb_type
; /* Control Block Type */
129 U8 mask
; /* Semaphore token mask */
130 U16 tokens
; /* Semaphore tokens */
131 struct OS_TCB
*p_lnk
; /* Chain of tasks waiting for tokens */
134 typedef struct OS_MUCB
{
135 U8 cb_type
; /* Control Block Type */
136 U8 prio
; /* Owner task default priority */
137 U16 level
; /* Call nesting level */
138 struct OS_TCB
*p_lnk
; /* Chain of tasks waiting for mutex */
139 struct OS_TCB
*owner
; /* Mutex owner task */
142 typedef struct OS_XTMR
{
147 typedef struct OS_TMR
{
148 struct OS_TMR
*next
; /* Link pointer to Next timer */
149 U16 tcnt
; /* Timer delay count */
150 U16 info
; /* User defined call info */
153 typedef struct OS_BM
{
154 void *free
; /* Pointer to first free memory block */
155 void *end
; /* Pointer to memory block end */
156 U32 blk_size
; /* Memory block size */
162 #define NULL ((void *) 0)
164 /*----------------------------------------------------------------------------
166 *---------------------------------------------------------------------------*/