init.c 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include <linux/pci.h>
  2. #include <linux/init.h>
  3. #include <asm/pci_x86.h>
  4. #include <asm/x86_init.h>
  5. /* arch_initcall has too random ordering, so call the initializers
  6. in the right sequence from here. */
  7. static __init int pci_arch_init(void)
  8. {
  9. #ifdef CONFIG_PCI_DIRECT
  10. int type = 0;
  11. type = pci_direct_probe();
  12. #endif
  13. if (!(pci_probe & PCI_PROBE_NOEARLY))
  14. pci_mmcfg_early_init();
  15. if (x86_init.pci.arch_init && !x86_init.pci.arch_init())
  16. return 0;
  17. #ifdef CONFIG_PCI_BIOS
  18. pci_pcbios_init();
  19. #endif
  20. /*
  21. * don't check for raw_pci_ops here because we want pcbios as last
  22. * fallback, yet it's needed to run first to set pcibios_last_bus
  23. * in case legacy PCI probing is used. otherwise detecting peer busses
  24. * fails.
  25. */
  26. #ifdef CONFIG_PCI_DIRECT
  27. pci_direct_init(type);
  28. #endif
  29. if (!raw_pci_ops && !raw_pci_ext_ops)
  30. printk(KERN_ERR
  31. "PCI: Fatal: No config space access function found\n");
  32. dmi_check_pciprobe();
  33. dmi_check_skip_isa_align();
  34. return 0;
  35. }
  36. arch_initcall(pci_arch_init);