提交 e3e3ffa2 编写于 作者: A Alexey Starikovskiy 提交者: Ingo Molnar

x86: add uniq_ioapic_id to mpparse_32.c

Signed-off-by: NAlexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 857033a6
...@@ -922,31 +922,30 @@ static int mp_find_ioapic (int gsi) ...@@ -922,31 +922,30 @@ static int mp_find_ioapic (int gsi)
return -1; return -1;
} }
static u8 uniq_ioapic_id(u8 id)
{
if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) &&
!APIC_XAPIC(apic_version[boot_cpu_physical_apicid]))
return io_apic_get_unique_id(nr_ioapics, id);
else
return id;
}
void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base) void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
{ {
int idx = 0; int idx = 0;
int tmpid;
if (bad_ioapic(address)) if (bad_ioapic(address))
return; return;
idx = nr_ioapics++; idx = nr_ioapics;
mp_ioapics[idx].mpc_type = MP_IOAPIC; mp_ioapics[idx].mpc_type = MP_IOAPIC;
mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE; mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE;
mp_ioapics[idx].mpc_apicaddr = address; mp_ioapics[idx].mpc_apicaddr = address;
set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) mp_ioapics[idx].mpc_apicid = uniq_ioapic_id(id);
&& !APIC_XAPIC(apic_version[boot_cpu_physical_apicid]))
tmpid = io_apic_get_unique_id(idx, id);
else
tmpid = id;
if (tmpid == -1) {
nr_ioapics--;
return;
}
mp_ioapics[idx].mpc_apicid = tmpid;
mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx); mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx);
/* /*
...@@ -960,9 +959,12 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base) ...@@ -960,9 +959,12 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, " printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
"GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, "GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid,
mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr, mp_ioapics[idx].mpc_apicver,
mp_ioapics[idx].mpc_apicaddr,
mp_ioapic_routing[idx].gsi_base, mp_ioapic_routing[idx].gsi_base,
mp_ioapic_routing[idx].gsi_end); mp_ioapic_routing[idx].gsi_end);
nr_ioapics++;
} }
void __init void __init
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册