iorpc_uart.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright 2013 Tilera Corporation. All Rights Reserved.
  3. *
  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.
  7. *
  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.
  13. */
  14. /* This file is machine-generated; DO NOT EDIT! */
  15. #include "gxio/iorpc_uart.h"
  16. struct cfg_interrupt_param {
  17. union iorpc_interrupt interrupt;
  18. };
  19. int gxio_uart_cfg_interrupt(gxio_uart_context_t *context, int inter_x,
  20. int inter_y, int inter_ipi, int inter_event)
  21. {
  22. struct cfg_interrupt_param temp;
  23. struct cfg_interrupt_param *params = &temp;
  24. params->interrupt.kernel.x = inter_x;
  25. params->interrupt.kernel.y = inter_y;
  26. params->interrupt.kernel.ipi = inter_ipi;
  27. params->interrupt.kernel.event = inter_event;
  28. return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
  29. sizeof(*params), GXIO_UART_OP_CFG_INTERRUPT);
  30. }
  31. EXPORT_SYMBOL(gxio_uart_cfg_interrupt);
  32. struct get_mmio_base_param {
  33. HV_PTE base;
  34. };
  35. int gxio_uart_get_mmio_base(gxio_uart_context_t *context, HV_PTE *base)
  36. {
  37. int __result;
  38. struct get_mmio_base_param temp;
  39. struct get_mmio_base_param *params = &temp;
  40. __result =
  41. hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
  42. GXIO_UART_OP_GET_MMIO_BASE);
  43. *base = params->base;
  44. return __result;
  45. }
  46. EXPORT_SYMBOL(gxio_uart_get_mmio_base);
  47. struct check_mmio_offset_param {
  48. unsigned long offset;
  49. unsigned long size;
  50. };
  51. int gxio_uart_check_mmio_offset(gxio_uart_context_t *context,
  52. unsigned long offset, unsigned long size)
  53. {
  54. struct check_mmio_offset_param temp;
  55. struct check_mmio_offset_param *params = &temp;
  56. params->offset = offset;
  57. params->size = size;
  58. return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
  59. sizeof(*params), GXIO_UART_OP_CHECK_MMIO_OFFSET);
  60. }
  61. EXPORT_SYMBOL(gxio_uart_check_mmio_offset);