2 * PCI Frontend Stub - puts some "dummy" functions in to the Linux x86 PCI core
3 * to support the Xen PCI Frontend's operation
5 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
7 #include <linux/init.h>
11 #include <asm/pci_x86.h>
12 #include <xen/evtchn.h>
14 static int pcifront_enable_irq(struct pci_dev *dev)
17 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
18 if (!alloc_irq_and_cfg_at(irq, numa_node_id()))
20 evtchn_register_pirq(irq);
26 extern u8 pci_cache_line_size;
28 static int __init pcifront_x86_stub_init(void)
30 struct cpuinfo_x86 *c = &boot_cpu_data;
32 /* Only install our method if we haven't found real hardware already */
36 pr_info("PCI: setting up Xen PCI frontend stub\n");
38 /* Copied from arch/i386/pci/common.c */
39 pci_cache_line_size = 32 >> 2;
40 if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD)
41 pci_cache_line_size = 64 >> 2; /* K7 & K8 */
42 else if (c->x86 > 6 && c->x86_vendor == X86_VENDOR_INTEL)
43 pci_cache_line_size = 128 >> 2; /* P4 */
45 /* On x86, we need to disable the normal IRQ routing table and
46 * just ask the backend
48 pcibios_enable_irq = pcifront_enable_irq;
49 pcibios_disable_irq = NULL;
52 /* Keep ACPI out of the picture */
59 arch_initcall(pcifront_x86_stub_init);