1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#include "gxio/iorpc_uart.h"
17
18struct cfg_interrupt_param {
19 union iorpc_interrupt interrupt;
20};
21
22int gxio_uart_cfg_interrupt(gxio_uart_context_t *context, int inter_x,
23 int inter_y, int inter_ipi, int inter_event)
24{
25 struct cfg_interrupt_param temp;
26 struct cfg_interrupt_param *params = &temp;
27
28 params->interrupt.kernel.x = inter_x;
29 params->interrupt.kernel.y = inter_y;
30 params->interrupt.kernel.ipi = inter_ipi;
31 params->interrupt.kernel.event = inter_event;
32
33 return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
34 sizeof(*params), GXIO_UART_OP_CFG_INTERRUPT);
35}
36
37EXPORT_SYMBOL(gxio_uart_cfg_interrupt);
38
39struct get_mmio_base_param {
40 HV_PTE base;
41};
42
43int gxio_uart_get_mmio_base(gxio_uart_context_t *context, HV_PTE *base)
44{
45 int __result;
46 struct get_mmio_base_param temp;
47 struct get_mmio_base_param *params = &temp;
48
49 __result =
50 hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
51 GXIO_UART_OP_GET_MMIO_BASE);
52 *base = params->base;
53
54 return __result;
55}
56
57EXPORT_SYMBOL(gxio_uart_get_mmio_base);
58
59struct check_mmio_offset_param {
60 unsigned long offset;
61 unsigned long size;
62};
63
64int gxio_uart_check_mmio_offset(gxio_uart_context_t *context,
65 unsigned long offset, unsigned long size)
66{
67 struct check_mmio_offset_param temp;
68 struct check_mmio_offset_param *params = &temp;
69
70 params->offset = offset;
71 params->size = size;
72
73 return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
74 sizeof(*params), GXIO_UART_OP_CHECK_MMIO_OFFSET);
75}
76
77EXPORT_SYMBOL(gxio_uart_check_mmio_offset);
78