xen: cleancache shim to Xen Transcendent Memory
[linux-2.6/next.git] / arch / x86 / include / asm / xen / pci.h
blobaa86209891622f1a871970cc758efc8ea28f935a
1 #ifndef _ASM_X86_XEN_PCI_H
2 #define _ASM_X86_XEN_PCI_H
4 #if defined(CONFIG_PCI_XEN)
5 extern int __init pci_xen_init(void);
6 extern int __init pci_xen_hvm_init(void);
7 #define pci_xen 1
8 #else
9 #define pci_xen 0
10 #define pci_xen_init (0)
11 static inline int pci_xen_hvm_init(void)
13 return -1;
15 #endif
16 #if defined(CONFIG_XEN_DOM0)
17 void __init xen_setup_pirqs(void);
18 #else
19 static inline void __init xen_setup_pirqs(void)
22 #endif
24 #if defined(CONFIG_PCI_MSI)
25 #if defined(CONFIG_PCI_XEN)
26 /* The drivers/pci/xen-pcifront.c sets this structure to
27 * its own functions.
29 struct xen_pci_frontend_ops {
30 int (*enable_msi)(struct pci_dev *dev, int vectors[]);
31 void (*disable_msi)(struct pci_dev *dev);
32 int (*enable_msix)(struct pci_dev *dev, int vectors[], int nvec);
33 void (*disable_msix)(struct pci_dev *dev);
36 extern struct xen_pci_frontend_ops *xen_pci_frontend;
38 static inline int xen_pci_frontend_enable_msi(struct pci_dev *dev,
39 int vectors[])
41 if (xen_pci_frontend && xen_pci_frontend->enable_msi)
42 return xen_pci_frontend->enable_msi(dev, vectors);
43 return -ENODEV;
45 static inline void xen_pci_frontend_disable_msi(struct pci_dev *dev)
47 if (xen_pci_frontend && xen_pci_frontend->disable_msi)
48 xen_pci_frontend->disable_msi(dev);
50 static inline int xen_pci_frontend_enable_msix(struct pci_dev *dev,
51 int vectors[], int nvec)
53 if (xen_pci_frontend && xen_pci_frontend->enable_msix)
54 return xen_pci_frontend->enable_msix(dev, vectors, nvec);
55 return -ENODEV;
57 static inline void xen_pci_frontend_disable_msix(struct pci_dev *dev)
59 if (xen_pci_frontend && xen_pci_frontend->disable_msix)
60 xen_pci_frontend->disable_msix(dev);
62 #endif /* CONFIG_PCI_XEN */
63 #endif /* CONFIG_PCI_MSI */
65 #endif /* _ASM_X86_XEN_PCI_H */