Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / include / xen / pcifront.h
1 /*
2  * PCI Frontend - arch-dependendent declarations
3  *
4  *   Author: Ryan Wilson <hap9@epoch.ncsc.mil>
5  */
6 #ifndef __XEN_ASM_PCIFRONT_H__
7 #define __XEN_ASM_PCIFRONT_H__
8
9 #include <linux/spinlock.h>
10
11 #ifdef __KERNEL__
12
13 #ifndef __ia64__
14
15 #include <asm/pci.h>
16
17 struct pcifront_device;
18 struct pci_bus;
19 #define pcifront_sd pci_sysdata
20
21 static inline struct pcifront_device *
22 pcifront_get_pdev(struct pcifront_sd *sd)
23 {
24         return sd->pdev;
25 }
26
27 static inline void pcifront_setup_root_resources(struct pci_bus *bus,
28                                                  struct pcifront_sd *sd)
29 {
30 }
31
32 #else /* __ia64__ */
33
34 #include <linux/acpi.h>
35 #include <asm/pci.h>
36 #define pcifront_sd pci_controller
37
38 extern void xen_add_resource(struct pci_controller *, unsigned int,
39                              unsigned int, struct acpi_resource *);
40 extern void xen_pcibios_setup_root_windows(struct pci_bus *,
41                                            struct pci_controller *);
42
43 static inline struct pcifront_device *
44 pcifront_get_pdev(struct pcifront_sd *sd)
45 {
46         return (struct pcifront_device *)sd->platform_data;
47 }
48
49 static inline void pcifront_setup_root_resources(struct pci_bus *bus,
50                                                  struct pcifront_sd *sd)
51 {
52         xen_pcibios_setup_root_windows(bus, sd);
53 }
54
55 #endif /* __ia64__ */
56
57 extern struct rw_semaphore pci_bus_sem;
58
59 #endif /* __KERNEL__ */
60
61 #endif /* __XEN_ASM_PCIFRONT_H__ */