comparison gsm-fw/riviera/rvm/rvm_gen.h @ 143:afceeeb2cba1

Our nuc-fw is destined to become gsm-fw, so I went ahead and did the big hg mv
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 12 Nov 2013 05:35:48 +0000
parents nuc-fw/riviera/rvm/rvm_gen.h@dd56546ad9e0
children
comparison
equal deleted inserted replaced
142:15d5977390c2 143:afceeeb2cba1
1 /**
2 * @file rvm_gen.h
3 *
4 * Defines the generic types used by the Riviera Environment
5 * and the exported function of the RVM block.
6 *
7 * @author David Lamy-Charrier (d-lamy@ti.com)
8 * @version 0.1
9 */
10
11 /*
12 * Revision History:
13 *
14 * Date Author Modification
15 * -------------------------------------------------------------------
16 * 19/01/2000 David Lamy-Charrier Create.
17 * 11/20/2001 Vincent Oberle Added BUILD_VERSION_NUMBER.
18 * Documentation cleaning
19 *
20 * (C) Copyright 2000 by Texas Instruments Incorporated, All Rights Reserved
21 */
22
23 #ifndef __RVM_GEN_H_
24 #define __RVM_GEN_H_
25
26 #if 0 //#ifndef _WINDOWS
27 #include "config/rv.cfg"
28 #endif
29
30 #include "../rvf/rvf_api.h" /* for memory bank related definitions & GD*/
31 #include "rvm_api.h"
32
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38
39 /* RVM global definitions */
40 #define T_RVM_STRING char *
41 #define T_RVM_ERROR_TYPE UINT32
42
43 #define RVM_MAX_NB_MEM_BK (3)
44
45 #define RVM_MAX_NB_LINKED_SWE (10)
46
47 #define RVM_USED_MAILBOX RVF_TASK_MBOX_0
48
49
50 /* define the 4 SWE types */
51 typedef enum
52 {
53 RVM_SWE_TYPE_1,
54 RVM_SWE_TYPE_2,
55 RVM_SWE_TYPE_3,
56 RVM_SWE_TYPE_4
57 } T_RVM_SWE_TYPE;
58
59
60 /* Memory bank parameters */
61 typedef struct
62 {
63 T_RVF_MB_NAME bank_name;
64 T_RVF_MB_PARAM initial_params;
65 } T_RVM_BK_INFO;
66
67
68 /* RVM callback function pointer type */
69 typedef T_RVM_RETURN (*T_RVM_CB_FUNC)(T_RVM_NAME swe_name,
70 T_RVM_RETURN error_cause,
71 T_RVM_ERROR_TYPE error_type,
72 T_RVM_STRING error_msg);
73
74 /*
75 * Macro used to build the version number from the
76 * - major version number (8 bits)
77 * - minor version number (8 bits)
78 * - build number (16 bits). A 0 indicates this number is not used.
79 */
80 #define BUILD_VERSION_NUMBER(major, minor, build) ( ((major & 0xFF) << 24) | \
81 ((minor & 0xFF) << 16) | \
82 (build & 0xFFFF) )
83
84 /* SWE core function prototype */
85 typedef T_RVM_RETURN (*T_RVM_SWE_CORE_FUNC)(void);
86
87 /* Type1 SWE info */
88 typedef struct
89 {
90 T_RVM_NAME swe_name;
91 T_RVM_USE_ID swe_use_id;
92 UINT32 version;
93 UINT8 nb_mem_bank;
94 T_RVM_BK_INFO mem_bank[RVM_MAX_NB_MEM_BK];
95 UINT8 nb_linked_swe;
96 T_RVM_USE_ID linked_swe_id[RVM_MAX_NB_LINKED_SWE];
97 T_RV_RETURN_PATH return_path;
98 T_RVM_RETURN (* set_info) (T_RVF_ADDR_ID addr_id,
99 T_RV_RETURN_PATH return_path[],
100 T_RVF_MB_ID bk_id_table[],
101 T_RVM_CB_FUNC call_back_error_ft);
102 T_RVM_RETURN (* init) (void);
103 T_RVM_RETURN (* start) (void);
104 T_RVM_RETURN (* stop) (/*T_RV_HDR* hdr*/void); //???
105 T_RVM_RETURN (* kill) (void);
106 } T_RVM_SWE_PASSIVE_INFO;
107
108 /* Type2 SWE info */
109 typedef struct
110 {
111 T_RVM_NAME swe_name;
112 T_RVM_USE_ID swe_use_id;
113 UINT16 stack_size;
114 UINT8 priority;
115 UINT32 version;
116 UINT8 nb_mem_bank;
117 T_RVM_BK_INFO mem_bank[RVM_MAX_NB_MEM_BK];
118 UINT8 nb_linked_swe;
119 T_RVM_USE_ID linked_swe_id[RVM_MAX_NB_LINKED_SWE];
120 T_RV_RETURN_PATH return_path;
121 T_RVF_GD_ID swe_group_directive; /* A-M-E-N-D-E-D! */
122 T_RVM_RETURN (* set_info) (T_RVF_ADDR_ID addr_id,
123 T_RV_RETURN_PATH return_path[],
124 T_RVF_MB_ID bk_id_table[], /* A-M-E-N-E-D-E-D! is table or list??*/
125 T_RVM_CB_FUNC call_back_error_ft);
126 T_RVM_RETURN (* init) (void);
127 T_RVM_RETURN (* start) (void);
128 T_RVM_RETURN (* handle_message) (T_RV_HDR * msg);
129 T_RVM_RETURN (* handle_timer) (T_RV_HDR * msg);
130 T_RVM_RETURN (* stop) (T_RV_HDR* hdr);
131 T_RVM_RETURN (* kill) (void);
132 } T_RVM_SWE_GROUP_MEMBER_INFO;
133
134 /* Type3 SWE info */
135 typedef struct
136 {
137 T_RVM_NAME swe_name;
138 T_RVM_USE_ID swe_use_id;
139 UINT16 stack_size;
140 UINT8 priority;
141 UINT32 version;
142 UINT8 nb_mem_bank;
143 T_RVM_BK_INFO mem_bank[RVM_MAX_NB_MEM_BK];
144 UINT8 nb_linked_swe;
145 T_RVM_USE_ID linked_swe_id[RVM_MAX_NB_LINKED_SWE];
146 T_RV_RETURN_PATH return_path;
147 T_RVM_RETURN (* set_info) (T_RVF_ADDR_ID addr_id,
148 T_RV_RETURN_PATH return_path[],
149 T_RVF_MB_ID bk_id_table[],
150 T_RVM_CB_FUNC call_back_error_ft);
151 T_RVM_RETURN (* init) (void);
152 T_RVM_RETURN (* start) (void);
153 T_RVM_RETURN (* handle_message) (T_RV_HDR * msg);
154 T_RVM_RETURN (* handle_timer) (T_RV_HDR * msg);
155 T_RVM_RETURN (* stop) (T_RV_HDR* hdr);
156 T_RVM_RETURN (* kill) (void);
157 } T_RVM_SWE_SINGLE_INFO;
158
159 /* Type4 SWE info */
160 typedef struct
161 {
162 T_RVM_NAME swe_name;
163 T_RVM_USE_ID swe_use_id;
164 UINT16 stack_size;
165 UINT8 priority;
166 UINT32 version;
167 UINT8 nb_mem_bank;
168 T_RVM_BK_INFO mem_bank[RVM_MAX_NB_MEM_BK];
169 UINT8 nb_linked_swe;
170 T_RVM_USE_ID linked_swe_id[RVM_MAX_NB_LINKED_SWE];
171 T_RV_RETURN_PATH return_path;
172 T_RVM_RETURN (* set_info) (T_RVF_ADDR_ID addr_id,
173 T_RV_RETURN_PATH return_path[],
174 T_RVF_MB_ID bk_id_table[],
175 T_RVM_CB_FUNC call_back_error_ft);
176 T_RVM_RETURN (* init) (void);
177 T_RVM_RETURN (* core) (void);
178 T_RVM_RETURN (* stop) (/*T_RV_HDR* hdr*/void); // could be removed completely except for legacy code
179 T_RVM_RETURN (* kill) (void);
180 } T_RVM_SWE_SELF_MADE_INFO;
181
182
183 /* SWE information */
184 typedef struct
185 {
186 T_RVM_SWE_TYPE swe_type;
187
188 union
189 { T_RVM_SWE_PASSIVE_INFO type1;
190 T_RVM_SWE_GROUP_MEMBER_INFO type2;
191 T_RVM_SWE_SINGLE_INFO type3;
192 T_RVM_SWE_SELF_MADE_INFO type4;
193 } type_info;
194 } T_RVM_INFO_SWE;
195
196
197 /* get info function pointer type */
198 typedef T_RVM_RETURN (*T_RVM_GET_INFO_FUNC) (T_RVM_INFO_SWE * param);
199
200
201 /* type used in the const SWEs array */
202 typedef struct t_rvm_const_swe_info
203 {
204 T_RVM_USE_ID use_id;
205 T_RVM_GET_INFO_FUNC get_info_func;
206 } T_RVM_CONST_SWE_INFO;
207
208
209 #ifdef __cplusplus
210 }
211 #endif
212
213
214 #endif /* __RVM_GEN_H_ */