comparison src/cs/services/fcbm/fcbm_env.c @ 230:baa738eeb842

FCBM code implemented in first pass
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 01 May 2021 10:05:53 +0000
parents
children
comparison
equal deleted inserted replaced
229:7ec0ae23ce76 230:baa738eeb842
1 /*
2 * This module provides the glue to the RiViera environment
3 * for our FCBM SWE.
4 */
5
6 #include "fcbm/fcbm_env.h"
7 #include "rv/rv_general.h"
8 #include "rvf/rvf_api.h"
9 #include "rvm/rvm_priorities.h"
10 #include "rvm/rvm_api.h"
11 #include "rvm/rvm_use_id_list.h"
12 #include <string.h>
13
14 /* Global variables for FCBM addr_id and prim_id */
15 T_RVF_ADDR_ID fcbm_addr_id;
16 T_RVF_MB_ID fcbm_prim_id;
17
18 T_RVM_RETURN fcbm_get_info (T_RVM_INFO_SWE *infoSWE)
19 {
20 /* SWE info */
21
22 infoSWE->swe_type = RVM_SWE_TYPE_4;
23 infoSWE->type_info.type4.swe_use_id = FCBM_USE_ID;
24 memcpy( infoSWE->type_info.type4.swe_name, "FCBM", 5 );
25
26 infoSWE->type_info.type4.stack_size = FCBM_STACK_SIZE;
27 infoSWE->type_info.type4.priority = RVM_FCBM_TASK_PRIORITY;
28
29 /* memory bank info */
30 infoSWE->type_info.type4.nb_mem_bank = 1;
31
32 memcpy ((UINT8 *) infoSWE->type_info.type4.mem_bank[0].bank_name, "FCBM_PRIM", 10);
33 infoSWE->type_info.type4.mem_bank[0].initial_params.size = FCBM_MB_PRIM_SIZE;
34 infoSWE->type_info.type4.mem_bank[0].initial_params.watermark = FCBM_MB_PRIM_WATERMARK;
35
36 /* linked SWE info: we depend on FCHG, R2D, KPD */
37 infoSWE->type_info.type4.nb_linked_swe = 3;
38 infoSWE->type_info.type4.linked_swe_id[0] = FCHG_USE_ID;
39 infoSWE->type_info.type4.linked_swe_id[1] = R2D_USE_ID;
40 infoSWE->type_info.type4.linked_swe_id[2] = KPD_USE_ID;
41
42 /* generic functions */
43 infoSWE->type_info.type4.set_info = fcbm_set_info;
44 infoSWE->type_info.type4.init = fcbm_init;
45 infoSWE->type_info.type4.core = fcbm_core;
46 infoSWE->type_info.type4.stop = fcbm_stop;
47 infoSWE->type_info.type4.kill = fcbm_kill;
48
49 /* Set the return path */
50 infoSWE->type_info.type4.return_path.callback_func = NULL;
51 infoSWE->type_info.type4.return_path.addr_id = 0;
52
53 return RV_OK;
54 }
55
56 T_RVM_RETURN fcbm_set_info(T_RVF_ADDR_ID addr_id,
57 T_RV_RETURN return_path[],
58 T_RVF_MB_ID mbId[],
59 T_RVM_RETURN (*callBackFct) (T_RVM_NAME SWEntName,
60 T_RVM_RETURN errorCause,
61 T_RVM_ERROR_TYPE errorType,
62 T_RVM_STRING errorMsg))
63 {
64 /* Store the addr id */
65 fcbm_addr_id = addr_id;
66
67 /* Store the memory bank id */
68 fcbm_prim_id = mbId[0];
69
70 return RV_OK;
71 }
72
73 T_RVM_RETURN fcbm_init(void)
74 {
75 return RV_OK;
76 }
77
78 T_RVM_RETURN fcbm_stop(void)
79 {
80 return RV_OK;
81 }
82
83 T_RVM_RETURN fcbm_kill(void)
84 {
85 return RV_OK;
86 }