Skip to content
GitLab
Menu
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-async-module
Commits
030b1af0
Commit
030b1af0
authored
Mar 30, 2016
by
Charles Jacobsen
Browse files
Simple example runs with new thc_ipc_call.
parent
9ad24050
Pipeline
#536
skipped
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/common/thc.c
View file @
030b1af0
...
...
@@ -549,6 +549,7 @@ static void thc_start_rts(void) {
}
static
void
thc_end_rts
(
void
)
{
void
*
next_stack
;
PTState_t
*
pts
=
PTS
();
assert
(
pts
->
doneInit
&&
"Not initialized RTS"
);
DEBUG_INIT
(
DEBUGPRINTF
(
DEBUG_INIT_PREFIX
"> Ending
\n
"
));
...
...
@@ -558,7 +559,6 @@ static void thc_end_rts(void) {
// book-keeping: once the dispatch loop is done, then the
// number of stacks on our free list should equal the number
// allocated from the OS.
void
*
next_stack
;
while
(
pts
->
free_stacks
!=
NULL
)
{
next_stack
=
pts
->
free_stacks
->
next
;
#ifdef LINUX_KERNEL
...
...
src/common/thc_ipc.c
View file @
030b1af0
...
...
@@ -222,8 +222,6 @@ thc_channel_group_item_remove(struct thc_channel_group* channel_group,
{
list_del_init
(
&
(
item
->
list
));
channel_group
->
size
--
;
return
0
;
}
EXPORT_SYMBOL
(
thc_channel_group_item_remove
);
...
...
src/include/thc_ipc.h
View file @
030b1af0
...
...
@@ -11,7 +11,7 @@
static
inline
uint32_t
thc_get_msg_type
(
struct
fipc_message
*
msg
)
{
/* Caught at compile time */
BUILD_BUG_ON
(
THC_RESERVED_MSG_FLAG_BITS
>
32
)
BUILD_BUG_ON
(
THC_RESERVED_MSG_FLAG_BITS
>
32
)
;
return
fipc_get_flags
(
msg
)
&
0x3
;
}
...
...
@@ -27,7 +27,7 @@ static inline uint32_t thc_get_msg_id(struct fipc_message *msg)
/* shift off type bits, and mask off msg id */
return
(
fipc_get_flags
(
msg
)
>>
2
)
&
((
1
<<
AWE_TABLE_ORDER
)
-
1
);
}
static
inline
uint32_t
thc_set_msg_id
(
struct
fipc_message
*
msg
,
static
inline
void
thc_set_msg_id
(
struct
fipc_message
*
msg
,
uint32_t
msg_id
)
{
uint32_t
flags
=
fipc_get_flags
(
msg
);
...
...
@@ -43,6 +43,10 @@ int thc_ipc_recv(struct fipc_ring_channel *chnl,
unsigned
long
msg_id
,
struct
fipc_message
**
out_msg
);
int
thc_ipc_call
(
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
);
...
...
src/tests/Kbuild.in
View file @
030b1af0
obj-m += simple/
obj-m += dispatch/
obj-m += ctx-switch/
obj-m += async-msg-benchmarks/
#
obj-m += dispatch/
#
obj-m += ctx-switch/
#
obj-m += async-msg-benchmarks/
src/tests/simple/callee.c
View file @
030b1af0
...
...
@@ -100,7 +100,7 @@ static inline int send_response(struct fipc_ring_channel *chnl,
return
0
;
}
int
callee
(
void
*
_callee_channel_header
)
int
__
callee
(
void
*
_callee_channel_header
)
{
int
ret
=
0
;
unsigned
long
temp_res
;
...
...
@@ -179,3 +179,12 @@ int callee(void *_callee_channel_header)
out:
return
ret
;
}
int
callee
(
void
*
_callee_channel_header
)
{
int
result
;
LCD_MAIN
({
result
=
__callee
(
_callee_channel_header
);
});
return
result
;
}
src/tests/simple/caller.c
View file @
030b1af0
...
...
@@ -67,7 +67,6 @@ async_add_nums(struct fipc_ring_channel *chan, unsigned long trans,
{
struct
fipc_message
*
request
;
struct
fipc_message
*
response
;
uint32_t
msg_id
;
int
ret
;
/*
* Set up request
...
...
@@ -103,14 +102,11 @@ fail:
return
ret
;
}
int
caller
(
void
*
_caller_channel_header
)
int
__
caller
(
void
*
_caller_channel_header
)
{
struct
fipc_ring_channel
*
chan
=
_caller_channel_header
;
unsigned
long
transaction_id
=
0
;
int
ret
=
0
;
volatile
void
**
frame
=
(
volatile
void
**
)
__builtin_frame_address
(
0
);
volatile
void
*
ret_addr
=
*
(
frame
+
1
);
*
(
frame
+
1
)
=
NULL
;
thc_init
();
/*
...
...
@@ -134,9 +130,14 @@ int caller(void *_caller_channel_header)
pr_err
(
"Complete
\n
"
);
thc_done
();
*
(
frame
+
1
)
=
ret_addr
;
return
ret
;
}
int
caller
(
void
*
_caller_channel_header
)
{
int
result
;
LCD_MAIN
({
result
=
__caller
(
_caller_channel_header
);
});
return
result
;
}
src/tests/simple/rpc.h
View file @
030b1af0
...
...
@@ -9,6 +9,7 @@
#define LIBFIPC_RPC_TEST_H
#include <libfipc.h>
#include <thc_ipc.h>
enum
fn_type
{
NULL_INVOCATION
,
...
...
@@ -44,7 +45,7 @@ set_fn_type(struct fipc_message *msg, enum fn_type type)
/* erase old type */
flags
&=
((
1
<<
THC_RESERVED_MSG_FLAG_BITS
)
-
1
);
/* install new type */
flags
|=
(
type
<<
THC_RESERVED_MSG_FLAG_BITS
)
flags
|=
(
type
<<
THC_RESERVED_MSG_FLAG_BITS
)
;
fipc_set_flags
(
msg
,
flags
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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