From 69e9929f71aa9f134c782ef3326bc799d449b116 Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Wed, 11 May 2016 16:12:47 +0200 Subject: [PATCH] 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. --- repos/base-hw/src/core/include/spec/x86/pic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/base-hw/src/core/include/spec/x86/pic.h b/repos/base-hw/src/core/include/spec/x86/pic.h index b42c663222..13b7141b36 100644 --- a/repos/base-hw/src/core/include/spec/x86/pic.h +++ b/repos/base-hw/src/core/include/spec/x86/pic.h @@ -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(IOREDTBL + 2 * i + 1); write(irte >> Iowin::ACCESS_WIDTH);