2018-10-31 16:18:34 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Intel Corporation.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2023-11-06 15:27:30 +08:00
|
|
|
#include "sw_isr_common.h"
|
2022-05-06 10:49:15 +02:00
|
|
|
#include <zephyr/sw_isr_table.h>
|
2022-10-04 15:33:53 +02:00
|
|
|
#include <zephyr/irq.h>
|
2022-05-06 10:49:15 +02:00
|
|
|
#include <zephyr/sys/__assert.h>
|
2020-03-20 11:24:39 -07:00
|
|
|
|
2023-09-20 16:08:36 +08:00
|
|
|
/*
|
2023-11-06 15:27:30 +08:00
|
|
|
* Common code for arches that use software ISR tables (CONFIG_GEN_ISR_TABLES)
|
2023-09-20 16:08:36 +08:00
|
|
|
*/
|
2020-03-20 11:24:39 -07:00
|
|
|
|
2023-11-06 15:27:30 +08:00
|
|
|
unsigned int __weak z_get_sw_isr_table_idx(unsigned int irq)
|
2020-03-20 11:24:39 -07:00
|
|
|
{
|
2023-11-20 18:18:32 +08:00
|
|
|
unsigned int table_idx = irq - CONFIG_GEN_IRQ_START_VECTOR;
|
|
|
|
|
|
|
|
__ASSERT_NO_MSG(table_idx < IRQ_TABLE_SIZE);
|
|
|
|
|
|
|
|
return table_idx;
|
2023-09-20 16:08:36 +08:00
|
|
|
}
|