1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#include "gxio/iorpc_globals.h"
17
18struct arm_pollfd_param {
19 union iorpc_pollfd pollfd;
20};
21
22int __iorpc_arm_pollfd(int fd, int pollfd_cookie)
23{
24 struct arm_pollfd_param temp;
25 struct arm_pollfd_param *params = &temp;
26
27 params->pollfd.kernel.cookie = pollfd_cookie;
28
29 return hv_dev_pwrite(fd, 0, (HV_VirtAddr) params, sizeof(*params),
30 IORPC_OP_ARM_POLLFD);
31}
32
33EXPORT_SYMBOL(__iorpc_arm_pollfd);
34
35struct close_pollfd_param {
36 union iorpc_pollfd pollfd;
37};
38
39int __iorpc_close_pollfd(int fd, int pollfd_cookie)
40{
41 struct close_pollfd_param temp;
42 struct close_pollfd_param *params = &temp;
43
44 params->pollfd.kernel.cookie = pollfd_cookie;
45
46 return hv_dev_pwrite(fd, 0, (HV_VirtAddr) params, sizeof(*params),
47 IORPC_OP_CLOSE_POLLFD);
48}
49
50EXPORT_SYMBOL(__iorpc_close_pollfd);
51
52struct get_mmio_base_param {
53 HV_PTE base;
54};
55
56int __iorpc_get_mmio_base(int fd, HV_PTE *base)
57{
58 int __result;
59 struct get_mmio_base_param temp;
60 struct get_mmio_base_param *params = &temp;
61
62 __result =
63 hv_dev_pread(fd, 0, (HV_VirtAddr) params, sizeof(*params),
64 IORPC_OP_GET_MMIO_BASE);
65 *base = params->base;
66
67 return __result;
68}
69
70EXPORT_SYMBOL(__iorpc_get_mmio_base);
71
72struct check_mmio_offset_param {
73 unsigned long offset;
74 unsigned long size;
75};
76
77int __iorpc_check_mmio_offset(int fd, unsigned long offset, unsigned long size)
78{
79 struct check_mmio_offset_param temp;
80 struct check_mmio_offset_param *params = &temp;
81
82 params->offset = offset;
83 params->size = size;
84
85 return hv_dev_pwrite(fd, 0, (HV_VirtAddr) params, sizeof(*params),
86 IORPC_OP_CHECK_MMIO_OFFSET);
87}
88
89EXPORT_SYMBOL(__iorpc_check_mmio_offset);
90