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/module.h>
8 #include <linux/init.h>
10 #include <linux/pci.h>
12 #include <asm/pci_x86.h>
13 #include <xen/evtchn.h>
15 static int pcifront_enable_irq(struct pci_dev *dev)
18 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
19 irq_to_desc_alloc_node(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 printk(KERN_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);