comparison gsm-fw/gpf/frame/vsi_mis.c @ 316:79080922d8e4

GPF: FRAME C sources and include files imported from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 10 Apr 2014 04:06:05 +0000
parents
children 2c760f6b1fe0
comparison
equal deleted inserted replaced
315:1b4beffc8055 316:79080922d8e4
1 /*
2 +------------------------------------------------------------------------------
3 | File: vsi_mis.c
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 : This Module defines the virtual system interface part
17 | for miscellaneous things.
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifndef __VSI_MIS_C__
22 #define __VSI_MIS_C__
23 #endif
24
25 /*==== INCLUDES ===================================================*/
26
27 #include <string.h>
28
29 #include "typedefs.h"
30
31 #include "vsi.h"
32 #include "os.h"
33 #include "frm_defs.h"
34 #include "frm_types.h"
35 #include "frm_glob.h"
36
37 /*==== TYPES ======================================================*/
38
39
40 /*==== CONSTANTS ==================================================*/
41
42
43 /*==== EXTERNALS ==================================================*/
44
45 /* -------------- S H A R E D - BEGIN ---------------- */
46 #ifdef _TOOLS_
47 #pragma data_seg("FRAME_SHARED")
48 #endif
49
50
51 /*==== VARIABLES ==================================================*/
52
53 #ifdef _TOOLS_
54 #pragma data_seg()
55 #endif
56 /* -------------- S H A R E D - END ---------------- */
57
58 /*==== FUNCTIONS ==================================================*/
59
60
61 #ifndef RUN_INT_RAM
62 /*
63 +--------------------------------------------------------------------+
64 | PROJECT : GSM-Frame (8415) MODULE : VSI_MIS |
65 | STATE : code ROUTINE : vsi_gettaskname |
66 +--------------------------------------------------------------------+
67
68 PURPOSE : reads the name of a task
69
70 */
71
72 int vsi_gettaskname (T_HANDLE Caller, T_HANDLE Handle, char *Name)
73 {
74
75 if ( os_GetTaskName ( Caller, Handle, Name ) != OS_ERROR )
76 return VSI_OK;
77
78 return VSI_ERROR;
79 }
80 #endif
81
82 #ifndef RUN_INT_RAM
83 /*
84 +--------------------------------------------------------------------+
85 | PROJECT : GSM-Frame (8415) MODULE : VSI_MIS |
86 | STATE : code ROUTINE : vsi_gettaskhandle |
87 +--------------------------------------------------------------------+
88
89 PURPOSE : reads the name of a task
90
91 */
92
93 T_HANDLE vsi_gettaskhandle (T_HANDLE Caller, char *Name)
94 {
95 OS_HANDLE Handle;
96
97 if (os_GetTaskHandle( Caller, Name, &Handle ) != OS_ERROR )
98 {
99 return Handle;
100 }
101 return VSI_ERROR;
102 }
103 #endif
104
105 #ifndef RUN_INT_RAM
106 /*
107 +--------------------------------------------------------------------+
108 | PROJECT : GSM-Frame (8415) MODULE : VSI_MIS |
109 | STATE : code ROUTINE : vsi_gettaskflags |
110 +--------------------------------------------------------------------+
111
112 PURPOSE : reads the flags of a task
113
114 */
115
116 int vsi_gettaskflags (T_HANDLE Caller, T_HANDLE Handle, U32 *Flags)
117 {
118
119 *Flags = pf_TaskTable[Handle].Flags;
120 return VSI_OK;
121
122 }
123 #endif
124
125 #ifndef RUN_INT_RAM
126 /*
127 +--------------------------------------------------------------------+
128 | PROJECT : GSM-Frame (8415) MODULE : VSI_MIS |
129 | STATE : code ROUTINE : vsi_time |
130 +--------------------------------------------------------------------+
131
132 PURPOSE : get time
133
134 */
135
136 int vsi_t_time (T_HANDLE Caller, T_TIME *Value)
137 {
138
139 os_GetTime ( Caller, Value );
140 return VSI_OK;
141
142 }
143 #endif
144
145 #ifndef RUN_INT_RAM
146 /*
147 +--------------------------------------------------------------------+
148 | PROJECT : GSM-Frame (8415) MODULE : VSI_MIS |
149 | STATE : code ROUTINE : vsi_sleep |
150 +--------------------------------------------------------------------+
151
152 PURPOSE : suspend task
153
154 */
155
156 int vsi_t_sleep (T_HANDLE Caller, T_TIME Value)
157 {
158
159 os_SuspendTask ( Caller, Value );
160 return VSI_OK;
161
162 }
163 #endif
164
165 #ifndef RUN_INT_RAM
166 /*
167 +--------------------------------------------------------------------+
168 | PROJECT : GSM-Frame (8415) MODULE : VSI_MIS |
169 | STATE : code ROUTINE : vsi_object_info |
170 +--------------------------------------------------------------------+
171
172 PURPOSE : read information about created objects
173
174 */
175 int vsi_object_info (T_HANDLE Caller, USHORT Id, USHORT Index, char *Buffer, USHORT Size)
176 {
177 if ( os_ObjectInformation ( Caller, Id, Index, Size, Buffer ) == OS_OK )
178 {
179 if ( strlen (Buffer) > TTRACE_LEN )
180 vsi_o_assert ( NO_TASK, OS_SYST_ERR_STR_TOO_LONG, __FILE__, __LINE__,
181 "Traced string too long" );
182 return VSI_OK;
183 }
184 return VSI_ERROR;
185
186 }
187 #endif
188
189 #ifndef RUN_FLASH
190 /*
191 +--------------------------------------------------------------------+
192 | PROJECT : GSM-Frame (8415) MODULE : VSI_PRO |
193 | STATE : code ROUTINE : vsi_p_name |
194 +--------------------------------------------------------------------+
195
196 PURPOSE : reads the name of a task
197
198 */
199
200 int vsi_e_name (T_HANDLE Caller, T_HANDLE Handle, char *Name)
201 {
202 if ( Handle >= 0 && Handle <= MaxEntities && pf_TaskTable[Handle].Name[0] != 0 )
203 {
204 strcpy ( Name, pf_TaskTable[Handle].Name );
205 return VSI_OK;
206 }
207 return VSI_ERROR;
208 }
209 #endif
210
211 #ifndef RUN_FLASH
212 /*
213 +--------------------------------------------------------------------+
214 | PROJECT : GSM-Frame (8415) MODULE : VSI_PRO |
215 | STATE : code ROUTINE : vsi_p_handle |
216 +--------------------------------------------------------------------+
217
218 PURPOSE : reads the name of a task
219
220 */
221
222 T_HANDLE vsi_e_handle (T_HANDLE Caller, char *Name)
223 {
224 T_HANDLE e_handle;
225
226 if ( Name == NULL )
227 {
228 return e_running[os_MyHandle()];
229 }
230 else
231 {
232 for ( e_handle = MaxEntities; e_handle > 0; e_handle-- )
233 {
234 if ( pf_TaskTable[e_handle].Name[0] != 0 && !strncmp ( pf_TaskTable[e_handle].Name, Name, RESOURCE_NAMELEN-1 ) )
235 return e_handle;
236 }
237 }
238 return VSI_ERROR;
239 }
240 #endif
241