Commit f81aaf7f authored by Vikram Narayanan's avatar Vikram Narayanan

Attempt to fix async_rpc test module

parent 0b94bf68
......@@ -11,8 +11,8 @@ async/boot nonisolated
async/lcd isolated
async_rpc/boot nonisolated
async_rpc/caller isolated
async_rpc/callee isolated
async_rpc/caller_lcd isolated
async_rpc/callee_lcd isolated
bug/boot nonisolated
bug/lcd isolated
......
obj-$(LCD_CONFIG_BUILD_ASYNC_RPC_BOOT) += boot/
obj-$(LCD_CONFIG_BUILD_ASYNC_RPC_CALLER_LCD) += caller_lcd/
obj-$(LCD_CONFIG_BUILD_ASYNC_RPC_CALLEE_LCD) += callee_lcd/
\ No newline at end of file
obj-$(LCD_CONFIG_BUILD_ASYNC_RPC_CALLEE_LCD) += callee_lcd/
......@@ -145,3 +145,5 @@ static void boot_exit(void)
module_init(boot_init);
module_exit(boot_exit);
MODULE_LICENSE("GPL");
......@@ -5,4 +5,4 @@ lcd_test_mod_async_rpc_callee_lcd-y += main.o
lcd_test_mod_async_rpc_callee_lcd-y += $(LIBLCD)
ccflags-y += $(ISOLATED_CFLAGS)
\ No newline at end of file
ccflags-y += $(ISOLATED_CFLAGS)
......@@ -15,6 +15,7 @@
#include <thc_ipc.h>
#include <thc.h>
#include <awe_mapper.h>
#include <linux/module.h>
#include <lcd_config/post_hook.h>
......@@ -92,8 +93,8 @@ static inline int send_response(struct fipc_ring_channel *chnl,
return ret;
}
THC_MSG_TYPE(response) = msg_type_response;
THC_MSG_ID(response) = THC_MSG_ID(recvd_msg);
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;
......@@ -313,7 +314,7 @@ out:
static int async_rpc_callee_init(void)
{
int ret;
int ret = 0;
LCD_MAIN({
......
......@@ -15,9 +15,12 @@
#include <thc_ipc.h>
#include <thc.h>
#include <awe_mapper.h>
#include <linux/module.h>
#include <lcd_config/post_hook.h>
struct thc_channel *tchnl;
static inline int send_and_get_response(
struct fipc_ring_channel *chan,
struct fipc_message *request,
......@@ -38,7 +41,7 @@ static inline int send_and_get_response(
/*
* Try to get the response
*/
ret = thc_ipc_recv(chan, msg_id, &resp);
ret = thc_ipc_recv_response(tchnl, msg_id, &resp);
if (ret) {
pr_err("failed to get a response, ret = %d\n", ret);
goto fail2;
......@@ -115,10 +118,10 @@ async_add_nums(struct fipc_ring_channel *chan, unsigned long trans,
pr_err("Error getting send message, ret = %d\n", ret);
goto fail;
}
msg_id = awe_mapper_create_id();
awe_mapper_create_id(&msg_id);
THC_MSG_TYPE(request) = msg_type_request;
THC_MSG_ID(request) = msg_id;
thc_set_msg_type(request, msg_type_request);
thc_set_msg_id(request, msg_id);
set_fn_type(request, ADD_NUMS);
fipc_set_reg0(request, trans);
fipc_set_reg1(request, res1);
......@@ -292,6 +295,18 @@ static int __noreturn caller_main(void)
tx, rx);
if (ret)
goto out;
tchnl = kzalloc(sizeof(*tchnl), GFP_KERNEL);
if (!tchnl) {
ret = -ENOMEM;
LIBLCD_ERR("alloc failed");
}
ret = thc_channel_init(tchnl, chnl);
if (ret) {
LIBLCD_ERR("error init'ing async channel group item");
}
/*
* Do ipc
*/
......
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