FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/services/etm/etm_env.c @ 166:13af69b6a3dc
ETM core compiles
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Tue, 19 Nov 2013 05:07:24 +0000 |
parents | d78219c43fbf |
children |
comparison
equal
deleted
inserted
replaced
165:9dbf3248a197 | 166:13af69b6a3dc |
---|---|
14 * 16/06/2003 Creation | 14 * 16/06/2003 Creation |
15 * | 15 * |
16 * (C) Copyright 2003 by Texas Instruments Incorporated, All Rights Reserved | 16 * (C) Copyright 2003 by Texas Instruments Incorporated, All Rights Reserved |
17 *********************************************************************************/ | 17 *********************************************************************************/ |
18 | 18 |
19 | 19 #include "etm_config.h" |
20 #include "etm/etm_env.h" | 20 #include "etm_env.h" |
21 | 21 |
22 #include "rvm/rvm_priorities.h" | 22 #include "../../riviera/rvm/rvm_priorities.h" |
23 #include "rvm/rvm_use_id_list.h" | 23 #include "../../riviera/rvm/rvm_use_id_list.h" |
24 #include "rv/rv_defined_swe.h" | 24 #include "../../riviera/rv/rv_defined_swe.h" |
25 | 25 |
26 #include <string.h> | 26 #include <string.h> |
27 /****************************************************************************** | 27 /****************************************************************************** |
28 * | 28 * |
29 *****************************************************************************/ | 29 *****************************************************************************/ |
55 * | 55 * |
56 ******************************************************************************/ | 56 ******************************************************************************/ |
57 T_RVM_RETURN etm_get_info(T_RVM_INFO_SWE *swe_info) | 57 T_RVM_RETURN etm_get_info(T_RVM_INFO_SWE *swe_info) |
58 { | 58 { |
59 /* SWE info */ | 59 /* SWE info */ |
60 swe_info->swe_type = RVM_SWE_TYPE_4; | 60 swe_info->swe_type = RVM_SWE_TYPE_4; |
61 swe_info->type_info.type4.swe_use_id = ETM_USE_ID; | 61 swe_info->type_info.type4.swe_use_id = ETM_USE_ID; |
62 | 62 |
63 memcpy(swe_info->type_info.type4.swe_name, "ETM", sizeof("ETM")); | 63 memcpy(swe_info->type_info.type4.swe_name, "ETM", sizeof("ETM")); |
64 swe_info->type_info.type4.stack_size = ETM_STACK_SIZE; | 64 swe_info->type_info.type4.stack_size = ETM_STACK_SIZE; |
65 swe_info->type_info.type4.priority = RVM_ETM_TASK_PRIORITY; | 65 swe_info->type_info.type4.priority = RVM_ETM_TASK_PRIORITY; |
66 | 66 |
67 /* Set the return path */ | 67 /* Set the return path */ |
68 swe_info->type_info.type4.return_path.callback_func = NULL; | 68 swe_info->type_info.type4.return_path.callback_func = NULL; |
69 swe_info->type_info.type4.return_path.addr_id = 0; | 69 swe_info->type_info.type4.return_path.addr_id = 0; |
70 | 70 |
71 /* memory bank info */ | 71 /* memory bank info */ |
72 swe_info->type_info.type4.nb_mem_bank = 1; | 72 swe_info->type_info.type4.nb_mem_bank = 1; |
73 | 73 |
74 memcpy (swe_info->type_info.type4.mem_bank[0].bank_name, "ETM_PRIM", 9); | 74 memcpy (swe_info->type_info.type4.mem_bank[0].bank_name, "ETM_PRIM", 9); |
75 swe_info->type_info.type4.mem_bank[0].initial_params.size = ETM_MB_PRIM_SIZE; | 75 swe_info->type_info.type4.mem_bank[0].initial_params.size = ETM_MB_PRIM_SIZE; |
76 swe_info->type_info.type4.mem_bank[0].initial_params.watermark = ETM_MB_PRIM_WATERMARK; | 76 swe_info->type_info.type4.mem_bank[0].initial_params.watermark = ETM_MB_PRIM_WATERMARK; |
77 | 77 |
78 /* linked SWE info */ | 78 /* linked SWE info */ |
79 /* this SWE requires the ATP SWE to run */ | 79 /* this SWE requires the ATP SWE to run */ |
80 #ifdef RVM_ATP_SWE | 80 #if ETM_ATP_SUPPORT |
81 swe_info->type_info.type4.nb_linked_swe = 1; | 81 swe_info->type_info.type4.nb_linked_swe = 1; |
82 swe_info->type_info.type4.linked_swe_id[0] = ATP_USE_ID; | 82 swe_info->type_info.type4.linked_swe_id[0] = ATP_USE_ID; |
83 #else | 83 #else |
84 swe_info->type_info.type4.nb_linked_swe = 0; | 84 swe_info->type_info.type4.nb_linked_swe = 0; |
85 #endif | 85 #endif |
86 | 86 |
87 /* generic functions */ | 87 /* generic functions */ |
88 swe_info->type_info.type4.set_info = etm_set_info; | 88 swe_info->type_info.type4.set_info = etm_set_info; |
89 swe_info->type_info.type4.init = etm_init; | 89 swe_info->type_info.type4.init = etm_init; |
90 swe_info->type_info.type4.core = etm_start; | 90 swe_info->type_info.type4.core = etm_start; |
91 swe_info->type_info.type4.stop = etm_stop; | 91 swe_info->type_info.type4.stop = etm_stop; |
92 swe_info->type_info.type4.kill = etm_kill; | 92 swe_info->type_info.type4.kill = etm_kill; |
93 | 93 |
94 return RVM_OK; | 94 return RVM_OK; |
95 } | 95 } |
96 | 96 |
97 | 97 |
98 /****************************************************************************** | 98 /****************************************************************************** |
99 * Function : etm_set_info | 99 * Function : etm_set_info |
100 * | 100 * |
101 * Description : This function is called by the RV manager to inform | 101 * Description : This function is called by the RV manager to inform |
102 * the driver SWE about task_id, mb_id and error function. | 102 * the driver SWE about task_id, mb_id and error function. |
103 * | 103 * |
104 * Parameters : - T_RVF_ADDR_ID addr_id: unique path to the SWE. | 104 * Parameters : - T_RVF_ADDR_ID addr_id: unique path to the SWE. |
105 * - T_RV_RETURN ReturnPath[], array of return path for linked SWE | 105 * - T_RV_RETURN ReturnPath[], array of return path for linked SWE |
106 * - T_RVF_MB_ID mbId[]: array of memory bank ids. | 106 * - T_RVF_MB_ID mbId[]: array of memory bank ids. |
107 * - callback function to call in case of unrecoverable error. | 107 * - callback function to call in case of unrecoverable error. |
108 * | 108 * |
109 * Return : T_RVM_RETURN | 109 * Return : T_RVM_RETURN |
110 * | 110 * |
111 * History : 0.1 | 111 * History : 0.1 |
112 * | 112 * |
114 ******************************************************************************/ | 114 ******************************************************************************/ |
115 | 115 |
116 T_RVM_RETURN etm_set_info (T_RVF_ADDR_ID addr_id, | 116 T_RVM_RETURN etm_set_info (T_RVF_ADDR_ID addr_id, |
117 T_RV_RETURN return_path[], | 117 T_RV_RETURN return_path[], |
118 T_RVF_MB_ID bk_id[], | 118 T_RVF_MB_ID bk_id[], |
119 T_RVM_RETURN (*rvm_error_ft)(T_RVM_NAME swe_name, | 119 T_RVM_RETURN (*rvm_error_ft)(T_RVM_NAME swe_name, |
120 T_RVM_RETURN error_cause, | 120 T_RVM_RETURN error_cause, |
121 T_RVM_ERROR_TYPE error_type, | 121 T_RVM_ERROR_TYPE error_type, |
122 T_RVM_STRING error_msg)) | 122 T_RVM_STRING error_msg)) |
123 { | 123 { |
124 /* Create instance gathering all the variable used by EXPL instance */ | 124 /* Create instance gathering all the variable used by EXPL instance */ |
125 if (rvf_get_buf(bk_id[0], | 125 if (rvf_get_buf(bk_id[0], |
126 sizeof(T_ETM_ENV_CTRL_BLK), | 126 sizeof(T_ETM_ENV_CTRL_BLK), |
127 (T_RVF_BUFFER**)&etm_env_ctrl_blk) != RVF_GREEN) | 127 (T_RVF_BUFFER**)&etm_env_ctrl_blk) != RVF_GREEN) |
128 { | 128 { |
129 /* The environemnt will cancel the ETM instance creation. */ | 129 /* The environemnt will cancel the ETM instance creation. */ |
130 return RVM_MEMORY_ERR; | 130 return RVM_MEMORY_ERR; |
131 } | 131 } |
132 | 132 |
133 | 133 /* Store the pointer to the error function */ |
134 /* Store the pointer to the error function */ | 134 etm_env_ctrl_blk->error_ft = rvm_error_ft ; |
135 etm_env_ctrl_blk->error_ft = rvm_error_ft ; | 135 /* Store the mem bank id. */ |
136 /* Store the mem bank id. */ | 136 etm_env_ctrl_blk->prim_id = bk_id[0]; |
137 etm_env_ctrl_blk->prim_id = bk_id[0]; | 137 /* Store the addr id */ |
138 /* Store the addr id */ | 138 etm_env_ctrl_blk->addr_id = addr_id; |
139 etm_env_ctrl_blk->addr_id = addr_id; | 139 |
140 | 140 /* |
141 /* | 141 * Task ID (task_id) and Memory bank ID (mb_id) can be retrieved later |
142 * Task ID (task_id) and Memory bank ID (mb_id) can be retrieved later | 142 * using rvf_get_taskid and rvf_get_mb_id functions. |
143 * using rvf_get_taskid and rvf_get_mb_id functions. | 143 */ |
144 */ | 144 |
145 | 145 /* return_path of linked SWE -> not used */ |
146 /* return_path of linked SWE -> not used */ | 146 |
147 | 147 return RVM_OK; |
148 } | |
149 | |
150 | |
151 /****************************************************************************** | |
152 * Function : etm_init | |
153 * | |
154 * Description : This function is called by the RV manager to initialize the | |
155 * etm SWE before creating the task and calling etm_start. | |
156 * | |
157 * Parameters : None | |
158 * | |
159 * Return : T_RVM_RETURN | |
160 * | |
161 * History : 0.1 (20-August-2000) | |
162 * | |
163 * | |
164 ******************************************************************************/ | |
165 | |
166 T_RVM_RETURN etm_init(void) | |
167 { | |
168 return RVM_OK; | |
169 } | |
170 | |
171 | |
172 /****************************************************************************** | |
173 * Function : etm_start | |
174 * | |
175 * Description : This function is called by the RV manager to start the etm | |
176 * SWE, it is the body of the task. | |
177 * | |
178 * Parameters : None | |
179 * | |
180 * Return : T_RVM_RETURN | |
181 * | |
182 * History : 0.1 | |
183 * | |
184 * | |
185 ******************************************************************************/ | |
186 | |
187 T_RVM_RETURN etm_start(void) | |
188 { | |
189 etm_task(); | |
190 return RV_OK; | |
191 } | |
192 | |
193 | |
194 /****************************************************************************** | |
195 * Function : etm_stop | |
196 * | |
197 * Description : This function is called by the RV manager to stop the etm SWE. | |
198 * | |
199 * Parameters : None | |
200 * | |
201 * Return : T_RVM_RETURN | |
202 * | |
203 * History : 0.1 | |
204 * | |
205 ******************************************************************************/ | |
206 | |
207 T_RVM_RETURN etm_stop(void) | |
208 { | |
148 return RVM_OK; | 209 return RVM_OK; |
149 } | 210 } |
150 | 211 |
151 | |
152 /****************************************************************************** | |
153 * Function : etm_init | |
154 * | |
155 * Description : This function is called by the RV manager to initialize the | |
156 * etm SWE before creating the task and calling etm_start. | |
157 * | |
158 * Parameters : None | |
159 * | |
160 * Return : T_RVM_RETURN | |
161 * | |
162 * History : 0.1 (20-August-2000) | |
163 * | |
164 * | |
165 ******************************************************************************/ | |
166 | |
167 T_RVM_RETURN etm_init(void) | |
168 { | |
169 return RVM_OK; | |
170 } | |
171 | |
172 | |
173 /****************************************************************************** | |
174 * Function : etm_start | |
175 * | |
176 * Description : This function is called by the RV manager to start the etm | |
177 * SWE, it is the body of the task. | |
178 * | |
179 * Parameters : None | |
180 * | |
181 * Return : T_RVM_RETURN | |
182 * | |
183 * History : 0.1 | |
184 * | |
185 * | |
186 ******************************************************************************/ | |
187 | |
188 T_RVM_RETURN etm_start(void) | |
189 { | |
190 etm_task(); | |
191 return RV_OK; | |
192 } | |
193 | |
194 | |
195 /****************************************************************************** | |
196 * Function : etm_stop | |
197 * | |
198 * Description : This function is called by the RV manager to stop the etm SWE. | |
199 * | |
200 * Parameters : None | |
201 * | |
202 * Return : T_RVM_RETURN | |
203 * | |
204 * History : 0.1 | |
205 * | |
206 ******************************************************************************/ | |
207 | |
208 T_RVM_RETURN etm_stop(void) | |
209 { | |
210 return RVM_OK; | |
211 } | |
212 | |
213 /****************************************************************************** | 212 /****************************************************************************** |
214 * Function : etm_kill | 213 * Function : etm_kill |
215 * | 214 * |
216 * Description : This function is called by the RV manager to kill the etm | 215 * Description : This function is called by the RV manager to kill the etm |
217 * SWE, after the etm_stop function has been called. | 216 * SWE, after the etm_stop function has been called. |
218 * | 217 * |
219 * Parameters : None | 218 * Parameters : None |
220 * | 219 * |
221 * Return : T_RVM_RETURN | 220 * Return : T_RVM_RETURN |
222 * | 221 * |