Add NOP rpc call
This commit is contained in:
parent
f59c3b52c5
commit
0d69c8b0ad
@ -34,6 +34,7 @@ enum rpc_mtype {
|
|||||||
RPC_MTYPE_PROCESS_GET_ALL_PIDS,
|
RPC_MTYPE_PROCESS_GET_ALL_PIDS,
|
||||||
RPC_MTYPE_ALLOCATE_PID,
|
RPC_MTYPE_ALLOCATE_PID,
|
||||||
RPC_MTYPE_GET_BOOTINFO,
|
RPC_MTYPE_GET_BOOTINFO,
|
||||||
|
RPC_MTYPE_NOP,
|
||||||
RPC_MTYPE_COUNT // How many message types exist
|
RPC_MTYPE_COUNT // How many message types exist
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -55,6 +56,10 @@ struct aos_rpc {
|
|||||||
*/
|
*/
|
||||||
errval_t aos_rpc_init(struct aos_rpc *rpc, struct lmp_chan *chan, void *shared_mem);
|
errval_t aos_rpc_init(struct aos_rpc *rpc, struct lmp_chan *chan, void *shared_mem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief rpc call for RPC performance measurements (performs no action except a nop)
|
||||||
|
*/
|
||||||
|
errval_t aos_rpc_nop(struct aos_rpc *chan);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Send a number.
|
* \brief Send a number.
|
||||||
|
|||||||
@ -95,6 +95,17 @@ static errval_t do_aos_rpc(
|
|||||||
return recv.words[0];
|
return recv.words[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
errval_t
|
||||||
|
aos_rpc_nop(struct aos_rpc *rpc) {
|
||||||
|
errval_t err;
|
||||||
|
|
||||||
|
err = do_aos_rpc(
|
||||||
|
rpc, RPC_MTYPE_NOP,
|
||||||
|
NULL_CAP, 0, 0, 0,
|
||||||
|
NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
errval_t
|
errval_t
|
||||||
aos_rpc_send_number(struct aos_rpc *rpc, uintptr_t num) {
|
aos_rpc_send_number(struct aos_rpc *rpc, uintptr_t num) {
|
||||||
|
|||||||
@ -121,6 +121,16 @@ static void rpc_server_async_reply(struct generic_rpc_server *g_rpc, errval_t re
|
|||||||
|
|
||||||
// RPC handlers
|
// RPC handlers
|
||||||
|
|
||||||
|
static errval_t handle_rpc_nop(
|
||||||
|
struct generic_rpc_server *rpc,
|
||||||
|
struct capref arg_cap, size_t arg_size, uintptr_t arg0, uintptr_t arg1,
|
||||||
|
struct capref *ret_cap, size_t *ret_size, uintptr_t *ret0, uintptr_t *ret1
|
||||||
|
) {
|
||||||
|
__asm volatile("nop");
|
||||||
|
|
||||||
|
return SYS_ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static errval_t handle_rpc_send_number(
|
static errval_t handle_rpc_send_number(
|
||||||
struct generic_rpc_server *rpc,
|
struct generic_rpc_server *rpc,
|
||||||
struct capref arg_cap, size_t arg_size, uintptr_t arg0, uintptr_t arg1,
|
struct capref arg_cap, size_t arg_size, uintptr_t arg0, uintptr_t arg1,
|
||||||
@ -442,5 +452,6 @@ rpc_handler_t rpc_handlers[RPC_MTYPE_COUNT] = {
|
|||||||
[RPC_MTYPE_PROCESS_GET_NAME] = handle_rpc_process_get_name,
|
[RPC_MTYPE_PROCESS_GET_NAME] = handle_rpc_process_get_name,
|
||||||
[RPC_MTYPE_PROCESS_GET_ALL_PIDS] = handle_rpc_process_get_all_pids,
|
[RPC_MTYPE_PROCESS_GET_ALL_PIDS] = handle_rpc_process_get_all_pids,
|
||||||
[RPC_MTYPE_ALLOCATE_PID] = handle_rpc_allocate_pid,
|
[RPC_MTYPE_ALLOCATE_PID] = handle_rpc_allocate_pid,
|
||||||
|
[RPC_MTYPE_NOP] = handle_rpc_nop,
|
||||||
[RPC_MTYPE_GET_BOOTINFO] = handle_rpc_get_bootinfo,
|
[RPC_MTYPE_GET_BOOTINFO] = handle_rpc_get_bootinfo,
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user