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
ramstore
fast-ipc-module
Commits
3a029e34
Commit
3a029e34
authored
Mar 09, 2016
by
Charles Jacobsen
Browse files
lcd: rpc example working with numbers that jive with old2 code.
Not inlining function calls right now though.
parent
6bbedfea
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/common/ipc.c
View file @
3a029e34
...
...
@@ -82,7 +82,6 @@ static inline int check_rx_slot_msg_waiting(struct fipc_message *slot)
return
slot
->
msg_status
==
FIPC_MSG_STATUS_SENT
;
}
static
inline
int
check_tx_slot_available
(
struct
fipc_message
*
slot
)
{
return
slot
->
msg_status
==
FIPC_MSG_STATUS_AVAILABLE
;
...
...
src/platform/kernel/tests/rpc/callee.c
View file @
3a029e34
...
...
@@ -16,7 +16,7 @@
* happen.
*/
static
unsigned
long
noinline
static
unsigned
long
noinline
null_invocation
(
void
)
{
return
9
;
...
...
@@ -28,13 +28,13 @@ add_constant(unsigned long trans)
return
trans
+
50
;
}
static
unsigned
long
noinline
static
unsigned
long
noinline
add_nums
(
unsigned
long
trans
,
unsigned
long
res1
)
{
return
trans
+
res1
;
}
static
unsigned
long
noinline
static
unsigned
long
noinline
add_3_nums
(
unsigned
long
trans
,
unsigned
long
res1
,
unsigned
long
res2
)
{
return
add_nums
(
trans
,
res1
)
+
res2
;
...
...
@@ -104,6 +104,10 @@ int callee(void *_callee_channel_header)
struct
fipc_message
*
recvd_msg
;
unsigned
long
transaction_id
=
0
;
enum
fn_type
type
;
/*
* Disable interrupts so we truly take over the core
*/
local_irq_disable
();
for
(
transaction_id
=
0
;
transaction_id
<
TRANSACTIONS
;
...
...
@@ -171,6 +175,10 @@ int callee(void *_callee_channel_header)
goto
out
;
}
}
/*
* Re-enable interrupts
*/
local_irq_enable
();
out:
return
ret
;
...
...
src/platform/kernel/tests/rpc/caller.c
View file @
3a029e34
...
...
@@ -394,6 +394,10 @@ int caller(void *_caller_channel_header)
unsigned
long
res1
,
res2
,
res3
,
res4
,
res5
;
unsigned
long
start
,
end
;
int
ret
=
0
;
/*
* Turn off interrupts so that we truly take over the core
*/
local_irq_disable
();
get_random_bytes
(
&
res1
,
sizeof
(
res1
));
res2
=
res1
+
res1
;
...
...
@@ -445,6 +449,10 @@ int caller(void *_caller_channel_header)
}
pr_err
(
"Complete
\n
"
);
/*
* Re-enable interrupts
*/
local_irq_enable
();
out:
return
ret
;
...
...
src/platform/kernel/tests/rpc/main.c
View file @
3a029e34
...
...
@@ -13,7 +13,8 @@
#define CALLER_CPU 1
#define CALLEE_CPU 3
#define CHANNEL_ORDER 2
/* channel is 2^CHANNEL_ORDER pages */
/* channel buffers contain just one message slot */
#define CHANNEL_ORDER ilog2(sizeof(struct fipc_message))
MODULE_LICENSE
(
"GPL"
);
...
...
@@ -61,7 +62,8 @@ static int setup_and_run_test(void)
*/
wake_up_process
(
caller_thread
);
wake_up_process
(
callee_thread
);
msleep
(
1000
);
/* wait for a second so we don't prematurely kill caller/callee */
msleep
(
1000
);
/*
* Wait for them to complete, so we can tear things down
*/
...
...
src/platform/kernel/tests/rpc/rpc.h
View file @
3a029e34
...
...
@@ -20,7 +20,7 @@ enum fn_type {
ADD_6_NUMS
};
/*
m
ust be
divisible by 6... because I call 6 functions in the callee.c
*/
/*
M
ust be
even
*/
#define TRANSACTIONS 60
/* thread main functions */
...
...
src/platform/kernel/tests/test_helpers.h
View file @
3a029e34
...
...
@@ -75,14 +75,16 @@ test_fipc_wait_for_thread(struct task_struct *thread)
static
inline
int
test_fipc_create_channel
(
unsigned
int
buf_
nr_pages_
order
,
/* in
pag
es */
test_fipc_create_channel
(
unsigned
int
buf_order
,
/* in
byt
es */
struct
fipc_ring_channel
**
header_1
,
struct
fipc_ring_channel
**
header_2
)
{
int
ret
;
void
*
buf1
,
*
buf2
;
unsigned
int
buf_nr_pages_order
=
(
buf_order
<
PAGE_SHIFT
?
0
:
buf_order
-
PAGE_SHIFT
);
struct
fipc_ring_channel
*
h1
,
*
h2
;
unsigned
int
buf_order
=
buf_nr_pages_order
+
PAGE_SHIFT
;
/*
* Allocate buffer pages
*/
...
...
@@ -143,10 +145,13 @@ fail1:
static
inline
void
test_fipc_free_channel
(
unsigned
int
buf_
nr_pages_
order
,
/* in
pag
es */
test_fipc_free_channel
(
unsigned
int
buf_order
,
/* in
byt
es */
struct
fipc_ring_channel
*
header_1
,
struct
fipc_ring_channel
*
header_2
)
{
unsigned
int
buf_nr_pages_order
=
(
buf_order
<
PAGE_SHIFT
?
0
:
buf_order
-
PAGE_SHIFT
);
/*
* Free buffers
*/
...
...
Write
Preview
Supports
Markdown
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