n2_asm.S 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* n2_asm.S: Hypervisor calls for NCS support.
  3. *
  4. * Copyright (C) 2009 David S. Miller <davem@davemloft.net>
  5. */
  6. #include <linux/linkage.h>
  7. #include <asm/hypervisor.h>
  8. #include "n2_core.h"
  9. /* o0: queue type
  10. * o1: RA of queue
  11. * o2: num entries in queue
  12. * o3: address of queue handle return
  13. */
  14. ENTRY(sun4v_ncs_qconf)
  15. mov HV_FAST_NCS_QCONF, %o5
  16. ta HV_FAST_TRAP
  17. stx %o1, [%o3]
  18. retl
  19. nop
  20. ENDPROC(sun4v_ncs_qconf)
  21. /* %o0: queue handle
  22. * %o1: address of queue type return
  23. * %o2: address of queue base address return
  24. * %o3: address of queue num entries return
  25. */
  26. ENTRY(sun4v_ncs_qinfo)
  27. mov %o1, %g1
  28. mov %o2, %g2
  29. mov %o3, %g3
  30. mov HV_FAST_NCS_QINFO, %o5
  31. ta HV_FAST_TRAP
  32. stx %o1, [%g1]
  33. stx %o2, [%g2]
  34. stx %o3, [%g3]
  35. retl
  36. nop
  37. ENDPROC(sun4v_ncs_qinfo)
  38. /* %o0: queue handle
  39. * %o1: address of head offset return
  40. */
  41. ENTRY(sun4v_ncs_gethead)
  42. mov %o1, %o2
  43. mov HV_FAST_NCS_GETHEAD, %o5
  44. ta HV_FAST_TRAP
  45. stx %o1, [%o2]
  46. retl
  47. nop
  48. ENDPROC(sun4v_ncs_gethead)
  49. /* %o0: queue handle
  50. * %o1: address of tail offset return
  51. */
  52. ENTRY(sun4v_ncs_gettail)
  53. mov %o1, %o2
  54. mov HV_FAST_NCS_GETTAIL, %o5
  55. ta HV_FAST_TRAP
  56. stx %o1, [%o2]
  57. retl
  58. nop
  59. ENDPROC(sun4v_ncs_gettail)
  60. /* %o0: queue handle
  61. * %o1: new tail offset
  62. */
  63. ENTRY(sun4v_ncs_settail)
  64. mov HV_FAST_NCS_SETTAIL, %o5
  65. ta HV_FAST_TRAP
  66. retl
  67. nop
  68. ENDPROC(sun4v_ncs_settail)
  69. /* %o0: queue handle
  70. * %o1: address of devino return
  71. */
  72. ENTRY(sun4v_ncs_qhandle_to_devino)
  73. mov %o1, %o2
  74. mov HV_FAST_NCS_QHANDLE_TO_DEVINO, %o5
  75. ta HV_FAST_TRAP
  76. stx %o1, [%o2]
  77. retl
  78. nop
  79. ENDPROC(sun4v_ncs_qhandle_to_devino)
  80. /* %o0: queue handle
  81. * %o1: new head offset
  82. */
  83. ENTRY(sun4v_ncs_sethead_marker)
  84. mov HV_FAST_NCS_SETHEAD_MARKER, %o5
  85. ta HV_FAST_TRAP
  86. retl
  87. nop
  88. ENDPROC(sun4v_ncs_sethead_marker)