]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/rtos/rtx/TARGET_CORTEX_M/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 *---------------------------------------------------------------------------*/
41 typedef U32 OS_RESULT
;
43 #define TCB_STACKF 32 /* 'stack_frame' offset */
44 #define TCB_TSTACK 40 /* 'tsk_stack' offset */
46 typedef struct OS_PSFE
{ /* Post Service Fifo Entry */
47 void *id
; /* Object Identification */
48 U32 arg
; /* Object Argument */
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 */
59 typedef struct OS_TSK
{
60 P_TCB run
; /* Current running task */
61 P_TCB new_tsk
; /* Scheduled task to run */
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 */
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 */
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 */
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 */
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 */
106 typedef struct OS_XTMR
{
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 */
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 */
126 #define NULL ((void *) 0)