source: trunk/packages/xen-3.1/xen-3.1/linux-2.6-xen-sparse/include/xen/pcifront.h @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.4 KB
Line 
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
15struct pcifront_device;
16struct pci_bus;
17
18struct pcifront_sd {
19        int domain;
20        struct pcifront_device *pdev;
21};
22
23static inline struct pcifront_device *
24pcifront_get_pdev(struct pcifront_sd *sd)
25{
26        return sd->pdev;
27}
28
29static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain,
30                                    struct pcifront_device *pdev)
31{
32        sd->domain = domain;
33        sd->pdev = pdev;
34}
35
36#if defined(CONFIG_PCI_DOMAINS)
37static inline int pci_domain_nr(struct pci_bus *bus)
38{
39        struct pcifront_sd *sd = bus->sysdata;
40        return sd->domain;
41}
42static inline int pci_proc_domain(struct pci_bus *bus)
43{
44        return pci_domain_nr(bus);
45}
46#endif /* CONFIG_PCI_DOMAINS */
47
48#else /* __ia64__ */
49
50#include <asm/pci.h>
51#define pcifront_sd pci_controller
52
53static inline struct pcifront_device *
54pcifront_get_pdev(struct pcifront_sd *sd)
55{
56        return (struct pcifront_device *)sd->platform_data;
57}
58
59static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain,
60                                    struct pcifront_device *pdev)
61{
62        sd->segment = domain;
63        sd->acpi_handle = NULL;
64        sd->iommu = NULL;
65        sd->windows = 0;
66        sd->window = NULL;
67        sd->platform_data = pdev;
68}
69
70#endif /* __ia64__ */
71
72extern struct rw_semaphore pci_bus_sem;
73
74#endif /* __KERNEL__ */
75
76#endif /* __XEN_ASM_PCIFRONT_H__ */
Note: See TracBrowser for help on using the repository browser.