FreeCalypso > hg > freecalypso-sw
comparison nuc-fw/riviera/rvm/rvm_i.h @ 119:dd56546ad9e0
starting to compile RVF
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Wed, 30 Oct 2013 23:19:21 +0000 |
parents | 21de8d8e6ea7 |
children |
comparison
equal
deleted
inserted
replaced
118:21de8d8e6ea7 | 119:dd56546ad9e0 |
---|---|
19 /****************************************************************************/ | 19 /****************************************************************************/ |
20 | 20 |
21 #ifndef __RVM_I_H_ | 21 #ifndef __RVM_I_H_ |
22 #define __RVM_I_H_ | 22 #define __RVM_I_H_ |
23 | 23 |
24 #ifndef _WINDOWS | 24 #if 0 //#ifndef _WINDOWS |
25 #include "config/rv.cfg" | 25 #include "config/rv.cfg" |
26 #include "config/debug.cfg" | 26 #include "config/debug.cfg" |
27 #endif | 27 #endif |
28 | 28 |
29 #include "rvf/rvf_api.h" | 29 #include "../rvf/rvf_api.h" |
30 #include "rvm/rvm_api.h" | 30 #include "rvm_api.h" |
31 #include "rvm/rvm_gen.h" | 31 #include "rvm_gen.h" |
32 //#include "rvf/rvf_pool_size.h" | 32 //#include "rvf/rvf_pool_size.h" |
33 #include "rvm/rvm_pool_size.h" | 33 #include "rvm_pool_size.h" |
34 //#include "rv_general.h" //?? | 34 //#include "rv_general.h" //?? |
35 | 35 |
36 | 36 |
37 /* MSG MUST BE VERIFIED */ | 37 /* MSG MUST BE VERIFIED */ |
38 #define RVM_MSG_OFFSET BUILD_MESSAGE_OFFSET(RVM_USE_ID) | 38 #define RVM_MSG_OFFSET BUILD_MESSAGE_OFFSET(RVM_USE_ID) |
88 | 88 |
89 | 89 |
90 typedef enum { | 90 typedef enum { |
91 SWE_NOT_STARTED = 0, | 91 SWE_NOT_STARTED = 0, |
92 SWE_RUNNING = 1, | 92 SWE_RUNNING = 1, |
93 SWE_STOPPING = 2, | 93 SWE_STOPPING = 2, |
94 SWE_KILLED = 3 | 94 SWE_KILLED = 3 |
95 }T_RVM_SWE_STATE; | 95 }T_RVM_SWE_STATE; |
96 | 96 |
97 | 97 |
98 /* structure of message */ | 98 /* structure of message */ |
99 typedef struct { | 99 typedef struct { |
100 T_RV_HDR header; | 100 T_RV_HDR header; |
101 T_RV_RETURN_PATH rp; | 101 T_RV_RETURN_PATH rp; |
102 UINT8 swe_num; | 102 UINT8 swe_num; |
103 }T_RVM_MSG; | 103 }T_RVM_MSG; |
104 | 104 |
105 | 105 |
106 /* Information about each known SWE | 106 /* Information about each known SWE |
107 This is static information and is built at RVM initialization */ | 107 This is static information and is built at RVM initialization */ |
108 typedef struct | 108 typedef struct |
109 { | 109 { |
110 T_RVM_NAME swe_name; | 110 T_RVM_NAME swe_name; |
111 T_RVM_USE_ID swe_use_id; | 111 T_RVM_USE_ID swe_use_id; |
112 T_RVM_GET_INFO_FUNC swe_get_info; /* pointer to its get_info function */ | 112 T_RVM_GET_INFO_FUNC swe_get_info; /* pointer to its get_info function */ |
113 T_RVM_SWE_TYPE swe_type; /* type of the SWE */ | 113 T_RVM_SWE_TYPE swe_type; /* type of the SWE */ |
114 T_RVF_G_ADDR_ID swe_addr_id; /* unique address id of the SWE */ | 114 T_RVF_G_ADDR_ID swe_addr_id; /* unique address id of the SWE */ |
115 UINT16 group_index; /* for type 2 SWE, index of the hosting group in the group array. */ | 115 UINT16 group_index; /* for type 2 SWE, index of the hosting group in the group array. */ |
116 UINT16 swe_stack_size; /* size of the task stack */ | 116 UINT16 swe_stack_size; /* size of the task stack */ |
117 UINT8 swe_priority; /* priority of the SWE */ | 117 UINT8 swe_priority; /* priority of the SWE */ |
118 T_RVM_SWE_STATE swe_state; /* state of the SWE */ | 118 T_RVM_SWE_STATE swe_state; /* state of the SWE */ |
119 T_RVF_BUFFER* stack_ptr; /* pointer to the stack of the task */ | 119 T_RVF_BUFFER* stack_ptr; /* pointer to the stack of the task */ |
120 UINT8 nb_using_appli; /* nb of application which uses this SWE */ | 120 UINT8 nb_using_appli; /* nb of application which uses this SWE */ |
121 UINT8 using_appli[RVM_MAX_SWE_USING]; /* pointer to each application which use this SWE */ | 121 UINT8 using_appli[RVM_MAX_SWE_USING]; /* pointer to each application which use this SWE */ |
122 T_RV_RETURN_PATH swe_return_path; | 122 T_RV_RETURN_PATH swe_return_path; |
123 T_RV_RETURN_PATH mmi_return_path; | 123 T_RV_RETURN_PATH mmi_return_path; |
124 }T_RVM_KNOWN_SWE; | 124 }T_RVM_KNOWN_SWE; |
125 | 125 |
126 typedef struct | 126 typedef struct |
127 { T_RVM_SWE_STATE host_state; | 127 { T_RVM_SWE_STATE host_state; |
128 UINT8 task_id; | 128 UINT8 task_id; |
129 UINT16 nb_hosted_swe; | 129 UINT16 nb_hosted_swe; |
130 UINT16 stack_size; | 130 UINT16 stack_size; |
131 UINT8 task_priority; | 131 UINT8 task_priority; |
132 } T_RVM_GROUP_INFO; /* DEPRECATED! */ | 132 } T_RVM_GROUP_INFO; /* DEPRECATED! */ |
133 | 133 |
134 | 134 |
135 /* structure containing the SWE generic functions pointers */ | 135 /* structure containing the SWE generic functions pointers */ |
136 typedef struct | 136 typedef struct |
151 | 151 |
152 /* Information about each processing SWE | 152 /* Information about each processing SWE |
153 This information is dynamic and lives during start or stop process only*/ | 153 This information is dynamic and lives during start or stop process only*/ |
154 typedef struct _t_rvm_processing_swe | 154 typedef struct _t_rvm_processing_swe |
155 { | 155 { |
156 UINT8 swe_id; // From known SWE array index | 156 UINT8 swe_id; // From known SWE array index |
157 T_RVM_SWE_TYPE swe_type; | 157 T_RVM_SWE_TYPE swe_type; |
158 UINT16 stack_size; | 158 UINT16 stack_size; |
159 UINT8 priority; | 159 UINT8 priority; |
160 UINT8 nb_requested_mb; | 160 UINT8 nb_requested_mb; |
161 UINT8 nb_created_mb; | 161 UINT8 nb_created_mb; |
162 T_RVM_APPLI_MB_PARAMS swe_mem_bank[RVM_MAX_NB_MEM_BK]; | 162 T_RVM_APPLI_MB_PARAMS swe_mem_bank[RVM_MAX_NB_MEM_BK]; |
163 T_RVM_SWE_FUNCTIONS rvm_functions; | 163 T_RVM_SWE_FUNCTIONS rvm_functions; |
164 T_RVF_MB_ID bk_id_table[RVM_MAX_NB_MEM_BK]; | 164 T_RVF_MB_ID bk_id_table[RVM_MAX_NB_MEM_BK]; |
165 struct _t_rvm_processing_swe *next_swe; | 165 struct _t_rvm_processing_swe *next_swe; |
166 } T_RVM_PROCESSING_SWE; | 166 } T_RVM_PROCESSING_SWE; |
167 | 167 |
168 typedef struct { | 168 typedef struct { |
169 T_RV_HDR hdr; | 169 T_RV_HDR hdr; |
194 /* information about groups of type2 SWE */ | 194 /* information about groups of type2 SWE */ |
195 #define T_GD_ID UINT8 | 195 #define T_GD_ID UINT8 |
196 | 196 |
197 typedef struct { | 197 typedef struct { |
198 T_RVM_SWE_STATE host_state; | 198 T_RVM_SWE_STATE host_state; |
199 T_RVF_GD_ID group_directive; | 199 T_RVF_GD_ID group_directive; |
200 T_RVF_G_ADDR_ID host_task_addr; | 200 T_RVF_G_ADDR_ID host_task_addr; |
201 // UINT16 hosted_swe_addr[10]; | 201 // UINT16 hosted_swe_addr[10]; |
202 UINT8 hosted_swe_db_index[MAX_PARASITES]; // to do ..... constant! | 202 UINT8 hosted_swe_db_index[MAX_PARASITES]; // to do ..... constant! |
203 UINT16 stack_size; | 203 UINT16 stack_size; |
204 UINT8 task_priority; | 204 UINT8 task_priority; |
205 } T_RVM_GROUP_DIRECTIVE; | 205 } T_RVM_GROUP_DIRECTIVE; |
206 | 206 |
207 T_RV_RET rvm_t2_proxy(void); | 207 T_RV_RET rvm_t2_proxy(void); |
208 T_RV_RET rvm_t3_proxy(void); | 208 T_RV_RET rvm_t3_proxy(void); |
209 //typedef TASKPTR rvm_proxy; | 209 //typedef TASKPTR rvm_proxy; |
210 | 210 |
211 /* definitions related to the RVM as a RVF task */ | 211 /* definitions related to the RVM as a RVF task */ |
212 #define RVM_TASK_ID (0) | 212 #define RVM_TASK_ID (0) |
213 #define RVM_PRIORITY (220) | 213 #define RVM_PRIORITY (220) |
214 | 214 |
215 /* To do ... should correspond to RVF definitions */ | 215 /* To do ... should correspond to RVF definitions */ |
216 #define RVM_TASK 0 /* A-M-E-N-D-E-D ! */ | 216 #define RVM_TASK 0 /* A-M-E-N-D-E-D ! */ |
217 #define ET2_HOST_TASK 1 | 217 #define ET2_HOST_TASK 1 |
218 #define ET3_TASK 3 | 218 #define ET3_TASK 3 |
219 #define ET4_TASK 4 | 219 #define ET4_TASK 4 |
220 #define ET2_VTASK 5 | 220 #define ET2_VTASK 5 |
221 #define PRE_RV_INIT_TASK 10 | 221 #define PRE_RV_INIT_TASK 10 |
222 | 222 |
223 | 223 |
224 #define RVM_ERROR_MSG_MAX_LENGTH (100) | 224 #define RVM_ERROR_MSG_MAX_LENGTH (100) |
225 | 225 |
267 | 267 |
268 T_RVM_RETURN rvm_error ( T_RVM_NAME swe_name, T_RVM_RETURN error_cause, | 268 T_RVM_RETURN rvm_error ( T_RVM_NAME swe_name, T_RVM_RETURN error_cause, |
269 T_RVM_ERROR_TYPE error_type, T_RVM_STRING error_msg); | 269 T_RVM_ERROR_TYPE error_type, T_RVM_STRING error_msg); |
270 | 270 |
271 | 271 |
272 void rvm_task (UINT32 param); | 272 void rvm_task (UINT32 param); |
273 | 273 |
274 void rvm_launch_appli( T_RVM_MSG * msg_Ptr); | 274 void rvm_launch_appli( T_RVM_MSG * msg_Ptr); |
275 | 275 |
276 void rvm_stop_appli( T_RVM_STOP_MSG * msg_Ptr); | 276 void rvm_stop_appli( T_RVM_STOP_MSG * msg_Ptr); |
277 | 277 |
278 void rvm_swe_has_stopped(T_RVM_STOP_MSG* p_msg); | 278 void rvm_swe_has_stopped(T_RVM_STOP_MSG* p_msg); |
279 T_RVM_RETURN rvm_dup_stop_msg(T_RVM_STOP_MSG* i_msg, T_RVM_STOP_MSG* o_msg) ; | 279 T_RVM_RETURN rvm_dup_stop_msg(T_RVM_STOP_MSG* i_msg, T_RVM_STOP_MSG* o_msg) ; |
280 void rvm_suspend_swe(UINT8 swe_index); | 280 void rvm_suspend_swe(UINT8 swe_index); |
281 T_RVM_RETURN rvm_kill_swe(UINT8 swe_index); | 281 T_RVM_RETURN rvm_kill_swe(UINT8 swe_index); |
282 UINT8 rvm_get_mb_level(UINT8 swe_index) ; | 282 UINT8 rvm_get_mb_level(UINT8 swe_index) ; |
283 | 283 |
284 void rvm_shut_down_appli( T_RVM_MSG * msg_Ptr); | 284 void rvm_shut_down_appli( T_RVM_MSG * msg_Ptr); |
285 void rvm_shutdown_swe(UINT8 index) ; | 285 void rvm_shutdown_swe(UINT8 index) ; |
286 | 286 |
287 T_RVM_TASK_ID rvm_allocate_task_id(UINT8 isRealTask); | 287 T_RVM_TASK_ID rvm_allocate_task_id(UINT8 isRealTask); |
288 | 288 |
289 T_RVM_RETURN rvm_delete_used_memory ( T_RVM_PROCESSING_SWE * appli); | 289 T_RVM_RETURN rvm_delete_used_memory ( T_RVM_PROCESSING_SWE * appli); |
290 | 290 |
346 #define RVM_TRACE_DEBUG_LOW_PARAM(string, param)\ | 346 #define RVM_TRACE_DEBUG_LOW_PARAM(string, param)\ |
347 rvf_send_trace (string,(sizeof(string)-1),(UINT32)param,RV_TRACE_LEVEL_DEBUG_LOW,RVM_USE_ID ) | 347 rvf_send_trace (string,(sizeof(string)-1),(UINT32)param,RV_TRACE_LEVEL_DEBUG_LOW,RVM_USE_ID ) |
348 | 348 |
349 | 349 |
350 #endif /* __RVM_I_H_ */ | 350 #endif /* __RVM_I_H_ */ |
351 |