This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.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/config.h>
10 #include <linux/spinlock.h>
11
12 #ifdef __KERNEL__
13
14 #ifndef __ia64__
15
16 struct pcifront_device;
17 struct pci_bus;
18
19 struct pcifront_sd {
20         int domain;
21         struct pcifront_device *pdev;
22 };
23
24 static inline struct pcifront_device *
25 pcifront_get_pdev(struct pcifront_sd *sd)
26 {
27         return sd->pdev;
28 }
29
30 static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain,
31                                     struct pcifront_device *pdev)
32 {
33         sd->domain = domain;
34         sd->pdev = pdev;
35 }
36
37 #if defined(CONFIG_PCI_DOMAINS)
38 static inline int pci_domain_nr(struct pci_bus *bus)
39 {
40         struct pcifront_sd *sd = bus->sysdata;
41         return sd->domain;
42 }
43 static inline int pci_proc_domain(struct pci_bus *bus)
44 {
45         return pci_domain_nr(bus);
46 }
47 #endif /* CONFIG_PCI_DOMAINS */
48
49 #else /* __ia64__ */
50
51 #include <asm/pci.h>
52 #define pcifront_sd pci_controller
53
54 static inline struct pcifront_device *
55 pcifront_get_pdev(struct pcifront_sd *sd)
56 {
57         return (struct pcifront_device *)sd->platform_data;
58 }
59
60 static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain,
61                                     struct pcifront_device *pdev)
62 {
63         sd->segment = domain;
64         sd->acpi_handle = NULL;
65         sd->iommu = NULL;
66         sd->windows = 0;
67         sd->window = NULL;
68         sd->platform_data = pdev;
69 }
70
71 #endif /* __ia64__ */
72
73 extern spinlock_t pci_bus_lock;
74
75 #endif /* __KERNEL__ */
76
77 #endif /* __XEN_ASM_PCIFRONT_H__ */