blob: 0f51845e1e15732cb83abf4626f20860c2bbbf89 [file] [log] [blame]
Julian Hallf7f84952020-11-23 17:55:51 +01001/*
2 * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef DIRECT_CALLER_H
8#define DIRECT_CALLER_H
9
10#include <rpc_caller.h>
11#include <stdint.h>
12#include <stdbool.h>
13#include <stddef.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19struct call_ep;
20
21/** An rpc_caller that calls methods associated with a specific endpoint
22 * directly. Used when the caller and endpoint are running in the same
23 * execution context.
24 **/
25struct direct_caller
26{
27 struct rpc_caller rpc_caller;
28 struct call_ep *call_ep;
29 uint32_t caller_id;
30 bool is_call_transaction_in_progess;
31 size_t req_len;
32 size_t req_buf_size;
33 size_t resp_buf_size;
34 uint8_t *req_buf;
35 uint8_t *resp_buf;
36};
37
38struct rpc_caller *direct_caller_init(struct direct_caller *s, struct call_ep *ep,
39 size_t req_buf_size, size_t resp_buf_size);
40
41struct rpc_caller *direct_caller_init_default(struct direct_caller *s, struct call_ep *ep);
42
43void direct_caller_deinit(struct direct_caller *s);
44
45#ifdef __cplusplus
46}
47#endif
48
49#endif /* DIRECT_CALLER_H */