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