Browse Source

drivers: interrupt-controller: vim: Compare interrupt numbers

To avoid misconfigurations a comparision has been added which compares the
amount of reported interrupts from the VIM interrupt controller with the
configured number of interrupts via Kconfig.

Signed-off-by: Mika Braunschweig <mika.braunschweig@siemens.com>
pull/88739/head
Mika Braunschweig 3 months ago committed by Benjamin Cabé
parent
commit
d19c499037
  1. 6
      drivers/interrupt_controller/intc_vim.c

6
drivers/interrupt_controller/intc_vim.c

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
#include <zephyr/drivers/interrupt_controller/intc_vim.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include "zephyr/sys/__assert.h"
#include <zephyr/sys/util_macro.h>
LOG_MODULE_REGISTER(vim);
@ -58,6 +59,11 @@ void z_vim_irq_eoi(unsigned int irq) @@ -58,6 +59,11 @@ void z_vim_irq_eoi(unsigned int irq)
void z_vim_irq_init(void)
{
uint32_t num_of_irqs = sys_read32(VIM_INFO) & VIM_INFO_INTERRUPTS_MASK;
__ASSERT(CONFIG_NUM_IRQS == num_of_irqs,
"Number of configured interrupts (%d) doesn't match reported "
"(%" PRIu32 ") interrupts",
CONFIG_NUM_IRQS, num_of_irqs);
LOG_DBG("VIM: Number of IRQs = %u\n", num_of_irqs);
}

Loading…
Cancel
Save