替换为fastipc

This commit is contained in:
zhangzheng
2024-12-29 21:50:20 +08:00
parent 49060a965b
commit 01cd44d7fd
570 changed files with 735 additions and 598 deletions

View File

@@ -3,4 +3,8 @@
#include "u_env.h"
#include "u_hd_man.h"
int app_load(const char *name, uenv_t *cur_env, pid_t *pid, char *argv[], int arg_cn, char *envp[], int envp_cn, obj_handler_t *p_sem_hd);
int app_load(const char *name, uenv_t *cur_env, pid_t *pid,
char *argv[], int arg_cn,
char *envp[], int envp_cn,
obj_handler_t *p_sem_hd,
int mem_block);

View File

@@ -0,0 +1,4 @@
#pragma once
#include <u_types.h>
int u_fast_ipc_init(uint8_t *stack_array, uint8_t *msg_buf_array, int stack_msgbuf_array_num, size_t stack_size);

View File

@@ -1,6 +0,0 @@
#pragma once
#include "u_types.h"
int cli_ns_register(const char *name, obj_handler_t hd);
int cli_ns_query(const char *name, obj_handler_t *ret_hd);

View File

@@ -441,7 +441,13 @@ RPC_SVR_MSG_TO_BUF_WITHOUT_IMPL(rpc_obj_handler_t_t, int)
*/
RPC_SVR_BUF_TO_MSG_WITHOUT_IMPL(rpc_obj_handler_t_t, int)
{
return len;
if (sizeof(d->data) + rpc_align(len, __alignof(d->data)) > max)
{
return -ETOLONG;
}
len = rpc_align(len, __alignof(d->data));
d->data = *((typeof(d->data) *)(buf + len));
return sizeof(d->data) + rpc_align(len, __alignof(d->data));
}
/**
* @brief Construct a new rpc type init without impl object
@@ -562,6 +568,26 @@ RPC_TYPE_INIT_WITHOUT_IMPL(rpc_obj_handler_t_t)
} \
} \
} while (0)
/**
* @brief 服务端从map里面取出数据
*
*/
#define RPC_SVR_MAP_TO_MSG_IN(rpc_type, var_type, var, dir, buf, off, max) \
do \
{ \
if (rpc_type == RPC_TYPE_BUF) \
{ \
if (dir == RPC_DIR_IN || dir == RPC_DIR_INOUT) \
{ \
int ret = rpc_svr_buf_to_msg_##var_type(var, (uint8_t *)(buf), off, max); \
if (ret < 0) \
{ \
return msg_tag_init4(0, 0, 0, ret); \
} \
off = ret; \
} \
} \
} while (0)
/**
* @brief 填充映射数据
*

View File

@@ -11,29 +11,37 @@
* @brief 该宏用于生成一个客户端的调用函数(传递一个参数)
*
*/
#define RPC_GENERATION_CALL1(struct_type, prot, op, func_name, cli_type0, svr_type0, dir0, rpc_type0, name0) \
#define RPC_GENERATION_CALL1(is_fast, struct_type, prot, op, func_name, cli_type0, svr_type0, dir0, rpc_type0, name0) \
msg_tag_t struct_type##_##func_name##_call(obj_handler_t hd, cli_type0 *var0) \
{ \
void *buf; \
ipc_msg_t *msg_ipc; \
\
thread_msg_buf_get(-1, (umword_t *)(&buf), NULL); \
thread_msg_buf_get(-1, (umword_t *)(&buf), NULL); \
msg_ipc = (ipc_msg_t *)buf; \
\
int off = 0; \
int off_map = 0; \
int off_buf = 0; \
int ret = -1; \
umword_t op_val = op; \
umword_t op_val = op; \
/*拷贝op*/ \
rpc_memcpy(msg_ipc->msg_buf, &op_val, sizeof(op_val)); \
off += rpc_align(sizeof(op_val), __alignof(op)); \
\
RPC_CLI_MSG_TO_BUF_IN(rpc_type0, cli_type0, var0, dir0, (uint8_t *)msg_ipc->msg_buf, off); \
PRC_CLI_FILL_MAP_BUF(rpc_type0, cli_type0, var0, dir0, (uint8_t *)msg_ipc->map_buf, off_map); \
/*msg_tag_t tag = dispatch_test(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_map, WORD_BYTES), 0), msg_ipc);*/ \
msg_tag_t tag = thread_ipc_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_map, WORD_BYTES), prot), hd, \
ipc_timeout_create2(0, 0)); \
\
PRC_CLI_FILL_MAP_BUF(rpc_type0, cli_type0, var0, dir0, (uint8_t *)msg_ipc->map_buf, off_buf); \
/*msg_tag_t tag = dispatch_test(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), 0), msg_ipc);*/ \
msg_tag_t tag; \
if (is_fast) \
{ \
tag = thread_ipc_fast_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), \
hd, 1111, 2222, 3333); \
} \
else \
{ \
tag = thread_ipc_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), hd, \
ipc_timeout_create2(0, 0)); \
} \
if (msg_tag_get_val(tag) < 0) \
{ \
return tag; \
@@ -46,35 +54,38 @@
* @brief 该宏用于生成服务端的分发函数(一个参数)
*
*/
#define RPC_GENERATION_DISPATCH1(struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0) \
msg_tag_t struct_type##_##func_name##_dispatch(struct_type *obj, msg_tag_t tag, ipc_msg_t *ipc_msg) \
{ \
svr_type0 var0; \
size_t op_val; \
uint8_t *value = (uint8_t *)(ipc_msg->msg_buf); \
int off = 0; \
\
RPC_TYPE_INIT_FUNC_CALL(svr_type0, &var0); \
\
/*取得op*/ \
op_val = *((typeof(op) *)value); \
off += sizeof(typeof(op)); \
off = rpc_align(off, __alignof(typeof(op))); \
\
RPC_SVR_BUF_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, value, off, tag.msg_buf_len *WORD_BYTES); \
\
short ret_val = struct_type##_##func_name##_op(obj, &var0); \
\
if (ret_val < 0) \
{ \
return msg_tag_init4(0, 0, 0, ret_val); \
} \
off = 0; \
int off_map = 0; \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type0, svr_type0, &var0, dir0, value, off); \
PRC_SVR_FILL_MAP_BUF(rpc_type0, svr_type0, &var0, dir0, ipc_msg->map_buf, off_map); \
return msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_map, WORD_BYTES), ret_val); \
#define RPC_GENERATION_DISPATCH1(struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0) \
msg_tag_t struct_type##_##func_name##_dispatch(struct_type *obj, msg_tag_t tag, ipc_msg_t *ipc_msg) \
{ \
svr_type0 var0; \
size_t op_val; \
uint8_t *value = (uint8_t *)(ipc_msg->msg_buf); \
uint8_t *map_value = (uint8_t *)(ipc_msg->map_buf); \
int off = 0; \
int map_off = 0; \
\
RPC_TYPE_INIT_FUNC_CALL(svr_type0, &var0); \
\
/*取得op*/ \
op_val = *((typeof(op) *)value); \
off += sizeof(typeof(op)); \
off = rpc_align(off, __alignof(typeof(op))); \
\
RPC_SVR_BUF_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, value, off, tag.msg_buf_len *WORD_BYTES); \
RPC_SVR_MAP_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, map_value, map_off, tag.map_buf_len *WORD_BYTES); \
\
short ret_val = struct_type##_##func_name##_op(obj, &var0); \
\
if (ret_val < 0) \
{ \
return msg_tag_init4(0, 0, 0, ret_val); \
} \
off = 0; \
int off_map = 0; \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type0, svr_type0, &var0, dir0, value, off); \
PRC_SVR_FILL_MAP_BUF(rpc_type0, svr_type0, &var0, dir0, ipc_msg->map_buf, off_map); \
return msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_map, WORD_BYTES), ret_val); \
}
/**
* @brief 该宏用于生成一个服务端的实现(一个参数)

View File

@@ -8,7 +8,7 @@
#include <sys/types.h>
#include <errno.h>
#define RPC_GENERATION_CALL2(struct_type, prot, op, func_name, \
#define RPC_GENERATION_CALL2(is_fast, struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0, \
cli_type1, svr_type1, dir1, rpc_type1, name1) \
msg_tag_t struct_type##_##func_name##_call(obj_handler_t hd, cli_type0 *var0, cli_type1 *var1) \
@@ -16,13 +16,13 @@
void *buf; \
ipc_msg_t *msg_ipc; \
\
thread_msg_buf_get(-1, (umword_t *)(&buf), NULL); \
thread_msg_buf_get(-1, (umword_t *)(&buf), NULL); \
msg_ipc = (ipc_msg_t *)buf; \
\
int off = 0; \
int off_buf = 0; \
int ret = -1; \
umword_t op_val = op; \
umword_t op_val = op; \
/*拷贝op*/ \
rpc_memcpy(msg_ipc->msg_buf, &op_val, sizeof(op_val)); \
off += rpc_align(sizeof(op_val), __alignof(op)); \
@@ -32,9 +32,17 @@
RPC_CLI_MSG_TO_BUF_IN(rpc_type1, cli_type1, var1, dir1, (uint8_t *)msg_ipc->msg_buf, off); \
PRC_CLI_FILL_MAP_BUF(rpc_type1, cli_type1, var1, dir1, (uint8_t *)msg_ipc->map_buf, off_buf); \
/*msg_tag_t tag = dispatch_test(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), 0), msg_ipc); */ \
msg_tag_t tag = thread_ipc_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), hd, \
ipc_timeout_create2(0, 0)); \
\
msg_tag_t tag; \
if (is_fast) \
{ \
tag = thread_ipc_fast_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), \
hd, 1111, 2222, 3333); \
} \
else \
{ \
tag = thread_ipc_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), hd, \
ipc_timeout_create2(0, 0)); \
} \
if (msg_tag_get_val(tag) < 0) \
{ \
return tag; \
@@ -45,45 +53,50 @@
return tag; \
}
#define RPC_GENERATION_DISPATCH2(struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0, \
cli_type1, svr_type1, dir1, rpc_type1, name1) \
msg_tag_t struct_type##_##func_name##_dispatch(struct_type *obj, msg_tag_t tag, ipc_msg_t *ipc_msg) \
{ \
svr_type0 var0; \
svr_type1 var1; \
size_t op_val; \
uint8_t *value = (uint8_t *)(ipc_msg->msg_buf); \
int off = 0; \
\
RPC_TYPE_INIT_FUNC_CALL(svr_type0, &var0); \
RPC_TYPE_INIT_FUNC_CALL(svr_type1, &var1); \
\
/*取得op*/ \
op_val = *((typeof(op) *)value); \
if (op_val != op) \
{ \
return msg_tag_init4(0, 0, 0, -EPROTO); \
} \
off += sizeof(typeof(op)); \
off = rpc_align(off, __alignof(typeof(op))); \
\
RPC_SVR_BUF_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, value, off, tag.msg_buf_len *WORD_BYTES); \
RPC_SVR_BUF_TO_MSG_IN(rpc_type1, svr_type1, &var1, dir1, value, off, tag.msg_buf_len *WORD_BYTES); \
\
short ret_val = struct_type##_##func_name##_op(obj, &var0, &var1); \
\
if (ret_val < 0) \
{ \
return msg_tag_init4(0, 0, 0, ret_val); \
} \
off = 0; \
int off_map = 0; \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type0, svr_type0, &var0, dir0, value, off); \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type1, svr_type1, &var1, dir1, value, off); \
PRC_SVR_FILL_MAP_BUF(rpc_type0, svr_type0, &var0, dir0, ipc_msg->map_buf, off_map); \
PRC_SVR_FILL_MAP_BUF(rpc_type1, svr_type1, &var1, dir1, ipc_msg->map_buf, off_map); \
return msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_map, WORD_BYTES), ret_val); \
#define RPC_GENERATION_DISPATCH2(struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0, \
cli_type1, svr_type1, dir1, rpc_type1, name1) \
msg_tag_t struct_type##_##func_name##_dispatch(struct_type *obj, msg_tag_t tag, ipc_msg_t *ipc_msg) \
{ \
svr_type0 var0; \
svr_type1 var1; \
size_t op_val; \
uint8_t *value = (uint8_t *)(ipc_msg->msg_buf); \
uint8_t *map_value = (uint8_t *)(ipc_msg->map_buf); \
int off = 0; \
int map_off = 0; \
\
RPC_TYPE_INIT_FUNC_CALL(svr_type0, &var0); \
RPC_TYPE_INIT_FUNC_CALL(svr_type1, &var1); \
\
RPC_SVR_MAP_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, map_value, map_off, tag.map_buf_len *WORD_BYTES); \
RPC_SVR_MAP_TO_MSG_IN(rpc_type1, svr_type1, &var1, dir1, map_value, map_off, tag.map_buf_len *WORD_BYTES); \
\
/*取得op*/ \
op_val = *((typeof(op) *)value); \
if (op_val != op) \
{ \
return msg_tag_init4(0, 0, 0, -EPROTO); \
} \
off += sizeof(typeof(op)); \
off = rpc_align(off, __alignof(typeof(op))); \
\
RPC_SVR_BUF_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, value, off, tag.msg_buf_len *WORD_BYTES); \
RPC_SVR_BUF_TO_MSG_IN(rpc_type1, svr_type1, &var1, dir1, value, off, tag.msg_buf_len *WORD_BYTES); \
\
short ret_val = struct_type##_##func_name##_op(obj, &var0, &var1); \
\
if (ret_val < 0) \
{ \
return msg_tag_init4(0, 0, 0, ret_val); \
} \
off = 0; \
int off_map = 0; \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type0, svr_type0, &var0, dir0, value, off); \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type1, svr_type1, &var1, dir1, value, off); \
PRC_SVR_FILL_MAP_BUF(rpc_type0, svr_type0, &var0, dir0, ipc_msg->map_buf, off_map); \
PRC_SVR_FILL_MAP_BUF(rpc_type1, svr_type1, &var1, dir1, ipc_msg->map_buf, off_map); \
return msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_map, WORD_BYTES), ret_val); \
}
#define RPC_GENERATION_OP2(struct_type, prot, op, func_name, \

