From 52e4c197f3c706c787041a794a502ac7b184591e Mon Sep 17 00:00:00 2001 From: Wayne Ren Date: Wed, 29 Nov 2017 16:55:18 +0800 Subject: [PATCH] arch: arc: Add FIRQ option Add FIRQ option and change the _isr_wrapper. Currently, firq is enabled by default, but in some arc configuration, firq can be disabled. Signed-off-by: Wayne Ren --- arch/arc/Kconfig | 11 +++++++++++ arch/arc/core/CMakeLists.txt | 3 ++- arch/arc/core/isr_wrapper.S | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index f098239e881..d050d327e58 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -89,6 +89,17 @@ config RGF_NUM_BANKS register bank, the fast interrupt handler must save and restore general purpose registers. +config ARC_FIRQ + bool + prompt "FIRQ enable" + default y + help + Fast interrupts are supported (FIRQ). If FIRQ enabled, for interrupts + with highest priority, status32 and pc will be saved in aux regs, + other regs will be saved according to the number of register bank; + If FIRQ is disabled, the handle of interrupts with highest priority + will be same with other interrupts. + config ARC_STACK_CHECKING bool default y if HW_STACK_PROTECTION diff --git a/arch/arc/core/CMakeLists.txt b/arch/arc/core/CMakeLists.txt index 73beb875808..6fd3c7159d8 100644 --- a/arch/arc/core/CMakeLists.txt +++ b/arch/arc/core/CMakeLists.txt @@ -2,7 +2,6 @@ zephyr_sources( thread.c thread_entry_wrapper.S cpu_idle.S - fast_irq.S fatal.c fault.c fault_s.S @@ -18,6 +17,8 @@ zephyr_sources( vector_table.c ) +zephyr_sources_ifdef(CONFIG_ARC_FIRQ fast_irq.S) + zephyr_sources_if_kconfig(irq_offload.c) zephyr_sources_ifdef(CONFIG_ATOMIC_OPERATIONS_CUSTOM atomic.c) add_subdirectory_ifdef(CONFIG_CPU_HAS_MPU mpu) diff --git a/arch/arc/core/isr_wrapper.S b/arch/arc/core/isr_wrapper.S index 81f3c69d0d5..ad5ef5ac4c4 100644 --- a/arch/arc/core/isr_wrapper.S +++ b/arch/arc/core/isr_wrapper.S @@ -229,6 +229,7 @@ From RIRQ: */ SECTION_FUNC(TEXT, _isr_wrapper) +#if CONFIG_ARC_FIRQ #if CONFIG_RGF_NUM_BANKS == 1 st r0,[saved_r0] #endif @@ -286,6 +287,11 @@ rirq_path: mov.nz r2, _rirq_enter j_s [r2] #endif +#else + mov r3, _rirq_exit + mov r2, _rirq_enter + j_s [r2] +#endif #ifdef CONFIG_KERNEL_EVENT_LOGGER_SLEEP GTEXT(_sys_k_event_logger_exit_sleep)