27 #include <linux/module.h>
28 #include <linux/pci.h>
33 #include <xen/events.h>
35 #include <xen/xen-ops.h>
37 #define DRV_NAME "xen-platform-pci"
43 static unsigned long platform_mmio;
44 static unsigned long platform_mmio_alloc;
45 static unsigned long platform_mmiolen;
52 addr = platform_mmio + platform_mmio_alloc;
53 platform_mmio_alloc += len;
54 BUG_ON(platform_mmio_alloc > platform_mmiolen);
84 static int xen_allocate_irq(
struct pci_dev *pdev)
88 "xen-platform-pci", pdev);
91 static int platform_pci_resume(
struct pci_dev *pdev)
98 dev_err(&pdev->
dev,
"platform_pci_resume failure!\n");
109 long mmio_addr, mmio_len;
110 unsigned int max_nr_gframes;
124 if (mmio_addr == 0 || ioaddr == 0) {
138 platform_mmio = mmio_addr;
139 platform_mmiolen = mmio_len;
142 ret = xen_allocate_irq(pdev);
144 dev_warn(&pdev->
dev,
"request_irq failed err=%d\n", ret);
147 callback_via = get_callback_via(pdev);
150 dev_warn(&pdev->
dev,
"Unable to set the evtchn callback "
183 .probe = platform_pci_init,
184 .id_table = platform_pci_tbl,
186 .resume_early = platform_pci_resume,
190 static int __init platform_pci_module_init(
void)
192 return pci_register_driver(&platform_driver);