- Update Xen patches to 3.3-rc5 and c/s 1157.
[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_init_sd(struct pcifront_sd *sd,
28                                     unsigned int domain, unsigned int bus,
29                                     struct pcifront_device *pdev)
30 {
31         sd->domain = domain;
32         sd->pdev = pdev;
33 }
34
35 static inline void pcifront_setup_root_resources(struct pci_bus *bus,
36                                                  struct pcifront_sd *sd)
37 {
38 }
39
40 #else /* __ia64__ */
41
42 #include <linux/acpi.h>
43 #include <asm/pci.h>
44 #define pcifront_sd pci_controller
45
46 extern void xen_add_resource(struct pci_controller *, unsigned int,
47                              unsigned int, struct acpi_resource *);
48 extern void xen_pcibios_setup_root_windows(struct pci_bus *,
49                                            struct pci_controller *);
50
51 static inline struct pcifront_device *
52 pcifront_get_pdev(struct pcifront_sd *sd)
53 {
54         return (struct pcifront_device *)sd->platform_data;
55 }
56
57 static inline void pcifront_setup_root_resources(struct pci_bus *bus,
58                                                  struct pcifront_sd *sd)
59 {
60         xen_pcibios_setup_root_windows(bus, sd);
61 }
62
63 #endif /* __ia64__ */
64
65 extern struct rw_semaphore pci_bus_sem;
66
67 #endif /* __KERNEL__ */
68
69 #endif /* __XEN_ASM_PCIFRONT_H__ */