File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ zephyr_cc_option(-ffunction-sections -fdata-sections)
55zephyr_sources_ifdef(
66 CONFIG_GEN_ISR_TABLES
77 isr_tables.c
8+ sw_isr_common.c
89 )
910
1011zephyr_sources_ifdef(
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2018 Intel Corporation.
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ #include <sw_isr_table.h>
8+ #include <arch/cpu.h>
9+ #include <misc/__assert.h>
10+ /*
11+ * Common code for arches that use software ISR tables (CONFIG_GEN_ISR_TABLES)
12+ */
13+
14+ #ifdef CONFIG_DYNAMIC_INTERRUPTS
15+ void z_isr_install (unsigned int irq , void (* routine )(void * ), void * param )
16+ {
17+ unsigned int table_idx = irq - CONFIG_GEN_IRQ_START_VECTOR ;
18+
19+ __ASSERT (!irq_is_enabled (irq ), "IRQ %d is enabled" , irq );
20+
21+ /* If dynamic IRQs are enabled, then the _sw_isr_table is in RAM and
22+ * can be modified
23+ */
24+ _sw_isr_table [table_idx ].arg = param ;
25+ _sw_isr_table [table_idx ].isr = routine ;
26+ }
27+ #endif /* CONFIG_DYNAMIC_INTERRUPTS */
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ struct _isr_list {
7171
7272#define IRQ_TABLE_SIZE (CONFIG_NUM_IRQS - CONFIG_GEN_IRQ_START_VECTOR)
7373
74+ #ifdef CONFIG_DYNAMIC_INTERRUPTS
75+ void z_isr_install (unsigned int irq , void (* routine )(void * ), void * param );
76+ #endif
77+
7478#endif /* _ASMLANGUAGE */
7579
7680#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments