Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62352
b: refs/heads/master
c: 78b599a
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Jul 22, 2007
1 parent 3cd8587 commit 9cbd649
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d531cc1193693f2d2e5ef2532a877481b118be6
refs/heads/master: 78b599aed61a1098444558e74c93745f22eda6cb
20 changes: 18 additions & 2 deletions trunk/arch/x86_64/kernel/mpparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,21 +649,35 @@ static int mp_find_ioapic(int gsi)
return -1;
}

static u8 uniq_ioapic_id(u8 id)
{
int i;
DECLARE_BITMAP(used, 256);
bitmap_zero(used, 256);
for (i = 0; i < nr_ioapics; i++) {
struct mpc_config_ioapic *ia = &mp_ioapics[i];
__set_bit(ia->mpc_apicid, used);
}
if (!test_bit(id, used))
return id;
return find_first_zero_bit(used, 256);
}

void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
{
int idx = 0;

if (bad_ioapic(address))
return;

idx = nr_ioapics++;
idx = nr_ioapics;

mp_ioapics[idx].mpc_type = MP_IOAPIC;
mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE;
mp_ioapics[idx].mpc_apicaddr = address;

set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
mp_ioapics[idx].mpc_apicid = id;
mp_ioapics[idx].mpc_apicid = uniq_ioapic_id(id);
mp_ioapics[idx].mpc_apicver = 0;

/*
Expand All @@ -680,6 +694,8 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
mp_ioapics[idx].mpc_apicaddr,
mp_ioapic_routing[idx].gsi_start,
mp_ioapic_routing[idx].gsi_end);

nr_ioapics++;
}

void __init
Expand Down

0 comments on commit 9cbd649

Please sign in to comment.