From 1aaa3d29ce61ad1c9f16ba3480d9fa485fcabe8f Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Mon, 14 Oct 2019 14:55:03 -0700 Subject: [PATCH] riscv: properly pull in irq_offload logic This is an optional feature and no logic for it should be present unless CONFIG_IRQ_OFFLOAD is enabled. Signed-off-by: Andrew Boie --- arch/riscv/core/CMakeLists.txt | 3 ++- arch/riscv/core/isr.S | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/riscv/core/CMakeLists.txt b/arch/riscv/core/CMakeLists.txt index 4b671326976..3b14112e0a6 100644 --- a/arch/riscv/core/CMakeLists.txt +++ b/arch/riscv/core/CMakeLists.txt @@ -4,10 +4,11 @@ zephyr_sources( cpu_idle.c fatal.c irq_manage.c - irq_offload.c isr.S prep_c.c reset.S swap.S thread.c ) + +zephyr_sources_if_kconfig(irq_offload.c) diff --git a/arch/riscv/core/isr.S b/arch/riscv/core/isr.S index a9b449a4c1f..6fc5613bcee 100644 --- a/arch/riscv/core/isr.S +++ b/arch/riscv/core/isr.S @@ -211,6 +211,7 @@ on_irq_stack: addi t3, t3, 1 sw t3, _kernel_offset_to_nested(t2) +#ifdef CONFIG_IRQ_OFFLOAD /* * If we are here due to a system call, t1 register should != 0. * In this case, perform IRQ offloading, otherwise jump to call_irq @@ -226,6 +227,7 @@ on_irq_stack: tail z_irq_do_offload call_irq: +#endif /* CONFIG_IRQ_OFFLOAD */ #ifdef CONFIG_TRACING call sys_trace_isr_enter #endif