View File

@@ -8,7 +8,7 @@
#include <sys/types.h>
#include <errno.h>
#define RPC_GENERATION_CALL3(struct_type, prot, op, func_name, \
#define RPC_GENERATION_CALL3(is_fast, struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0, \
cli_type1, svr_type1, dir1, rpc_type1, name1, \
cli_type2, svr_type2, dir2, rpc_type2, name2) \
@@ -17,15 +17,15 @@
void *buf; \
ipc_msg_t *msg_ipc; \
\
thread_msg_buf_get(-1, (umword_t *)(&buf), NULL); \
thread_msg_buf_get(-1, (umword_t *)(&buf), NULL); \
msg_ipc = (ipc_msg_t *)buf; \
\
int off = 0; \
int off_buf = 0; \
int ret = -1; \
umword_t op_val = op; \
umword_t op_val = op; \
/*拷贝op*/ \
rpc_memcpy(msg_ipc->msg_buf, &op_val, __alignof(op_val)); \
rpc_memcpy(msg_ipc->msg_buf, &op_val, __alignof(op_val)); \
off += rpc_align(sizeof(op_val), __alignof(op)); \
\
RPC_CLI_MSG_TO_BUF_IN(rpc_type0, cli_type0, var0, dir0, (uint8_t *)msg_ipc->msg_buf, off); \
@@ -35,9 +35,17 @@
RPC_CLI_MSG_TO_BUF_IN(rpc_type2, cli_type2, var2, dir2, (uint8_t *)msg_ipc->msg_buf, off); \
PRC_CLI_FILL_MAP_BUF(rpc_type2, cli_type2, var2, dir2, (uint8_t *)msg_ipc->map_buf, off_buf); \
/*msg_tag_t tag = dispatch_test(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), 0), msg_ipc); */ \
msg_tag_t tag = thread_ipc_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), hd, \
ipc_timeout_create2(0, 0)); \
\
msg_tag_t tag; \
if (is_fast) \
{ \
tag = thread_ipc_fast_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), \
hd, 1111, 2222, 3333); \
} \
else \
{ \
tag = thread_ipc_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), hd, \
ipc_timeout_create2(0, 0)); \
} \
if (msg_tag_get_val(tag) < 0) \
{ \
return tag; \
@@ -49,51 +57,56 @@
return tag; \
}
#define RPC_GENERATION_DISPATCH3(struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0, \
cli_type1, svr_type1, dir1, rpc_type1, name1, \
cli_type2, svr_type2, dir2, rpc_type2, name2) \
msg_tag_t struct_type##_##func_name##_dispatch(struct_type *obj, msg_tag_t tag, ipc_msg_t *ipc_msg) \
{ \
svr_type0 var0; \
svr_type1 var1; \
svr_type2 var2; \
size_t op_val; \
uint8_t *value = (uint8_t *)(ipc_msg->msg_buf); \
int off = 0; \
\
RPC_TYPE_INIT_FUNC_CALL(svr_type0, &var0); \
RPC_TYPE_INIT_FUNC_CALL(svr_type1, &var1); \
RPC_TYPE_INIT_FUNC_CALL(svr_type2, &var2); \
\
/*取得op*/ \
op_val = *((typeof(op) *)value); \
if (op_val != op) \
{ \
return msg_tag_init4(0, 0, 0, -EPROTO); \
} \
off += sizeof(typeof(op)); \
off = rpc_align(off, __alignof(typeof(op))); \
\
RPC_SVR_BUF_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, value, off, tag.msg_buf_len *WORD_BYTES); \
RPC_SVR_BUF_TO_MSG_IN(rpc_type1, svr_type1, &var1, dir1, value, off, tag.msg_buf_len *WORD_BYTES); \
RPC_SVR_BUF_TO_MSG_IN(rpc_type2, svr_type2, &var2, dir2, value, off, tag.msg_buf_len *WORD_BYTES); \
\
short ret_val = struct_type##_##func_name##_op(obj, &var0, &var1, &var2); \
\
if (ret_val < 0) \
{ \
return msg_tag_init4(0, 0, 0, ret_val); \
} \
off = 0; \
int off_map = 0; \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type0, svr_type0, &var0, dir0, value, off); \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type1, svr_type1, &var1, dir1, value, off); \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type2, svr_type2, &var2, dir2, value, off); \
PRC_SVR_FILL_MAP_BUF(rpc_type0, svr_type0, &var0, dir0, ipc_msg->map_buf, off_map); \
PRC_SVR_FILL_MAP_BUF(rpc_type1, svr_type1, &var1, dir1, ipc_msg->map_buf, off_map); \
PRC_SVR_FILL_MAP_BUF(rpc_type2, svr_type2, &var2, dir2, ipc_msg->map_buf, off_map); \
return msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_map, WORD_BYTES), ret_val); \
#define RPC_GENERATION_DISPATCH3(struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0, \
cli_type1, svr_type1, dir1, rpc_type1, name1, \
cli_type2, svr_type2, dir2, rpc_type2, name2) \
msg_tag_t struct_type##_##func_name##_dispatch(struct_type *obj, msg_tag_t tag, ipc_msg_t *ipc_msg) \
{ \
svr_type0 var0; \
svr_type1 var1; \
svr_type2 var2; \
size_t op_val; \
uint8_t *value = (uint8_t *)(ipc_msg->msg_buf); \
uint8_t *map_value = (uint8_t *)(ipc_msg->map_buf); \
int off = 0; \
int map_off = 0; \
\
RPC_TYPE_INIT_FUNC_CALL(svr_type0, &var0); \
RPC_TYPE_INIT_FUNC_CALL(svr_type1, &var1); \
RPC_TYPE_INIT_FUNC_CALL(svr_type2, &var2); \
RPC_SVR_MAP_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, map_value, map_off, tag.map_buf_len *WORD_BYTES); \
RPC_SVR_MAP_TO_MSG_IN(rpc_type1, svr_type1, &var1, dir1, map_value, map_off, tag.map_buf_len *WORD_BYTES); \
RPC_SVR_MAP_TO_MSG_IN(rpc_type2, svr_type2, &var2, dir2, map_value, map_off, tag.map_buf_len *WORD_BYTES); \
\
/*取得op*/ \
op_val = *((typeof(op) *)value); \
if (op_val != op) \
{ \
return msg_tag_init4(0, 0, 0, -EPROTO); \
} \
off += sizeof(typeof(op)); \
off = rpc_align(off, __alignof(typeof(op))); \
\
RPC_SVR_BUF_TO_MSG_IN(rpc_type0, svr_type0, &var0, dir0, value, off, tag.msg_buf_len *WORD_BYTES); \
RPC_SVR_BUF_TO_MSG_IN(rpc_type1, svr_type1, &var1, dir1, value, off, tag.msg_buf_len *WORD_BYTES); \
RPC_SVR_BUF_TO_MSG_IN(rpc_type2, svr_type2, &var2, dir2, value, off, tag.msg_buf_len *WORD_BYTES); \
\
short ret_val = struct_type##_##func_name##_op(obj, &var0, &var1, &var2); \
\
if (ret_val < 0) \
{ \
return msg_tag_init4(0, 0, 0, ret_val); \
} \
off = 0; \
int off_map = 0; \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type0, svr_type0, &var0, dir0, value, off); \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type1, svr_type1, &var1, dir1, value, off); \
RPC_SVR_MSG_TO_BUF_OUT(rpc_type2, svr_type2, &var2, dir2, value, off); \
PRC_SVR_FILL_MAP_BUF(rpc_type0, svr_type0, &var0, dir0, ipc_msg->map_buf, off_map); \
PRC_SVR_FILL_MAP_BUF(rpc_type1, svr_type1, &var1, dir1, ipc_msg->map_buf, off_map); \
PRC_SVR_FILL_MAP_BUF(rpc_type2, svr_type2, &var2, dir2, ipc_msg->map_buf, off_map); \
return msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_map, WORD_BYTES), ret_val); \
}
#define RPC_GENERATION_OP3(struct_type, prot, op, func_name, \

