Skip to content

Commit 0addc80

Browse files
gmarullcarlescufi
authored andcommitted
arch: riscv: define local soc_interrupt_init prototypes
Instead of relying on messy soc.h files which are included via a fragile chain of includes. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent c725c91 commit 0addc80

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

arch/riscv/core/prep_c.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
#include <zephyr/kernel_structs.h>
2121
#include <kernel_internal.h>
2222

23+
#if defined(CONFIG_RISCV_SOC_INTERRUPT_INIT)
24+
void soc_interrupt_init(void);
25+
#endif
26+
2327
/**
2428
*
2529
* @brief Prepare to and run C code

arch/riscv/core/smp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ volatile void *riscv_cpu_sp;
2323

2424
extern void __start(void);
2525

26+
#if defined(CONFIG_RISCV_SOC_INTERRUPT_INIT)
27+
void soc_interrupt_init(void);
28+
#endif
29+
2630
void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
2731
arch_cpustart_t fn, void *arg)
2832
{

soc/riscv/common/riscv-privileged/soc_common.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
#include <zephyr/drivers/interrupt_controller/riscv_clic.h>
1818
#include <zephyr/drivers/interrupt_controller/riscv_plic.h>
1919

20-
#if defined(CONFIG_RISCV_SOC_INTERRUPT_INIT)
21-
void soc_interrupt_init(void);
22-
#endif
23-
2420
#endif /* !_ASMLANGUAGE */
2521

2622
#endif /* __SOC_COMMON_H_ */

soc/riscv/ite_ec/it8xxx2/soc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,4 @@ COND_CODE_1(DT_NODE_EXISTS(DT_INST(1, ite_it8xxx2_usbpd)), (2), (1))
2525
*/
2626
#define SOC_USBPD_ITE_ACTIVE_PORT_COUNT DT_NUM_INST_STATUS_OKAY(ite_it8xxx2_usbpd)
2727

28-
#ifndef _ASMLANGUAGE
29-
void soc_interrupt_init(void);
30-
#endif
31-
3228
#endif /* __RISCV_ITE_SOC_H_ */

soc/riscv/openisa_rv32m1/soc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ static inline uint32_t rv32m1_intmux_line(unsigned int irq)
9494
return ((irq >> 8) & 0xff) - 1;
9595
}
9696

97-
void soc_interrupt_init(void);
98-
9997
#endif /* !_ASMLANGUAGE */
10098

10199
#if defined(CONFIG_SOC_OPENISA_RV32M1_RI5CY)

0 commit comments

Comments
 (0)