annotate src/cs/services/etm/etm_env.c @ 699:f12872b7eb21

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