Linux 4.13.16
[linux/fpc-iii.git] / arch / tile / gxio / iorpc_uart.c
blobb9a6d6193d7381ced0a4c330216f4aec5c13a971
1 /*
2 * Copyright 2013 Tilera Corporation. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
15 /* This file is machine-generated; DO NOT EDIT! */
16 #include "gxio/iorpc_uart.h"
18 struct cfg_interrupt_param {
19 union iorpc_interrupt interrupt;
22 int gxio_uart_cfg_interrupt(gxio_uart_context_t *context, int inter_x,
23 int inter_y, int inter_ipi, int inter_event)
25 struct cfg_interrupt_param temp;
26 struct cfg_interrupt_param *params = &temp;
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;
33 return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
34 sizeof(*params), GXIO_UART_OP_CFG_INTERRUPT);
37 EXPORT_SYMBOL(gxio_uart_cfg_interrupt);
39 struct get_mmio_base_param {
40 HV_PTE base;
43 int gxio_uart_get_mmio_base(gxio_uart_context_t *context, HV_PTE *base)
45 int __result;
46 struct get_mmio_base_param temp;
47 struct get_mmio_base_param *params = &temp;
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;
54 return __result;
57 EXPORT_SYMBOL(gxio_uart_get_mmio_base);
59 struct check_mmio_offset_param {
60 unsigned long offset;
61 unsigned long size;
64 int gxio_uart_check_mmio_offset(gxio_uart_context_t *context,
65 unsigned long offset, unsigned long size)
67 struct check_mmio_offset_param temp;
68 struct check_mmio_offset_param *params = &temp;
70 params->offset = offset;
71 params->size = size;
73 return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
74 sizeof(*params), GXIO_UART_OP_CHECK_MMIO_OFFSET);
77 EXPORT_SYMBOL(gxio_uart_check_mmio_offset);