comparison src/cs/services/fcbm/fcbm_send_msg.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 * The implementation of our fcbm_message_to_task() function lives here.
3 */
4
5 #include "fcbm/fcbm_env.h"
6 #include "fcbm/fcbm_send_msg.h"
7 #include "rv/rv_general.h"
8 #include "rvf/rvf_api.h"
9 #include "rvm/rvm_use_id_list.h"
10
11 T_RV_RET fcbm_message_to_task(enum fcbm_msg_id msg_id)
12 {
13 T_RV_HDR *msg;
14
15 if (rvf_get_buf(fcbm_prim_id, sizeof(T_RV_HDR),
16 (T_RVF_BUFFER **)&msg) == RVF_RED) {
17 rvf_send_trace(
18 "rvf_get_buf() failed in fcbm_message_to_task()", 46,
19 NULL_PARAM, RV_TRACE_LEVEL_ERROR, FCBM_USE_ID);
20 return RV_MEMORY_ERR;
21 }
22 msg->msg_id = msg_id;
23 msg->src_addr_id = fcbm_addr_id;
24 msg->dest_addr_id = fcbm_addr_id;
25 msg->callback_func = NULL;
26 if (rvf_send_msg(fcbm_addr_id, msg) != RV_OK) {
27 rvf_send_trace("fcbm_message_to_task(): Send failed!", 36,
28 NULL_PARAM, RV_TRACE_LEVEL_ERROR, FCBM_USE_ID);
29 rvf_free_buf(msg);
30 return RV_INTERNAL_ERR;
31 }
32 return RV_OK;
33 }