1#ifndef REMOTE_PORT_DEVICE_H
2#define REMOTE_PORT_DEVICE_H
3
4#include "qemu-common.h"
5#include "qom/object.h"
6#include "hw/remote-port-proto.h"
7
8#define TYPE_REMOTE_PORT_DEVICE "remote-port-device"
9
10#define REMOTE_PORT_DEVICE_CLASS(klass) \
11 OBJECT_CLASS_CHECK(RemotePortDeviceClass, (klass), TYPE_REMOTE_PORT_DEVICE)
12#define REMOTE_PORT_DEVICE_GET_CLASS(obj) \
13 OBJECT_GET_CLASS(RemotePortDeviceClass, (obj), TYPE_REMOTE_PORT_DEVICE)
14#define REMOTE_PORT_DEVICE(obj) \
15 INTERFACE_CHECK(RemotePortDevice, (obj), TYPE_REMOTE_PORT_DEVICE)
16
17typedef struct RemotePort RemotePort;
18
19typedef struct RemotePortDevice {
20
21 Object parent_obj;
22} RemotePortDevice;
23
24typedef struct RemotePortDeviceClass {
25
26 InterfaceClass parent_class;
27
28
29
30
31
32
33
34
35
36
37
38 void (*ops[RP_CMD_max+1])(RemotePortDevice *obj, struct rp_pkt *pkt);
39
40} RemotePortDeviceClass;
41
42uint32_t rp_new_id(RemotePort *s);
43
44void rp_rsp_mutex_lock(RemotePort *s);
45void rp_rsp_mutex_unlock(RemotePort *s);
46void rp_sync_vmclock(RemotePort *s, int64_t lclk, int64_t rclk);
47void rp_restart_sync_timer(RemotePort *s);
48void rp_leave_iothread(RemotePort *s);
49
50ssize_t rp_write(RemotePort *s, const void *buf, size_t count);
51
52RemotePortDynPkt rp_wait_resp(RemotePort *s);
53
54int64_t rp_normalized_vmclk(RemotePort *s);
55
56#endif
57