aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-10-18 19:43:49 +0300
committerFelix Held <felix-coreboot@felixheld.de>2021-10-22 14:15:06 +0000
commit6139ff9c9aa0b941b1c178058e4d10baa23fff70 (patch)
tree8cfb7709a58275fab199d0ba94179941e2edf4f7
parent04a40379b0cbc96c25498ec69520cb7cd85f3fe4 (diff)
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>
-rw-r--r--src/arch/x86/ioapic.c6
1 files changed, 3 insertions, 3 deletions
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);