hw_x86_64: Change IRTE_COUNT to designate number of IRTEs

Adjust IRTE_COUNT to specify the number of IRTEs and not the index of
the last IRTE entry. This fixes an off-by-one error in the toggle_mask()
function, where the range check for I/O APIC IRQs wrongly ignored IRQ
23.
This commit is contained in:
Adrian-Ken Rueegsegger 2016-05-11 16:12:47 +02:00 committed by Christian Helmuth
parent 61572263d7
commit 69e9929f71
1 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ class Genode::Ioapic : public Mmio
enum {
/* Number of Redirection Table entries */
IRTE_COUNT = 0x17,
IRTE_COUNT = 24,
/* Register selectors */
IOAPICVER = 0x01,
@ -140,7 +140,7 @@ class Genode::Ioapic : public Mmio
}
/* remap all IRQs managed by I/O APIC */
if (i <= IRTE_COUNT) {
if (i < IRTE_COUNT) {
Irte::access_t irte = _create_irt_entry(i);
write<Ioregsel>(IOREDTBL + 2 * i + 1);
write<Iowin>(irte >> Iowin::ACCESS_WIDTH);