mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
x86, apic: Use .apicdrivers section for the apic drivers list
This will eliminate the need for apic_probe[], as the probing now will happen based on the apic drivers order in the .apcidrivers section. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Tested-by: Cyrill Gorcunov <gorcunov@openvz.org> Cc: steiner@sgi.com Cc: gorcunov@openvz.org Cc: yinghai@kernel.org Link: http://lkml.kernel.org/r/20110521005526.164277071@sbsiddha-MOBL3.sc.intel.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
107e0e0cd8
commit
8b37e88061
2 changed files with 36 additions and 31 deletions
|
@ -206,14 +206,14 @@ static struct apic *apic_probe[] __initdata = {
|
||||||
static int cmdline_apic __initdata;
|
static int cmdline_apic __initdata;
|
||||||
static int __init parse_apic(char *arg)
|
static int __init parse_apic(char *arg)
|
||||||
{
|
{
|
||||||
int i;
|
struct apic **drv;
|
||||||
|
|
||||||
if (!arg)
|
if (!arg)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
for (i = 0; apic_probe[i]; i++) {
|
for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
|
||||||
if (!strcmp(apic_probe[i]->name, arg)) {
|
if (!strcmp((*drv)->name, arg)) {
|
||||||
apic = apic_probe[i];
|
apic = *drv;
|
||||||
cmdline_apic = 1;
|
cmdline_apic = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -247,15 +247,16 @@ void __init generic_bigsmp_probe(void)
|
||||||
void __init generic_apic_probe(void)
|
void __init generic_apic_probe(void)
|
||||||
{
|
{
|
||||||
if (!cmdline_apic) {
|
if (!cmdline_apic) {
|
||||||
int i;
|
struct apic **drv;
|
||||||
for (i = 0; apic_probe[i]; i++) {
|
|
||||||
if (apic_probe[i]->probe()) {
|
for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
|
||||||
apic = apic_probe[i];
|
if ((*drv)->probe()) {
|
||||||
|
apic = *drv;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Not visible without early console */
|
/* Not visible without early console */
|
||||||
if (!apic_probe[i])
|
if (drv == __apicdrivers_end)
|
||||||
panic("Didn't find an APIC driver");
|
panic("Didn't find an APIC driver");
|
||||||
}
|
}
|
||||||
printk(KERN_INFO "Using APIC driver %s\n", apic->name);
|
printk(KERN_INFO "Using APIC driver %s\n", apic->name);
|
||||||
|
@ -266,16 +267,16 @@ void __init generic_apic_probe(void)
|
||||||
int __init
|
int __init
|
||||||
generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
|
generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
|
||||||
{
|
{
|
||||||
int i;
|
struct apic **drv;
|
||||||
|
|
||||||
for (i = 0; apic_probe[i]; ++i) {
|
for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
|
||||||
if (!apic_probe[i]->mps_oem_check)
|
if (!((*drv)->mps_oem_check))
|
||||||
continue;
|
continue;
|
||||||
if (!apic_probe[i]->mps_oem_check(mpc, oem, productid))
|
if (!(*drv)->mps_oem_check(mpc, oem, productid))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!cmdline_apic) {
|
if (!cmdline_apic) {
|
||||||
apic = apic_probe[i];
|
apic = *drv;
|
||||||
printk(KERN_INFO "Switched to APIC driver `%s'.\n",
|
printk(KERN_INFO "Switched to APIC driver `%s'.\n",
|
||||||
apic->name);
|
apic->name);
|
||||||
}
|
}
|
||||||
|
@ -286,16 +287,16 @@ generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
|
||||||
|
|
||||||
int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
||||||
{
|
{
|
||||||
int i;
|
struct apic **drv;
|
||||||
|
|
||||||
for (i = 0; apic_probe[i]; ++i) {
|
for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
|
||||||
if (!apic_probe[i]->acpi_madt_oem_check)
|
if (!(*drv)->acpi_madt_oem_check)
|
||||||
continue;
|
continue;
|
||||||
if (!apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id))
|
if (!(*drv)->acpi_madt_oem_check(oem_id, oem_table_id))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!cmdline_apic) {
|
if (!cmdline_apic) {
|
||||||
apic = apic_probe[i];
|
apic = *drv;
|
||||||
printk(KERN_INFO "Switched to APIC driver `%s'.\n",
|
printk(KERN_INFO "Switched to APIC driver `%s'.\n",
|
||||||
apic->name);
|
apic->name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,19 +54,21 @@ static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
|
||||||
*/
|
*/
|
||||||
void __init default_setup_apic_routing(void)
|
void __init default_setup_apic_routing(void)
|
||||||
{
|
{
|
||||||
int i;
|
struct apic **drv;
|
||||||
|
|
||||||
enable_IR_x2apic();
|
enable_IR_x2apic();
|
||||||
|
|
||||||
for (i = 0; apic_probe[i]; ++i) {
|
for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
|
||||||
if (apic_probe[i]->probe()) {
|
if ((*drv)->probe && (*drv)->probe()) {
|
||||||
apic = apic_probe[i];
|
if (apic != *drv) {
|
||||||
|
apic = *drv;
|
||||||
|
pr_info("Switched APIC routing to %s.\n",
|
||||||
|
apic->name);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(KERN_INFO "APIC routing finalized to %s.\n", apic->name);
|
|
||||||
|
|
||||||
if (is_vsmp_box()) {
|
if (is_vsmp_box()) {
|
||||||
/* need to update phys_pkg_id */
|
/* need to update phys_pkg_id */
|
||||||
apic->phys_pkg_id = apicid_phys_pkg_id;
|
apic->phys_pkg_id = apicid_phys_pkg_id;
|
||||||
|
@ -82,13 +84,15 @@ void apic_send_IPI_self(int vector)
|
||||||
|
|
||||||
int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
||||||
{
|
{
|
||||||
int i;
|
struct apic **drv;
|
||||||
|
|
||||||
for (i = 0; apic_probe[i]; ++i) {
|
for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
|
||||||
if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
|
if ((*drv)->acpi_madt_oem_check(oem_id, oem_table_id)) {
|
||||||
apic = apic_probe[i];
|
if (apic != *drv) {
|
||||||
printk(KERN_INFO "Setting APIC routing to %s.\n",
|
apic = *drv;
|
||||||
|
pr_info("Setting APIC routing to %s.\n",
|
||||||
apic->name);
|
apic->name);
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue