hw: off-by-one bug when determining the last IRQ

Fix #1169
This commit is contained in:
Stefan Kalkowski 2014-06-04 15:32:38 +02:00 committed by Norman Feske
parent f48bfd5db9
commit 6d12f4eba7
2 changed files with 3 additions and 3 deletions

View File

@ -303,8 +303,8 @@ extern "C" void init_kernel_multiprocessor()
t.init(processor, core_pd(), &utcb, 1);
/* initialize interrupt objects */
static Genode::uint8_t _irqs[Pic::MAX_INTERRUPT_ID * sizeof(Irq)];
for (unsigned i = 0; i < Pic::MAX_INTERRUPT_ID; i++) {
static Genode::uint8_t _irqs[(Pic::MAX_INTERRUPT_ID+1) * sizeof(Irq)];
for (unsigned i = 0; i <= Pic::MAX_INTERRUPT_ID; i++) {
if (private_interrupt(i)) { continue; }
new (&_irqs[i * sizeof(Irq)]) Irq(i);
}

View File

@ -132,7 +132,7 @@ Platform::Platform()
_core_only_ram_regions, get_page_size_log2());
/* make interrupts available to the interrupt allocator */
for (unsigned i = 0; i < Kernel::Pic::MAX_INTERRUPT_ID; i++)
for (unsigned i = 0; i <= Kernel::Pic::MAX_INTERRUPT_ID; i++)
_irq_alloc.add_range(i, 1);
/*