arch/x86/ioapic: Allow IOAPIC with only one vector

Remove the test for count=0 that leaked from drivers/generic/ioapic
implementation. See commit ea2fb8d80 and commit 8cc25d229.

Change-Id: I26944b930851fbea160c844ea46e2faa61c9af8e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58423
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Kyösti Mälkki 2021-10-18 19:43:49 +03:00 committed by Felix Held
parent 04a40379b0
commit 6139ff9c9a
1 changed files with 3 additions and 3 deletions

View File

@ -35,9 +35,9 @@ unsigned int ioapic_get_max_vectors(void *ioapic_base)
u8 count;
reg = io_apic_read(ioapic_base, 0x01);
count = reg >> 16;
count = (reg >> 16) & 0xff;
if (!count || count == 0xff)
if (count == 0xff)
count = 23;
count++;
@ -54,7 +54,7 @@ void ioapic_set_max_vectors(void *ioapic_base, int mre_count)
u8 count;
reg = io_apic_read(ioapic_base, 0x01);
count = reg >> 16;
count = (reg >> 16) & 0xff;
if (mre_count > 0)
count = mre_count - 1;
reg &= ~(0xff << 16);