Commit 538c1110 authored by Charlie Jacobsen's avatar Charlie Jacobsen
Browse files

Remove thc_ipc_reply_with_id.

This is now fulfilled by thc_ipc_reply. Tests updated.

Not tested yet.
parent daf9c1ae
Pipeline #553 skipped
......@@ -205,18 +205,6 @@ thc_ipc_reply(struct fipc_ring_channel *chnl,
}
EXPORT_SYMBOL(thc_ipc_reply);
int
LIBASYNC_FUNC_ATTR
thc_ipc_reply_with_id(struct fipc_ring_channel *chnl,
uint32_t msg_id,
struct fipc_message *response)
{
thc_set_msg_type(response, msg_type_response);
thc_set_msg_id(response, msg_id);
return fipc_send_msg_end(chnl, response);
}
EXPORT_SYMBOL(thc_ipc_reply_with_id);
int
LIBASYNC_FUNC_ATTR
thc_channel_group_init(struct thc_channel_group* channel_group)
......
......@@ -69,7 +69,16 @@ static inline int send_response(struct fipc_ring_channel *chnl,
{
int ret;
struct fipc_message *response;
uint32_t request_cookie = thc_get_request_cookie(recvd_msg);
/*
* Mark recvd msg slot as available
*/
ret = fipc_recv_msg_end(chnl, recvd_msg);
if ( ret ) {
pr_err("Error marking msg as recvd");
return ret;
}
/*
* Response
*/
......@@ -82,20 +91,12 @@ static inline int send_response(struct fipc_ring_channel *chnl,
set_fn_type(response, type);
response->regs[0] = val;
ret = thc_ipc_reply(chnl, recvd_msg, response);
ret = thc_ipc_reply(chnl, request_cookie, response);
if ( ret ) {
pr_err("Error marking message as sent");
return ret;
}
/*
* Mark recvd msg slot as available
*/
ret = fipc_recv_msg_end(chnl, recvd_msg);
if ( ret ) {
pr_err("Error marking msg as recvd");
return ret;
}
return 0;
}
......
......@@ -16,6 +16,9 @@ static int add_2_fn(struct fipc_ring_channel* chan, struct fipc_message* msg)
{
unsigned long result = fipc_get_reg0(msg) + fipc_get_reg1(msg);
struct fipc_message* out_msg;
uint32_t request_cookie = thc_get_request_cookie(msg);
fipc_recv_msg_end(chan, msg);
if( test_fipc_blocking_send_start(chan, &out_msg) )
{
......@@ -25,11 +28,11 @@ static int add_2_fn(struct fipc_ring_channel* chan, struct fipc_message* msg)
fipc_set_reg0(out_msg,result);
set_fn_type(out_msg, ADD_2_FN);
if( thc_ipc_reply(chan, msg, out_msg) )
if( thc_ipc_reply(chan, request_cookie, out_msg) )
{
printk(KERN_ERR "Error sending message for add_2_fn.\n");
}
fipc_recv_msg_end(chan, msg);
return 0;
}
......@@ -76,7 +79,7 @@ static int add_10_fn(struct fipc_ring_channel* thread1_chan, struct fipc_message
fipc_set_reg0(thread1_result, fipc_get_reg0(thread3_response));
fipc_set_reg1(thread1_result, fipc_get_reg1(thread3_response));
if( thc_ipc_reply_with_id(thread1_chan, saved_msg_id , thread1_result) )
if( thc_ipc_reply(thread1_chan, saved_msg_id , thread1_result) )
{
printk(KERN_ERR "Error sending message for add_10_fn.\n");
}
......
......@@ -30,7 +30,7 @@ static int add_10_fn(struct fipc_ring_channel* chan, struct fipc_message* msg)
fipc_set_reg0(out_msg, result);
set_fn_type(out_msg, ADD_10_FN);
if( thc_ipc_reply_with_id(chan, msg_id, out_msg) )
if( thc_ipc_reply(chan, msg_id, out_msg) )
{
printk(KERN_ERR "Error sending message for add_10_fn.\n");
}
......
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