Commit f0396801 authored by Charlie Jacobsen's avatar Charlie Jacobsen
Browse files

Add thc_ipc_reply.

parent 030b1af0
Pipeline #537 skipped
......@@ -165,6 +165,7 @@ thc_ipc_call(struct fipc_ring_channel *chnl,
* Get an id for our current awe, and store in request.
*/
msg_id = awe_mapper_create_id();
thc_set_msg_type(request, msg_type_request);
thc_set_msg_id(request, msg_id);
/*
* Send request
......@@ -191,6 +192,17 @@ fail1:
return ret;
}
int
LIBASYNC_FUNC_ATTR
thc_ipc_reply(struct fipc_ring_channel *chnl,
struct fipc_message *request,
struct fipc_message *response)
{
thc_set_msg_type(response, msg_type_response);
thc_set_msg_id(response, thc_get_msg_id(request));
return fipc_send_msg_end(chnl, response);
}
int
LIBASYNC_FUNC_ATTR
thc_channel_group_init(struct thc_channel_group* channel_group)
......
......@@ -47,6 +47,10 @@ int thc_ipc_call(struct fipc_ring_channel *chnl,
struct fipc_message *request,
struct fipc_message **response);
int thc_ipc_reply(struct fipc_ring_channel *chnl,
struct fipc_message *request,
struct fipc_message *response);
int thc_poll_recv_group(struct thc_channel_group* chan_group,
struct thc_channel_group_item** chan_group_item,
struct fipc_message** out_msg);
......
......@@ -86,12 +86,10 @@ static inline int send_response(struct fipc_ring_channel *chnl,
return ret;
}
thc_set_msg_type(response, msg_type_response);
thc_set_msg_id(response, thc_get_msg_id(recvd_msg));
set_fn_type(response, type);
response->regs[0] = val;
ret = fipc_send_msg_end(chnl, response);
ret = thc_ipc_reply(chnl, recvd_msg, response);
if (ret) {
pr_err("Error marking message as sent");
return ret;
......
......@@ -76,8 +76,9 @@ async_add_nums(struct fipc_ring_channel *chan, unsigned long trans,
pr_err("Error getting send message, ret = %d\n", ret);
goto fail;
}
thc_set_msg_type(request, msg_type_request);
/*
* Set up rpc msg
*/
set_fn_type(request, ADD_NUMS);
fipc_set_reg0(request, trans);
fipc_set_reg1(request, res1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment