1 #include "openamp/open_amp.h"
2 /* RPC response buffer size */
3 #define RPC_BUFF_SIZE 512
5 /* System call definitions */
6 #define OPEN_SYSCALL_ID 1
7 #define CLOSE_SYSCALL_ID 2
8 #define WRITE_SYSCALL_ID 3
9 #define READ_SYSCALL_ID 4
10 #define ACK_STATUS_ID 5
11 #define TERM_SYSCALL_ID 6
13 #define FILE_NAME_LEN 50
15 /* Proxy device endpoint ID */
16 #define PROXY_ENDPOINT 127
18 typedef void (*rpc_shutdown_cb) (struct rpmsg_channel *);
20 struct _rpc_data {
21 struct rpmsg_channel *rpmsg_chnl;
22 struct rpmsg_endpoint *rp_ept;
23 void *rpc_lock;
24 void *sync_lock;
25 struct _sys_rpc *rpc;
26 struct _sys_rpc *rpc_response;
27 rpc_shutdown_cb shutdown_cb;
28 };
30 struct _sys_call_args {
31 int int_field1;
32 int int_field2;
33 unsigned int data_len;
34 char data[0];
35 };
37 /* System call rpc data structure */
38 struct _sys_rpc {
39 unsigned int id;
40 struct _sys_call_args sys_call_args;
41 };
43 void debug_print(char *str, int len);
45 /* API prototypes */
46 int rpmsg_retarget_init(struct rpmsg_channel *rp_chnl, rpc_shutdown_cb cb);
47 int rpmsg_retarget_deinit(struct rpmsg_channel *rp_chnl);
48 int rpmsg_retarget_send(void *data, int len);