Commit 030b1af0 authored by Charles Jacobsen's avatar Charles Jacobsen
Browse files

Simple example runs with new thc_ipc_call.

parent 9ad24050
Pipeline #536 skipped
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
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/
......@@ -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;
}
......@@ -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;
}
......@@ -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);
}
......
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