@@ -51,7 +51,8 @@
#define IRQ_S_GEXT 12
#define IRQ_PMU_OVF 13
-#define IE_TIE (_AC(0x1, UL) << IRQ_S_TIMER)
+#define IE_SSIE (_AC(1, UL) << IRQ_S_SOFT)
+#define IE_TIE (_AC(1, UL) << IRQ_S_TIMER)
#define IP_TIP IE_TIE
@@ -32,6 +32,21 @@ static inline void local_irq_disable(void)
csr_clear(CSR_SSTATUS, SR_SIE);
}
+static inline void local_ipi_enable(void)
+{
+ csr_set(CSR_SIE, IE_SSIE);
+}
+
+static inline void local_ipi_disable(void)
+{
+ csr_clear(CSR_SIE, IE_SSIE);
+}
+
+static inline void ipi_ack(void)
+{
+ csr_clear(CSR_SIP, IE_SSIE);
+}
+
void install_exception_handler(unsigned long cause, void (*handler)(struct pt_regs *));
void install_irq_handler(unsigned long cause, void (*handler)(struct pt_regs *));
void do_handle_exception(struct pt_regs *regs);
Provide a few functions to enable/disable/acknowledge IPIs. Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- lib/riscv/asm/csr.h | 3 ++- lib/riscv/asm/processor.h | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-)