]> err.no Git - linux-2.6/blob - arch/sparc64/kernel/pci_sun4v_asm.S
4a12341dd5d3395273a1b6aec6cc9070739945a3
[linux-2.6] / arch / sparc64 / kernel / pci_sun4v_asm.S
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
8         /* %o0: devhandle
9          * %o1: devino
10          *
11          * returns %o0: sysino
12          */
13         .globl  pci_sun4v_devino_to_sysino
14 pci_sun4v_devino_to_sysino:
15         mov     HV_FAST_INTR_DEVINO2SYSINO, %o5
16         ta      HV_FAST_TRAP
17         retl
18          mov    %o1, %o0
19
20         /* %o0: devhandle
21          * %o1: tsbid
22          * %o2: num ttes
23          * %o3: io_attributes
24          * %o4: io_page_list phys address
25          *
26          * returns %o0: num ttes mapped
27          */
28         .globl  pci_sun4v_iommu_map
29 pci_sun4v_iommu_map:
30         mov     HV_FAST_PCI_IOMMU_MAP, %o5
31         ta      HV_FAST_TRAP
32         retl
33          mov    %o1, %o0
34
35         /* %o0: devhandle
36          * %o1: tsbid
37          * %o2: num ttes
38          *
39          * returns %o0: num ttes demapped
40          */
41         .globl  pci_sun4v_iommu_demap
42 pci_sun4v_iommu_demap:
43         mov     HV_FAST_PCI_IOMMU_DEMAP, %o5
44         ta      HV_FAST_TRAP
45         retl
46          mov    %o1, %o0
47
48         /* %o0: devhandle
49          * %o1: tsbid
50          * %o2: &io_attributes
51          * %o3: &real_address
52          *
53          * returns %o0: status
54          */
55         .globl  pci_sun4v_iommu_getmap
56 pci_sun4v_iommu_getmap:
57         mov     %o2, %o4
58         mov     HV_FAST_PCI_IOMMU_GETMAP, %o5
59         ta      HV_FAST_TRAP
60         stx     %o1, [%o4]
61         stx     %o2, [%o3]
62         retl
63          mov    %o0, %o0
64
65         /* %o0: devhandle
66          * %o1: pci_device
67          * %o2: pci_config_offset
68          * %o3: size
69          *
70          * returns %o0: data
71          *
72          * If there is an error, the data will be returned
73          * as all 1's.
74          */
75         .globl  pci_sun4v_config_get
76 pci_sun4v_config_get:
77         mov     HV_FAST_PCI_CONFIG_GET, %o5
78         ta      HV_FAST_TRAP
79         brnz,a,pn %o1, 1f
80          mov    -1, %o2
81 1:      retl
82          mov    %o2, %o0
83
84         /* %o0: devhandle
85          * %o1: pci_device
86          * %o2: pci_config_offset
87          * %o3: size
88          * %o4: data
89          *
90          * returns %o0: status
91          *
92          * status will be zero if the operation completed
93          * successfully, else -1 if not
94          */
95         .globl  pci_sun4v_config_put
96 pci_sun4v_config_put:
97         mov     HV_FAST_PCI_CONFIG_PUT, %o5
98         ta      HV_FAST_TRAP
99         brnz,a,pn %o1, 1f
100          mov    -1, %o1
101 1:      retl
102          mov    %o1, %o0