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>
This commit is contained in:
parent
2b7db7f395
commit
d19c499037
@ -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)
|
||||
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…
Reference in New Issue
Block a user