pci_sun4v_asm.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* pci_sun4v_asm: Hypervisor calls for PCI support.
  2. *
  3. * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
  4. */
  5. #include <asm/hypervisor.h>
  6. /* %o0: devhandle
  7. * %o1: tsbid
  8. * %o2: num ttes
  9. * %o3: io_attributes
  10. * %o4: io_page_list phys address
  11. *
  12. * returns %o0: num ttes mapped
  13. */
  14. .globl pci_sun4v_iommu_map
  15. pci_sun4v_iommu_map:
  16. mov HV_FAST_PCI_IOMMU_MAP, %o5
  17. ta HV_FAST_TRAP
  18. retl
  19. mov %o1, %o0
  20. /* %o0: devhandle
  21. * %o1: tsbid
  22. * %o2: num ttes
  23. *
  24. * returns %o0: num ttes demapped
  25. */
  26. .globl pci_sun4v_iommu_demap
  27. pci_sun4v_iommu_demap:
  28. mov HV_FAST_PCI_IOMMU_DEMAP, %o5
  29. ta HV_FAST_TRAP
  30. retl
  31. mov %o1, %o0
  32. /* %o0: devhandle
  33. * %o1: tsbid
  34. * %o2: &io_attributes
  35. * %o3: &real_address
  36. *
  37. * returns %o0: status
  38. */
  39. .globl pci_sun4v_iommu_getmap
  40. pci_sun4v_iommu_getmap:
  41. mov %o2, %o4
  42. mov HV_FAST_PCI_IOMMU_GETMAP, %o5
  43. ta HV_FAST_TRAP
  44. stx %o1, [%o4]
  45. stx %o2, [%o3]
  46. retl
  47. mov %o0, %o0
  48. /* %o0: devhandle
  49. * %o1: pci_device
  50. * %o2: pci_config_offset
  51. * %o3: size
  52. *
  53. * returns %o0: data
  54. *
  55. * If there is an error, the data will be returned
  56. * as all 1's.
  57. */
  58. .globl pci_sun4v_config_get
  59. pci_sun4v_config_get:
  60. mov HV_FAST_PCI_CONFIG_GET, %o5
  61. ta HV_FAST_TRAP
  62. brnz,a,pn %o1, 1f
  63. mov -1, %o2
  64. 1: retl
  65. mov %o2, %o0
  66. /* %o0: devhandle
  67. * %o1: pci_device
  68. * %o2: pci_config_offset
  69. * %o3: size
  70. * %o4: data
  71. *
  72. * returns %o0: status
  73. *
  74. * status will be zero if the operation completed
  75. * successfully, else -1 if not
  76. */
  77. .globl pci_sun4v_config_put
  78. pci_sun4v_config_put:
  79. mov HV_FAST_PCI_CONFIG_PUT, %o5
  80. ta HV_FAST_TRAP
  81. brnz,a,pn %o1, 1f
  82. mov -1, %o1
  83. 1: retl
  84. mov %o1, %o0