From 6139ff9c9aa0b941b1c178058e4d10baa23fff70 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Mon, 18 Oct 2021 19:43:49 +0300 Subject: arch/x86/ioapic: Allow IOAPIC with only one vector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58423 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/arch/x86/ioapic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c index 22d979dfda..d299e6070d 100644 --- a/src/arch/x86/ioapic.c +++ b/src/arch/x86/ioapic.c @@ -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); -- cgit v1.2.3