File tree Expand file tree Collapse file tree 5 files changed +8
-17
lines changed
include/zephyr/arch/riscv Expand file tree Collapse file tree 5 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ extern "C" {
32
32
/** Environment Call from M-mode */
33
33
#define RISCV_EXC_ECALLM 11
34
34
35
+ #ifdef CONFIG_64BIT
36
+ #define RISCV_MCAUSE_IRQ_BIT (1 << 63)
37
+ #else
38
+ #define RISCV_MCAUSE_IRQ_BIT (1 << 31)
39
+ #endif
40
+
35
41
#ifndef _ASMLANGUAGE
36
42
37
43
extern void arch_irq_enable (unsigned int irq );
Original file line number Diff line number Diff line change 16
16
#define RISCV_MACHINE_SOFT_IRQ 3 /* Machine Software Interrupt */
17
17
#define RISCV_MACHINE_EXT_IRQ 11 /* Machine External Interrupt */
18
18
19
- /* SOC-specific MCAUSE bitfields */
20
- #ifdef CONFIG_64BIT
21
- /* Interrupt Mask */
22
- #define SOC_MCAUSE_IRQ_MASK (1 << 63)
23
- #else
24
- /* Interrupt Mask */
25
- #define SOC_MCAUSE_IRQ_MASK (1 << 31)
26
- #endif
27
-
28
19
/* Exception code Mask */
29
20
#define SOC_MCAUSE_EXP_MASK CONFIG_RISCV_SOC_MCAUSE_EXCEPTION_MASK
30
21
Original file line number Diff line number Diff line change 12
12
#include <offsets.h>
13
13
#include <zephyr/toolchain.h>
14
14
#include <zephyr/linker/sections.h>
15
- #include <soc .h>
15
+ #include <zephyr/arch/riscv/irq .h>
16
16
17
17
/*
18
18
* __soc_handle_irq is defined as .weak to allow re-implementation by
@@ -48,7 +48,7 @@ WTEXT(__soc_is_irq)
48
48
SECTION_FUNC(exception.other, __soc_is_irq)
49
49
/* Read mcause and check if interrupt bit is set */
50
50
csrr t0, mcause
51
- li t1, SOC_MCAUSE_IRQ_MASK
51
+ li t1, RISCV_MCAUSE_IRQ_BIT
52
52
and t0, t0, t1
53
53
54
54
/* If interrupt bit is not set, return with 0 */
Original file line number Diff line number Diff line change 21
21
#define RISCV_MACHINE_TIMER_IRQ 7 /* Machine Timer Interrupt */
22
22
#define RISCV_MACHINE_EXT_IRQ 11 /* Machine External Interrupt */
23
23
24
- /* Interrupt Mask */
25
- #define SOC_MCAUSE_IRQ_MASK (1 << 31)
26
-
27
24
/* Exception code Mask */
28
25
#define SOC_MCAUSE_EXP_MASK 0x7FFFFFFF
29
26
Original file line number Diff line number Diff line change 16
16
17
17
/* SOC-specific MCAUSE bitfields */
18
18
19
- /* Interrupt Mask. 1 (interrupt) or 0 (exception) */
20
- #define SOC_MCAUSE_IRQ_MASK BIT(31)
21
-
22
19
/* Exception code Mask */
23
20
#define SOC_MCAUSE_EXP_MASK 0x7FFFFFFF
24
21
You can’t perform that action at this time.
0 commit comments