in OS_TSK, rename run as tsk_run and new as tsk_new.

Committer:
jonathonfletcher
Date:
Sun Sep 02 03:24:20 2012 +0000
Revision:
0:5f46ebd8588e
in OS_TSK, rename run as tsk_run and new as tsk_new.

Who changed what in which revision?

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