FreeCalypso > hg > tcs211-pirelli
comparison chipsetsw/riviera/rvt/ti_profiler/ti_profiler_env.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /******************************************************************************* | |
2 * | |
3 * ti_profiler_env.c | |
4 * | |
5 * This module interfaces the environment and contains all start/init/stop... | |
6 * functions of the TI profiler module. | |
7 * | |
8 * (C) Texas Instruments, all rights reserved | |
9 * | |
10 * Version number : 0.1 | |
11 * | |
12 * History : 0.1 (7/30/2001) - Created | |
13 * | |
14 * Date : 7/30/2001 | |
15 * | |
16 * Author : Philippe Martinez, | |
17 * | |
18 ******************************************************************************/ | |
19 | |
20 #include "config/debug.cfg" | |
21 | |
22 #if (TI_PROFILER == 1) || (TI_NUC_MONITOR == 1) | |
23 | |
24 #include <string.h> | |
25 | |
26 #include "nucleus.h" | |
27 | |
28 #include "rvf/rvf_api.h" | |
29 #include "rv/rv_general.h" | |
30 #include "rvm/rvm_gen.h" | |
31 #include "rvm/rvm_priorities.h" | |
32 #include "rvm/rvm_use_id_list.h" | |
33 | |
34 #include "rvt/ti_profiler/ti_profiler_env.h" | |
35 | |
36 /*-------------------------------------------------------*/ | |
37 /* external variables & prototypes */ | |
38 /*-------------------------------------------------------*/ | |
39 | |
40 extern T_RVF_MB_ID prof_mb_id; | |
41 extern T_RVF_ADDR_ID prof_addr_id; | |
42 | |
43 extern T_RV_RET ti_prf_core( void ); | |
44 extern void ti_prf_init( void ); | |
45 | |
46 /********************************************************************************/ | |
47 /* */ | |
48 /* Function Name: ti_prf_get_info */ | |
49 /* */ | |
50 /* Purpose: This function is used to notify the Bluetooth */ | |
51 /* Environment of the TI profiler's requirements. */ | |
52 /* */ | |
53 /* Input Parameters: */ | |
54 /* */ | |
55 /* Output Parameters: */ | |
56 /* */ | |
57 /* Global Parameters: */ | |
58 /* None. */ | |
59 /* */ | |
60 /* Note: */ | |
61 /* None. */ | |
62 /* */ | |
63 /********************************************************************************/ | |
64 T_RVM_RETURN | |
65 ti_prf_get_info (T_RVM_INFO_SWE *p_info_swe) | |
66 { | |
67 if (!p_info_swe) | |
68 return RVM_INVALID_PARAMETER; | |
69 | |
70 /* SWE info */ | |
71 p_info_swe->swe_type = RVM_SWE_TYPE_4; | |
72 p_info_swe->type_info.type4.swe_use_id = TI_PRF_USE_ID; | |
73 | |
74 memcpy( p_info_swe->type_info.type4.swe_name, "TI_PRF", sizeof("TI_PRF") ); | |
75 | |
76 p_info_swe->type_info.type4.stack_size = TI_PROFILER_TASK_STACK_SIZE; | |
77 p_info_swe->type_info.type4.priority = TI_PROFILER_TASK_PRIORITY; | |
78 | |
79 | |
80 /* Set the return path */ | |
81 p_info_swe->type_info.type4.return_path.callback_func = NULL; | |
82 p_info_swe->type_info.type4.return_path.addr_id = 0; | |
83 | |
84 | |
85 /* memory bank info */ | |
86 p_info_swe->type_info.type4.nb_mem_bank = 1; | |
87 | |
88 memcpy ((UINT8 *) p_info_swe->type_info.type4.mem_bank[0].bank_name, "TI_PRF", RVM_NAME_MAX_LEN); | |
89 p_info_swe->type_info.type4.mem_bank[0].initial_params.size = TI_PROFILER_MB_SIZE; | |
90 p_info_swe->type_info.type4.mem_bank[0].initial_params.watermark = TI_PROFILER_MB_WATERMARK; | |
91 | |
92 /* linked SWE info */ | |
93 /* this SWE does not require any SWE to run */ | |
94 p_info_swe->type_info.type4.nb_linked_swe = 0; | |
95 | |
96 /* generic functions */ | |
97 p_info_swe->type_info.type4.set_info = ti_prf_set_info; | |
98 p_info_swe->type_info.type4.init = ti_prf_env_init; | |
99 p_info_swe->type_info.type4.core = ti_prf_core; | |
100 p_info_swe->type_info.type4.stop = ti_prf_env_stop; | |
101 p_info_swe->type_info.type4.kill = ti_prf_kill; | |
102 | |
103 return RVM_OK; | |
104 } | |
105 | |
106 | |
107 | |
108 /********************************************************************************/ | |
109 /* */ | |
110 /* Function Name: ti_prf_set_info */ | |
111 /* */ | |
112 /* Purpose: This function is used to notify the TI profiler */ | |
113 /* about mb ids and address id . */ | |
114 /* */ | |
115 /* Input Parameters: */ | |
116 /* addr_id: Address id. */ | |
117 /* mb_id[]: array of memory bank ids. */ | |
118 /* */ | |
119 /* Output Parameters: */ | |
120 /* None. */ | |
121 /* */ | |
122 /* Global Parameters: */ | |
123 /* None. */ | |
124 /* */ | |
125 /* Note: */ | |
126 /* None. */ | |
127 /* */ | |
128 /********************************************************************************/ | |
129 | |
130 T_RVM_RETURN | |
131 ti_prf_set_info( T_RVF_ADDR_ID addr_id, | |
132 T_RV_RETURN_PATH return_path[], | |
133 T_RVF_MB_ID bk_id[], | |
134 T_RVM_RETURN (*rvm_error_ft)(T_RVM_NAME swe_name, | |
135 T_RVM_RETURN error_cause, | |
136 T_RVM_ERROR_TYPE error_type, | |
137 T_RVM_STRING error_msg)) | |
138 { | |
139 /* | |
140 ** Save the parameters given by environment | |
141 */ | |
142 | |
143 /* Addr Id */ | |
144 prof_addr_id = addr_id; | |
145 | |
146 /* Bank Id */ | |
147 prof_mb_id = bk_id [0]; | |
148 | |
149 return RVM_OK; | |
150 } | |
151 | |
152 | |
153 | |
154 | |
155 /********************************************************************************/ | |
156 /* */ | |
157 /* Function Name: ti_prf_env_init */ | |
158 /* */ | |
159 /* Purpose: This is the initialization function. */ | |
160 /* It is called by the RVM */ | |
161 /* */ | |
162 /* Input Parameters: */ | |
163 /* None. */ | |
164 /* */ | |
165 /* Output Parameters: */ | |
166 /* None. */ | |
167 /* */ | |
168 /* Global Parameters: */ | |
169 /* None. */ | |
170 /* */ | |
171 /* Note: */ | |
172 /* None. */ | |
173 /* */ | |
174 /********************************************************************************/ | |
175 | |
176 T_RVM_RETURN | |
177 ti_prf_env_init (void) | |
178 { | |
179 | |
180 ti_prf_init(); | |
181 return RVM_OK; | |
182 } | |
183 | |
184 | |
185 | |
186 /* | |
187 ** Functions stop and kill are defined for compilation only | |
188 */ | |
189 T_RVM_RETURN | |
190 ti_prf_env_stop (void) | |
191 { | |
192 return RVM_OK; | |
193 } | |
194 | |
195 | |
196 T_RVM_RETURN | |
197 ti_prf_kill (void) | |
198 { | |
199 return RVM_OK; | |
200 } | |
201 | |
202 #endif |