Skip to content

Commit dfdbbd1

Browse files
committed
soc: riscv: bouffalolab: Remove unused __soc_is_irq function
The __soc_is_irq function is only used when CONFIG_RISCV_SOC_EXCEPTION_FROM_IRQ is enabled, which is not the case for any Bouffalolab SoC. Therefore, the function is dead code. Although the implementation is more complex than the default, it results in the same behavior, making it effectively redundant. Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
1 parent 7ba9d81 commit dfdbbd1

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

soc/bflb/common/soc_irq.S

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,3 @@ SECTION_FUNC(exception.other, __soc_handle_irq)
2929

3030
/* Return */
3131
jalr x0, ra
32-
33-
/*
34-
* __soc_is_irq is defined as .weak to allow re-implementation by
35-
* SOCs that does not truly follow the riscv privilege specification.
36-
*/
37-
WTEXT(__soc_is_irq)
38-
39-
/*
40-
* SOC-specific function to determine if the exception is the result of a
41-
* an interrupt or an exception
42-
* return 1 (interrupt) or 0 (exception)
43-
*
44-
*/
45-
SECTION_FUNC(exception.other, __soc_is_irq)
46-
/* Read mcause and check if interrupt bit is set */
47-
csrr t0, mcause
48-
li t1, SOC_MCAUSE_IRQ_MASK
49-
and t0, t0, t1
50-
51-
/* If interrupt bit is not set, return with 0 */
52-
addi a0, x0, 0
53-
beqz t0, not_interrupt
54-
addi a0, a0, 1
55-
56-
not_interrupt:
57-
/* return */
58-
jalr x0, ra

0 commit comments

Comments
 (0)