diff options
author | Aladyshev Konstantin <aladyshev@nicevt.ru> | 2012-12-18 22:29:20 +0400 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2013-01-23 13:16:57 +0100 |
commit | be0e92568f115488e0555ec67a27a6b93d212a4e (patch) | |
tree | 70f9fd2c0a4f87849548f94662e735e51654c442 /src/arch/x86/lib/ioapic.c | |
parent | d5c998be99709c92f200b3b08aed2ca3fee2d519 (diff) |
clear_ioapic: Fix reading of number of interrupts for IO-APICs
Apply the same fix for `setup_ioapic` as done in the following commit.
commit 23c046b6f16805ff0131460189967bf261d704de Author: Nico Huber <nico.huber@secunet.com> Date: Mon Sep 24 10:48:43 2012 +0200
Fix reading of number of interrupts for IO-APICs
The number read from the io-apic register represents the index of the
highest interrupt redirection entry, i.e. the number of interrupts
minus one.
Change-Id: I54c992e4ff400de24bb9fef5d82251078f92c588
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/1624
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Change-Id: I7b730d016a514c95c3b32aee6f31bd3d7b2c08cb
Signed-off-by: Aladyshev Konstantin <aladyshev@nicevt.ru>
Reviewed-on: http://review.coreboot.org/2043
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/arch/x86/lib/ioapic.c')
-rw-r--r-- | src/arch/x86/lib/ioapic.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/arch/x86/lib/ioapic.c b/src/arch/x86/lib/ioapic.c index 018a42c173..e05d80c7a6 100644 --- a/src/arch/x86/lib/ioapic.c +++ b/src/arch/x86/lib/ioapic.c @@ -43,8 +43,11 @@ void clear_ioapic(u32 ioapic_base) /* Read the available number of interrupts. */ ioapic_interrupts = (io_apic_read(ioapic_base, 0x01) >> 16) & 0xff; - if (!ioapic_interrupts || ioapic_interrupts == 0xff) - ioapic_interrupts = 24; + if (ioapic_interrupts == 0xff) + ioapic_interrupts = 23; + ioapic_interrupts += 1; /* Bits 23-16 specify the maximum redirection + entry, which is the number of interrupts + minus 1. */ printk(BIOS_DEBUG, "IOAPIC: %d interrupts\n", ioapic_interrupts); low = DISABLED; |