probe_64.c 914 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright 2004 James Cleverdon, IBM.
  4. *
  5. * Generic APIC sub-arch probe layer.
  6. *
  7. * Hacked for x86-64 by James Cleverdon from i386 architecture code by
  8. * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
  9. * James Cleverdon.
  10. */
  11. #include <linux/thread_info.h>
  12. #include <asm/apic.h>
  13. #include "local.h"
  14. /* Select the appropriate APIC driver */
  15. void __init x86_64_probe_apic(void)
  16. {
  17. struct apic **drv;
  18. enable_IR_x2apic();
  19. for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
  20. if ((*drv)->probe && (*drv)->probe()) {
  21. apic_install_driver(*drv);
  22. break;
  23. }
  24. }
  25. }
  26. int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
  27. {
  28. struct apic **drv;
  29. for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
  30. if ((*drv)->acpi_madt_oem_check(oem_id, oem_table_id)) {
  31. apic_install_driver(*drv);
  32. return 1;
  33. }
  34. }
  35. return 0;
  36. }