comparison src/gpf2/inc/nuc/os_types.h @ 1:864b8cc0cf63

src/gpf2: preened GPF goo from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:38:58 +0000
parents
children
comparison
equal deleted inserted replaced
0:945cf7f506b2 1:864b8cc0cf63
1 /*
2 +------------------------------------------------------------------------------
3 | File: os_types.h
4 +------------------------------------------------------------------------------
5 | Copyright 2002 Texas Instruments Berlin, AG
6 | All rights reserved.
7 |
8 | This file is confidential and a trade secret of Texas
9 | Instruments Berlin, AG
10 | The receipt of or possession of this file does not convey
11 | any rights to reproduce or disclose its contents or to
12 | manufacture, use, or sell anything it may describe, in
13 | whole, or in part, without the specific written consent of
14 | Texas Instruments Berlin, AG.
15 +-----------------------------------------------------------------------------
16 | Purpose : Definitions for the Nucleus OS adaptation layer
17 +-----------------------------------------------------------------------------
18 */
19
20 #ifndef OS_TYPES_H
21 #define OS_TYPES_H
22
23 /*==== INCLUDES =============================================================*/
24
25 #include "nucleus.h"
26 #include "os.h"
27 #include "glob_defs.h"
28
29 /*==== CONSTANTS ============================================================*/
30
31 /*==== TYPES ================================================================*/
32
33 typedef enum
34 {
35 SYSTEM_TICK_TDMA_FRAME = 1,
36 SYSTEM_TICK_10_MS
37 } T_OS_SYSTEM_TICK;
38
39 /*
40 * Type Definition for Task Management
41 */
42
43 typedef struct
44 {
45 NU_TASK TCB;
46 ULONG magic_nr;
47 OS_HANDLE handle;
48 } OS_NU_TASK;
49
50 typedef struct
51 {
52 char Name[RESOURCE_NAMELEN]; /* name of the protocol stack entity */
53 #ifdef _ESF_SUPPORT_
54 ULONG Value; /* additional parameter */
55 #endif
56 OS_NU_TASK TaskCB; /* control block of the thread */
57 void (*TaskEntry)(OS_HANDLE, ULONG); /* NUCLEUS task entry function */
58 ULONG *Stack; /* start address of stack memory */
59 } T_OS_TASK_TABLE_ENTRY;
60
61 /*
62 * Type Definition for Queue Management
63 */
64
65 typedef struct _T_QDATA_ELEMENT
66 {
67 OS_QDATA Data;
68 struct _T_QDATA_ELEMENT *pNext;
69 } T_QDATA_ELEMENT;
70
71 typedef struct
72 {
73 OS_QDATA **pWrite;
74 OS_QDATA **pRead;
75 OS_QDATA **pStart;
76 } T_QUEUE;
77
78 typedef struct
79 {
80 ULONG opc;
81 ULONG time;
82 void *ptr;
83 USHORT type;
84 } T_QUEUE_MSG;
85
86 typedef struct
87 {
88 char Name [ RESOURCE_NAMELEN ]; /* name of the queue */
89 T_QUEUE Queue [ OS_MAX_PRIORITY ]; /* read/write pointers to ringlist */
90 T_QDATA_ELEMENT *pQueueMemory; /* pointer to queue memory, used for destroy */
91 T_QDATA_ELEMENT *pFreeElement; /* pointer to next free element */
92 USHORT Entries; /* queue entries */
93 USHORT MaxUsed;
94 NU_SEMAPHORE FreeSemCB;
95 NU_SEMAPHORE UsedSemCB;
96 T_QUEUE_MSG current_msg;
97 T_VOID_STRUCT *QueueData;
98 } T_OS_COM_TABLE_ENTRY;
99
100 /*
101 * Type Definition for Timer Management
102 */
103
104 #define TMR_FREE 0
105 #define TMR_USED 1
106 #define TMR_ACTIVE 2
107
108 typedef struct _T_OS_TIMER_TABLE_ENTRY
109 {
110 OS_HANDLE t_handle; /* timer handle */
111 OS_HANDLE task_handle; /* task that started the timer */
112 OS_HANDLE entity_handle; /* entity that started the timer */
113 void (*TimeoutProc)(OS_HANDLE,OS_HANDLE,USHORT); /* timeout function */
114 ULONG r_ticks; /* remaining ticks */
115 ULONG p_ticks; /* periodic expiration ticks */
116 USHORT status; /* timer status */
117 USHORT t_index; /* index of the timer */
118 struct _T_OS_TIMER_TABLE_ENTRY *next;
119 struct _T_OS_TIMER_TABLE_ENTRY *prev;
120 } T_OS_TIMER_TABLE_ENTRY;
121
122 typedef struct
123 {
124 OS_HANDLE next_t_handle; /* handle of the next free table entry */
125 T_OS_TIMER_TABLE_ENTRY entry; /* pointer to timer table entry */
126 } T_OS_TIMER_ENTRY;
127
128 /*
129 * Type Definition for Semaphore Management
130 */
131
132 typedef struct
133 {
134 char Name[ RESOURCE_NAMELEN ]; /* name of the semaphore */
135 NU_SEMAPHORE SemCB; /* control block of the semaphore */
136 } T_OS_SEM_TABLE_ENTRY;
137
138 /*
139 * Type Definition for HISR Management
140 */
141
142 typedef struct
143 {
144 char name[RESOURCE_NAMELEN]; /* name of the protocol stack entity */
145 NU_HISR hisr_cb; /* control block of the HISR */
146 ULONG *stack; /* start address of stack memory */
147 } T_OS_OSISR_TABLE_ENTRY;
148
149 /*
150 * Type Definition for Partition Pool Management
151 */
152 typedef struct _T_OS_PART_POOL
153 {
154 struct _T_OS_PART_POOL * next;
155 unsigned int size;
156 T_VOID_STRUCT * pool_mem;
157 NU_PARTITION_POOL pcb;
158 } T_OS_PART_POOL;
159
160 typedef struct
161 {
162 T_OS_PART_POOL * grp_head;
163 char name[RESOURCE_NAMELEN];
164 } T_OS_PART_GRP_TABLE_ENTRY;
165
166 #ifdef NU_DEBUG
167 typedef struct
168 {
169 char *Start;
170 char *End;
171 } T_OS_POOL_BORDER;
172 #endif
173
174 /*
175 * Type Definition for Dynamic Memory Pool Management
176 */
177 typedef struct
178 {
179 char name[RESOURCE_NAMELEN];
180 NU_MEMORY_POOL * pcb;
181 } T_OS_MEM_POOL_TABLE_ENTRY;
182
183
184 typedef struct
185 {
186 char Name[ RESOURCE_NAMELEN ]; /* name of the event group */
187 NU_EVENT_GROUP EvtGrp; /* control block of the event group */
188 } T_OS_EVTGRP_TABLE_ENTRY;
189
190
191 #endif