Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xcap
xcap-capability-linux
Commits
f81aaf7f
Commit
f81aaf7f
authored
Nov 17, 2018
by
Vikram Narayanan
Browse files
Attempt to fix async_rpc test module
parent
0b94bf68
Changes
6
Hide whitespace changes
Inline
Side-by-side
lcd-domains/scripts/defaultconfig
View file @
f81aaf7f
...
...
@@ -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
...
...
lcd-domains/test_mods/async_rpc/Kbuild
View file @
f81aaf7f
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/
lcd-domains/test_mods/async_rpc/boot/main.c
View file @
f81aaf7f
...
...
@@ -145,3 +145,5 @@ static void boot_exit(void)
module_init
(
boot_init
);
module_exit
(
boot_exit
);
MODULE_LICENSE
(
"GPL"
);
lcd-domains/test_mods/async_rpc/callee_lcd/Kbuild
View file @
f81aaf7f
...
...
@@ -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)
lcd-domains/test_mods/async_rpc/callee_lcd/main.c
View file @
f81aaf7f
...
...
@@ -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
({
...
...
lcd-domains/test_mods/async_rpc/caller_lcd/main.c
View file @
f81aaf7f
...
...
@@ -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
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment