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