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);
10 #define pci_xen_init (0)
11 static inline int pci_xen_hvm_init(void)
16 #if defined(CONFIG_XEN_DOM0)
17 void __init
xen_setup_pirqs(void);
19 static inline void __init
xen_setup_pirqs(void)
24 #if defined(CONFIG_PCI_MSI)
25 #if defined(CONFIG_PCI_XEN)
26 /* The drivers/pci/xen-pcifront.c sets this structure to
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
,
41 if (xen_pci_frontend
&& xen_pci_frontend
->enable_msi
)
42 return xen_pci_frontend
->enable_msi(dev
, vectors
);
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
);
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 */