comparison gpf/inc/os_types.h @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
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 "gpfconf.h"
26 #include "../../nucleus/nucleus.h"
27 #include "os.h"
28 #include "glob_defs.h"
29
30 /*==== CONSTANTS ============================================================*/
31
32 /*==== TYPES ================================================================*/
33
34 typedef enum
35 {
36 SYSTEM_TICK_TDMA_FRAME = 1,
37 SYSTEM_TICK_10_MS
38 } T_OS_SYSTEM_TICK;
39
40 /*
41 * Type Definition for Task Management
42 */
43
44 typedef struct
45 {
46 NU_TASK TCB;
47 ULONG magic_nr;
48 OS_HANDLE handle;
49 } OS_NU_TASK;
50
51 typedef struct
52 {
53 char Name[RESOURCE_NAMELEN]; /* name of the protocol stack entity */
54 #ifdef _ESF_SUPPORT_
55 ULONG Value; /* additional parameter */
56 #endif
57 OS_NU_TASK TaskCB; /* control block of the thread */
58 void (*TaskEntry)(OS_HANDLE, ULONG); /* NUCLEUS task entry function */
59 ULONG *Stack; /* start address of stack memory */
60 } T_OS_TASK_TABLE_ENTRY;
61
62 /*
63 * Type Definition for Queue Management
64 */
65
66 typedef struct _T_QDATA_ELEMENT
67 {
68 OS_QDATA Data;
69 struct _T_QDATA_ELEMENT *pNext;
70 } T_QDATA_ELEMENT;
71
72 typedef struct
73 {
74 OS_QDATA **pWrite;
75 OS_QDATA **pRead;
76 OS_QDATA **pStart;
77 } T_QUEUE;
78
79 typedef struct
80 {
81 ULONG opc;
82 ULONG time;
83 void *ptr;
84 USHORT type;
85 } T_QUEUE_MSG;
86
87 typedef struct
88 {
89 char Name [ RESOURCE_NAMELEN ]; /* name of the queue */
90 T_QUEUE Queue [ OS_MAX_PRIORITY ]; /* read/write pointers to ringlist */
91 T_QDATA_ELEMENT *pQueueMemory; /* pointer to queue memory, used for destroy */
92 T_QDATA_ELEMENT *pFreeElement; /* pointer to next free element */
93 USHORT Entries; /* queue entries */
94 USHORT MaxUsed;
95 NU_SEMAPHORE FreeSemCB;
96 NU_SEMAPHORE UsedSemCB;
97 T_QUEUE_MSG current_msg;
98 T_VOID_STRUCT *QueueData;
99 } T_OS_COM_TABLE_ENTRY;
100
101 /*
102 * Type Definition for Timer Management
103 */
104
105 #define TMR_FREE 0
106 #define TMR_USED 1
107 #define TMR_ACTIVE 2
108
109 typedef struct _T_OS_TIMER_TABLE_ENTRY
110 {
111 OS_HANDLE t_handle; /* timer handle */
112 OS_HANDLE task_handle; /* task that started the timer */
113 OS_HANDLE entity_handle; /* entity that started the timer */
114 void (*TimeoutProc)(OS_HANDLE,OS_HANDLE,USHORT); /* timeout function */
115 ULONG r_ticks; /* remaining ticks */
116 ULONG p_ticks; /* periodic expiration ticks */
117 USHORT status; /* timer status */
118 USHORT t_index; /* index of the timer */
119 struct _T_OS_TIMER_TABLE_ENTRY *next;
120 struct _T_OS_TIMER_TABLE_ENTRY *prev;
121 } T_OS_TIMER_TABLE_ENTRY;
122
123 typedef struct
124 {
125 OS_HANDLE next_t_handle; /* handle of the next free table entry */
126 T_OS_TIMER_TABLE_ENTRY entry; /* pointer to timer table entry */
127 } T_OS_TIMER_ENTRY;
128
129 /*
130 * Type Definition for Semaphore Management
131 */
132
133 typedef struct
134 {
135 char Name[ RESOURCE_NAMELEN ]; /* name of the semaphore */
136 NU_SEMAPHORE SemCB; /* control block of the semaphore */
137 } T_OS_SEM_TABLE_ENTRY;
138
139 /*
140 * Type Definition for HISR Management
141 */
142
143 typedef struct
144 {
145 char name[RESOURCE_NAMELEN]; /* name of the protocol stack entity */
146 NU_HISR hisr_cb; /* control block of the HISR */
147 ULONG *stack; /* start address of stack memory */
148 } T_OS_OSISR_TABLE_ENTRY;
149
150 /*
151 * Type Definition for Partition Pool Management
152 */
153 typedef struct _T_OS_PART_POOL
154 {
155 struct _T_OS_PART_POOL * next;
156 unsigned int size;
157 T_VOID_STRUCT * pool_mem;
158 NU_PARTITION_POOL pcb;
159 } T_OS_PART_POOL;
160
161 typedef struct
162 {
163 T_OS_PART_POOL * grp_head;
164 char name[RESOURCE_NAMELEN];
165 } T_OS_PART_GRP_TABLE_ENTRY;
166
167 #ifdef NU_DEBUG
168 typedef struct
169 {
170 char *Start;
171 char *End;
172 } T_OS_POOL_BORDER;
173 #endif
174
175 /*
176 * Type Definition for Dynamic Memory Pool Management
177 */
178 typedef struct
179 {
180 char name[RESOURCE_NAMELEN];
181 NU_MEMORY_POOL * pcb;
182 } T_OS_MEM_POOL_TABLE_ENTRY;
183
184
185 typedef struct
186 {
187 char Name[ RESOURCE_NAMELEN ]; /* name of the event group */
188 NU_EVENT_GROUP EvtGrp; /* control block of the event group */
189 } T_OS_EVTGRP_TABLE_ENTRY;
190
191
192 #endif