This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / i386 / pci / pcifront.c
1 /*
2  * PCI Frontend Stub - puts some "dummy" functions in to the Linux x86 PCI core
3  *                     to support the Xen PCI Frontend's operation
4  *
5  *   Author: Ryan Wilson <hap9@epoch.ncsc.mil>
6  */
7 #include <linux/module.h>
8 #include <linux/init.h>
9 #include <linux/pci.h>
10 #include <asm/acpi.h>
11 #include "pci.h"
12
13 static int pcifront_enable_irq(struct pci_dev *dev)
14 {
15         u8 irq;
16         pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
17         dev->irq = irq;
18
19         return 0;
20 }
21
22 extern u8 pci_cache_line_size;
23
24 static int __init pcifront_x86_stub_init(void)
25 {
26         struct cpuinfo_x86 *c = &boot_cpu_data;
27
28         /* Only install our method if we haven't found real hardware already */
29         if (raw_pci_ops)
30                 return 0;
31
32         printk(KERN_INFO "PCI: setting up Xen PCI frontend stub\n");
33
34         /* Copied from arch/i386/pci/common.c */
35         pci_cache_line_size = 32 >> 2;
36         if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD)
37                 pci_cache_line_size = 64 >> 2;  /* K7 & K8 */
38         else if (c->x86 > 6 && c->x86_vendor == X86_VENDOR_INTEL)
39                 pci_cache_line_size = 128 >> 2; /* P4 */
40
41         /* On x86, we need to disable the normal IRQ routing table and
42          * just ask the backend
43          */
44         pcibios_enable_irq = pcifront_enable_irq;
45         pcibios_disable_irq = NULL;
46
47 #ifdef CONFIG_ACPI
48         /* Keep ACPI out of the picture */
49         acpi_noirq = 1;
50 #endif
51
52         return 0;
53 }
54
55 arch_initcall(pcifront_x86_stub_init);