Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright 2004 James Cleverdon, IBM.
0004  *
0005  * Generic APIC sub-arch probe layer.
0006  *
0007  * Hacked for x86-64 by James Cleverdon from i386 architecture code by
0008  * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
0009  * James Cleverdon.
0010  */
0011 #include <linux/thread_info.h>
0012 #include <asm/apic.h>
0013 
0014 #include "local.h"
0015 
0016 /*
0017  * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
0018  */
0019 void __init default_setup_apic_routing(void)
0020 {
0021     struct apic **drv;
0022 
0023     enable_IR_x2apic();
0024 
0025     for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
0026         if ((*drv)->probe && (*drv)->probe()) {
0027             if (apic != *drv) {
0028                 apic = *drv;
0029                 pr_info("Switched APIC routing to %s.\n",
0030                     apic->name);
0031             }
0032             break;
0033         }
0034     }
0035 }
0036 
0037 int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
0038 {
0039     struct apic **drv;
0040 
0041     for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
0042         if ((*drv)->acpi_madt_oem_check(oem_id, oem_table_id)) {
0043             if (apic != *drv) {
0044                 apic = *drv;
0045                 pr_info("Setting APIC routing to %s.\n",
0046                     apic->name);
0047             }
0048             return 1;
0049         }
0050     }
0051     return 0;
0052 }