FreeCalypso > hg > fc-magnetite
comparison src/g23m-fad/tcpip/include/rvm_gen.h @ 174:90eb61ecd093
src/g23m-fad: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 12 Oct 2016 05:40:46 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
173:bf64d785238a | 174:90eb61ecd093 |
---|---|
1 /** | |
2 * @file rvm_gen.h | |
3 * | |
4 * Defines the generic types used by the Riviera Environment | |
5 * and the exported function of the RVM block. | |
6 * | |
7 * @author David Lamy-Charrier (d-lamy@ti.com) | |
8 * @version 0.1 | |
9 */ | |
10 | |
11 /* | |
12 * Revision History: | |
13 * | |
14 * Date Author Modification | |
15 * ------------------------------------------------------------------- | |
16 * 19/01/2000 David Lamy-Charrier Create. | |
17 * 11/20/2001 Vincent Oberle Added BUILD_VERSION_NUMBER. | |
18 * Documentation cleaning | |
19 * | |
20 * (C) Copyright 2000 by Texas Instruments Incorporated, All Rights Reserved | |
21 */ | |
22 | |
23 #ifndef __RVM_GEN_H_ | |
24 #define __RVM_GEN_H_ | |
25 | |
26 #ifndef _SIMULATION_ | |
27 #include "rv.cfg" | |
28 #endif | |
29 | |
30 #include "rvf_api.h" /* for memory bank related definitions & GD*/ | |
31 #include "rvm_api.h" | |
32 | |
33 #ifdef __cplusplus | |
34 extern "C" { | |
35 #endif | |
36 | |
37 /* RVM global definitions */ | |
38 #define T_RVM_STRING char * | |
39 #define T_RVM_ERROR_TYPE UINT32 | |
40 | |
41 #define RVM_MAX_NB_MEM_BK (3) | |
42 | |
43 #if (defined BLUETOOTH) || (defined TEST) | |
44 #define RVM_MAX_NB_LINKED_SWE (5) | |
45 #else | |
46 #define RVM_MAX_NB_LINKED_SWE (3) | |
47 #endif | |
48 | |
49 #define RVM_USED_MAILBOX RVF_TASK_MBOX_0 | |
50 | |
51 /* define the 4 SWE types */ | |
52 typedef enum | |
53 { | |
54 RVM_SWE_TYPE_1, | |
55 RVM_SWE_TYPE_2, | |
56 RVM_SWE_TYPE_3, | |
57 RVM_SWE_TYPE_4 | |
58 } T_RVM_SWE_TYPE; | |
59 | |
60 /* Memory bank parameters */ | |
61 typedef struct | |
62 { | |
63 T_RVF_MB_NAME bank_name; | |
64 T_RVF_MB_PARAM initial_params; | |
65 } T_RVM_BK_INFO; | |
66 | |
67 /* RVM callback function pointer type */ | |
68 typedef T_RVM_RETURN (*T_RVM_CB_FUNC)(T_RVM_NAME swe_name, | |
69 T_RVM_RETURN error_cause, | |
70 T_RVM_ERROR_TYPE error_type, | |
71 T_RVM_STRING error_msg); | |
72 | |
73 /* | |
74 * Macro used to build the version number from the | |
75 * - major version number (8 bits) | |
76 * - minor version number (8 bits) | |
77 * - build number (16 bits). A 0 indicates this number is not used. | |
78 */ | |
79 #define BUILD_VERSION_NUMBER(major, minor, build) ( ((major & 0xFF) << 24) | \ | |
80 ((minor & 0xFF) << 16) | \ | |
81 (build & 0xFFFF) ) | |
82 | |
83 /* SWE core function prototype */ | |
84 typedef T_RVM_RETURN (*T_RVM_SWE_CORE_FUNC)(void); | |
85 | |
86 /* Type1 SWE info */ | |
87 typedef struct | |
88 { | |
89 T_RVM_NAME swe_name; | |
90 T_RVM_USE_ID swe_use_id; | |
91 UINT32 version; | |
92 UINT8 nb_mem_bank; | |
93 T_RVM_BK_INFO mem_bank[RVM_MAX_NB_MEM_BK]; | |
94 UINT8 nb_linked_swe; | |
95 T_RVM_USE_ID linked_swe_id[RVM_MAX_NB_LINKED_SWE]; | |
96 T_RV_RETURN_PATH return_path; | |
97 T_RVM_RETURN (* set_info) (T_RVF_ADDR_ID addr_id, | |
98 T_RV_RETURN_PATH return_path[], | |
99 T_RVF_MB_ID bk_id_table[], | |
100 T_RVM_CB_FUNC call_back_error_ft); | |
101 T_RVM_RETURN (* init) (void); | |
102 T_RVM_RETURN (* start) (void); | |
103 T_RVM_RETURN (* stop) (/*T_RV_HDR* hdr*/void); //??? | |
104 T_RVM_RETURN (* kill) (void); | |
105 } T_RVM_SWE_PASSIVE_INFO; | |
106 | |
107 /* Type2 SWE info */ | |
108 typedef struct | |
109 { | |
110 T_RVM_NAME swe_name; | |
111 T_RVM_USE_ID swe_use_id; | |
112 UINT16 stack_size; | |
113 UINT8 priority; | |
114 UINT32 version; | |
115 UINT8 nb_mem_bank; | |
116 T_RVM_BK_INFO mem_bank[RVM_MAX_NB_MEM_BK]; | |
117 UINT8 nb_linked_swe; | |
118 T_RVM_USE_ID linked_swe_id[RVM_MAX_NB_LINKED_SWE]; | |
119 T_RV_RETURN_PATH return_path; | |
120 T_RVF_GD_ID swe_group_directive; /* A-M-E-N-D-E-D! */ | |
121 T_RVM_RETURN (* set_info) (T_RVF_ADDR_ID addr_id, | |
122 T_RV_RETURN_PATH return_path[], | |
123 T_RVF_MB_ID bk_id_table[], /* A-M-E-N-E-D-E-D! is table or list??*/ | |
124 T_RVM_CB_FUNC call_back_error_ft); | |
125 T_RVM_RETURN (* init) (void); | |
126 T_RVM_RETURN (* start) (void); | |
127 T_RVM_RETURN (* handle_message) (T_RV_HDR * msg); | |
128 T_RVM_RETURN (* handle_timer) (T_RV_HDR * msg); | |
129 T_RVM_RETURN (* stop) (T_RV_HDR* hdr); | |
130 T_RVM_RETURN (* kill) (void); | |
131 } T_RVM_SWE_GROUP_MEMBER_INFO; | |
132 | |
133 /* Type3 SWE info */ | |
134 typedef struct | |
135 { | |
136 T_RVM_NAME swe_name; | |
137 T_RVM_USE_ID swe_use_id; | |
138 UINT16 stack_size; | |
139 UINT8 priority; | |
140 UINT32 version; | |
141 UINT8 nb_mem_bank; | |
142 T_RVM_BK_INFO mem_bank[RVM_MAX_NB_MEM_BK]; | |
143 UINT8 nb_linked_swe; | |
144 T_RVM_USE_ID linked_swe_id[RVM_MAX_NB_LINKED_SWE]; | |
145 T_RV_RETURN_PATH return_path; | |
146 T_RVM_RETURN (* set_info) (T_RVF_ADDR_ID addr_id, | |
147 T_RV_RETURN_PATH return_path[], | |
148 T_RVF_MB_ID bk_id_table[], | |
149 T_RVM_CB_FUNC call_back_error_ft); | |
150 T_RVM_RETURN (* init) (void); | |
151 T_RVM_RETURN (* start) (void); | |
152 T_RVM_RETURN (* handle_message) (T_RV_HDR * msg); | |
153 T_RVM_RETURN (* handle_timer) (T_RV_HDR * msg); | |
154 T_RVM_RETURN (* stop) (T_RV_HDR* hdr); | |
155 T_RVM_RETURN (* kill) (void); | |
156 } T_RVM_SWE_SINGLE_INFO; | |
157 | |
158 /* Type4 SWE info */ | |
159 typedef struct | |
160 { | |
161 T_RVM_NAME swe_name; | |
162 T_RVM_USE_ID swe_use_id; | |
163 UINT16 stack_size; | |
164 UINT8 priority; | |
165 UINT32 version; | |
166 UINT8 nb_mem_bank; | |
167 T_RVM_BK_INFO mem_bank[RVM_MAX_NB_MEM_BK]; | |
168 UINT8 nb_linked_swe; | |
169 T_RVM_USE_ID linked_swe_id[RVM_MAX_NB_LINKED_SWE]; | |
170 T_RV_RETURN_PATH return_path; | |
171 T_RVM_RETURN (* set_info) (T_RVF_ADDR_ID addr_id, | |
172 T_RV_RETURN_PATH return_path[], | |
173 T_RVF_MB_ID bk_id_table[], | |
174 T_RVM_CB_FUNC call_back_error_ft); | |
175 T_RVM_RETURN (* init) (void); | |
176 T_RVM_RETURN (* core) (void); | |
177 T_RVM_RETURN (* stop) (/*T_RV_HDR* hdr*/void); // could be removed completely except for legacy code | |
178 T_RVM_RETURN (* kill) (void); | |
179 } T_RVM_SWE_SELF_MADE_INFO; | |
180 | |
181 /* SWE information */ | |
182 typedef struct | |
183 { | |
184 T_RVM_SWE_TYPE swe_type; | |
185 | |
186 union | |
187 { T_RVM_SWE_PASSIVE_INFO type1; | |
188 T_RVM_SWE_GROUP_MEMBER_INFO type2; | |
189 T_RVM_SWE_SINGLE_INFO type3; | |
190 T_RVM_SWE_SELF_MADE_INFO type4; | |
191 } type_info; | |
192 } T_RVM_INFO_SWE; | |
193 | |
194 /* get info function pointer type */ | |
195 typedef T_RVM_RETURN (*T_RVM_GET_INFO_FUNC) (T_RVM_INFO_SWE * param); | |
196 | |
197 /* type used in the const SWEs array */ | |
198 typedef struct t_rvm_const_swe_info | |
199 { | |
200 T_RVM_USE_ID use_id; | |
201 T_RVM_GET_INFO_FUNC get_info_func; | |
202 } T_RVM_CONST_SWE_INFO; | |
203 | |
204 #ifdef __cplusplus | |
205 } | |
206 #endif | |
207 | |
208 #endif /* __RVM_GEN_H_ */ | |
209 |