View File

@@ -8,7 +8,7 @@
#include <sys/types.h>
#include <errno.h>
#define RPC_GENERATION_CALL5(struct_type, prot, op, func_name, \
#define RPC_GENERATION_CALL5(is_fast, struct_type, prot, op, func_name, \
cli_type0, svr_type0, dir0, rpc_type0, name0, \
cli_type1, svr_type1, dir1, rpc_type1, name1, \
cli_type2, svr_type2, dir2, rpc_type2, name2, \
@@ -41,9 +41,17 @@
RPC_CLI_MSG_TO_BUF_IN(rpc_type4, cli_type4, var4, dir4, (uint8_t *)msg_ipc->msg_buf, off); \
PRC_CLI_FILL_MAP_BUF(rpc_type4, cli_type4, var4, dir4, (uint8_t *)msg_ipc->map_buf, off_buf); \
/*msg_tag_t tag = dispatch_test(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), 0), msg_ipc); */ \
msg_tag_t tag = thread_ipc_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), hd, \
ipc_timeout_create2(0, 0)); \
\
msg_tag_t tag; \
if (is_fast) \
{ \
tag = thread_ipc_fast_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), \
hd, 1111, 2222, 3333); \
} \
else \
{ \
tag = thread_ipc_call(msg_tag_init4(0, ROUND_UP(off, WORD_BYTES), ROUND_UP(off_buf, WORD_BYTES), prot), hd, \
ipc_timeout_create2(0, 0)); \
} \
if (msg_tag_get_val(tag) < 0) \
{ \
return tag; \

View File

@@ -1,4 +1,6 @@
#pragma once
#include "u_thread.h"
obj_handler_t rpc_hd_get(int inx);
int rpc_hd_alloc_raw(ipc_msg_t *msg);
int rpc_hd_alloc(void);