annotate gsm-fw/services/etm/etm_env.c @ 295:3dd74b16df82

fc-fsio: pathname recursion handling revamped
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 01 Mar 2014 08:01:08 +0000
parents 13af69b6a3dc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /********************************************************************************
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * Enhanced TestMode (ETM)
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * @file etm_env.c
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 * @author Kim T. Peteren (ktp@ti.com)
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 * @version 0.1
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 * History:
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 * Date Modification
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 * ------------------------------------
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 * 16/06/2003 Creation
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 * (C) Copyright 2003 by Texas Instruments Incorporated, All Rights Reserved
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 *********************************************************************************/
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
19 #include "etm_config.h"
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
20 #include "etm_env.h"
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
22 #include "../../riviera/rvm/rvm_priorities.h"
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
23 #include "../../riviera/rvm/rvm_use_id_list.h"
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
24 #include "../../riviera/rv/rv_defined_swe.h"
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 #include <string.h>
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 /******************************************************************************
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 *****************************************************************************/
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 /* External declaration */
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 extern T_RV_RET etm_task(void);
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 /**
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 * Pointer on the structure gathering all the global variables
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 * used by ETM instance.
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 */
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 T_ETM_ENV_CTRL_BLK *etm_env_ctrl_blk = NULL;
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 /******************************************************************************
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 * Function : etm_get_info
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 * Description : This function is called by the RV manager to learn
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 * driver requirements in terms of memory, SWEs...
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 * Parameters : T_RVM_INFO_SWE * swe_info: pointer to the structure to fill
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 * containing infos related to the driver SWE.
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 * Return : T_RVM_RETURN
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 * History : 0.1
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 ******************************************************************************/
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 T_RVM_RETURN etm_get_info(T_RVM_INFO_SWE *swe_info)
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 {
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 /* SWE info */
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
60 swe_info->swe_type = RVM_SWE_TYPE_4;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 swe_info->type_info.type4.swe_use_id = ETM_USE_ID;
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 memcpy(swe_info->type_info.type4.swe_name, "ETM", sizeof("ETM"));
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
64 swe_info->type_info.type4.stack_size = ETM_STACK_SIZE;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
65 swe_info->type_info.type4.priority = RVM_ETM_TASK_PRIORITY;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
67 /* Set the return path */
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
68 swe_info->type_info.type4.return_path.callback_func = NULL;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
69 swe_info->type_info.type4.return_path.addr_id = 0;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
71 /* memory bank info */
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
72 swe_info->type_info.type4.nb_mem_bank = 1;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
74 memcpy (swe_info->type_info.type4.mem_bank[0].bank_name, "ETM_PRIM", 9);
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
75 swe_info->type_info.type4.mem_bank[0].initial_params.size = ETM_MB_PRIM_SIZE;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
76 swe_info->type_info.type4.mem_bank[0].initial_params.watermark = ETM_MB_PRIM_WATERMARK;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
77
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
78 /* linked SWE info */
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 /* this SWE requires the ATP SWE to run */
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
80 #if ETM_ATP_SUPPORT
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 swe_info->type_info.type4.nb_linked_swe = 1;
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 swe_info->type_info.type4.linked_swe_id[0] = ATP_USE_ID;
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 #else
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
84 swe_info->type_info.type4.nb_linked_swe = 0;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 #endif
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
87 /* generic functions */
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
88 swe_info->type_info.type4.set_info = etm_set_info;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
89 swe_info->type_info.type4.init = etm_init;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
90 swe_info->type_info.type4.core = etm_start;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
91 swe_info->type_info.type4.stop = etm_stop;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
92 swe_info->type_info.type4.kill = etm_kill;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
94 return RVM_OK;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 }
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 /******************************************************************************
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 * Function : etm_set_info
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 * Description : This function is called by the RV manager to inform
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
102 * the driver SWE about task_id, mb_id and error function.
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104 * Parameters : - T_RVF_ADDR_ID addr_id: unique path to the SWE.
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
105 * - T_RV_RETURN ReturnPath[], array of return path for linked SWE
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
106 * - T_RVF_MB_ID mbId[]: array of memory bank ids.
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
107 * - callback function to call in case of unrecoverable error.
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 * Return : T_RVM_RETURN
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 * History : 0.1
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 ******************************************************************************/
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 T_RVM_RETURN etm_set_info (T_RVF_ADDR_ID addr_id,
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 T_RV_RETURN return_path[],
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118 T_RVF_MB_ID bk_id[],
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
119 T_RVM_RETURN (*rvm_error_ft)(T_RVM_NAME swe_name,
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
120 T_RVM_RETURN error_cause,
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
121 T_RVM_ERROR_TYPE error_type,
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
122 T_RVM_STRING error_msg))
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 {
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
124 /* Create instance gathering all the variable used by EXPL instance */
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
125 if (rvf_get_buf(bk_id[0],
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
126 sizeof(T_ETM_ENV_CTRL_BLK),
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
127 (T_RVF_BUFFER**)&etm_env_ctrl_blk) != RVF_GREEN)
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
128 {
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
129 /* The environemnt will cancel the ETM instance creation. */
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
130 return RVM_MEMORY_ERR;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
131 }
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
133 /* Store the pointer to the error function */
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
134 etm_env_ctrl_blk->error_ft = rvm_error_ft ;
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
135 /* Store the mem bank id. */
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
136 etm_env_ctrl_blk->prim_id = bk_id[0];
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
137 /* Store the addr id */
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
138 etm_env_ctrl_blk->addr_id = addr_id;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
140 /*
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
141 * Task ID (task_id) and Memory bank ID (mb_id) can be retrieved later
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
142 * using rvf_get_taskid and rvf_get_mb_id functions.
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
143 */
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
145 /* return_path of linked SWE -> not used */
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
147 return RVM_OK;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 }
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 /******************************************************************************
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 * Function : etm_init
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 * Description : This function is called by the RV manager to initialize the
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
155 * etm SWE before creating the task and calling etm_start.
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 * Parameters : None
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 * Return : T_RVM_RETURN
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 * History : 0.1 (20-August-2000)
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 ******************************************************************************/
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 T_RVM_RETURN etm_init(void)
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 {
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 return RVM_OK;
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169 }
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172 /******************************************************************************
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173 * Function : etm_start
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 * Description : This function is called by the RV manager to start the etm
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
176 * SWE, it is the body of the task.
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 * Parameters : None
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 * Return : T_RVM_RETURN
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182 * History : 0.1
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 ******************************************************************************/
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 T_RVM_RETURN etm_start(void)
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188 {
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 etm_task();
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
190 return RV_OK;
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 }
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 /******************************************************************************
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 * Function : etm_stop
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 * Description : This function is called by the RV manager to stop the etm SWE.
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 * Parameters : None
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201 * Return : T_RVM_RETURN
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 *
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
203 * History : 0.1
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205 ******************************************************************************/
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207 T_RVM_RETURN etm_stop(void)
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 {
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 return RVM_OK;
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 }
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
212 /******************************************************************************
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213 * Function : etm_kill
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 * Description : This function is called by the RV manager to kill the etm
166
13af69b6a3dc ETM core compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 164
diff changeset
216 * SWE, after the etm_stop function has been called.
164
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218 * Parameters : None
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 * Return : T_RVM_RETURN
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222 * History : 0.1
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
223 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
224 *
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
225 ******************************************************************************/
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
226
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
227 T_RVM_RETURN etm_kill (void)
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
228 {
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
229 rvf_free_buf(etm_env_ctrl_blk);
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
230 return RVM_OK;
d78219c43fbf gsm-fw/services/etm: initial import from the Leonardo semi-src
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
231 }