Skip to content

Cherry pick changes needed for building with nothreading and no sw isr table #3167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions arch/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ zephyr_library_property(ALLOW_EMPTY TRUE)

if(CONFIG_GEN_ISR_TABLES)
zephyr_library_sources(
isr_tables.c
sw_isr_common.c
)
zephyr_library_sources_ifdef(
Expand Down Expand Up @@ -96,19 +97,6 @@ if (DEFINED CONFIG_ARM OR DEFINED CONFIG_X86 OR DEFINED CONFIG_ARM64 OR DEFINED
# Handled in ld.cmake
endif()


# isr_tables is a normal CMake library and not a zephyr_library because it
# should not be --whole-archive'd
if (CONFIG_GEN_ISR_TABLES)
add_library(isr_tables
isr_tables.c
)

add_dependencies(isr_tables zephyr_generated_headers)
target_link_libraries(isr_tables zephyr_interface)
zephyr_library_link_libraries(isr_tables)
endif()

if(CONFIG_COVERAGE)
zephyr_compile_options($<TARGET_PROPERTY:compiler,coverage>)
zephyr_link_libraries_ifndef(CONFIG_NATIVE_LIBRARY $<TARGET_PROPERTY:linker,coverage>)
Expand Down
1 change: 1 addition & 0 deletions drivers/serial/Kconfig.nrfx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ config UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY

config UART_NRFX_UARTE_DIRECT_ISR
bool "Use direct ISR"
default y if !MULTITHREADING

config UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND
bool
Expand Down
6 changes: 4 additions & 2 deletions drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -3458,12 +3458,14 @@

/* Declare interrupt handler for direct ISR. */
#define UARTE_DIRECT_ISR_DECLARE(idx) \
IF_ENABLED(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, ( \

Check notice on line 3461 in drivers/serial/uart_nrfx_uarte.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/serial/uart_nrfx_uarte.c:3461 -#define UARTE_DIRECT_ISR_DECLARE(idx) \ +#define UARTE_DIRECT_ISR_DECLARE(idx) \
ISR_DIRECT_DECLARE(uarte_##idx##_direct_isr) \
{ \
ISR_DIRECT_PM(); \
IF_ENABLED(CONFIG_MULTITHREADING, (ISR_DIRECT_PM();)) \
UARTE_GET_ISR(idx)(DEVICE_DT_GET(UARTE(idx))); \
return 1; \
COND_CODE_1(CONFIG_MULTITHREADING, \
(return 1;), \
(return 0;)) \
} \
))

Expand Down
4 changes: 4 additions & 0 deletions drivers/timer/Kconfig.nrf_grtc
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ config NRF_GRTC_TIMER_AUTO_KEEP_ALIVE
This feature prevents the SYSCOUNTER from sleeping when any core is in
active state.

config NRF_GRTC_TIMER_ISR_DIRECT
bool "Use direct ISR"
default y if !MULTITHREADING

endif # NRF_GRTC_TIMER
27 changes: 25 additions & 2 deletions drivers/timer/nrf_grtc_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,35 @@
return (uint32_t)(counter_sub(counter(), last_count) / CYC_PER_TICK);
}

#if CONFIG_NRF_GRTC_TIMER_ISR_DIRECT
ISR_DIRECT_DECLARE(nrf_grtc_irq_handler)
{
nrfx_grtc_irq_handler();
#if CONFIG_MULTITHREADING
ISR_DIRECT_PM();
return 1;
#else
return 0;
#endif
}
#endif

static int sys_clock_driver_init(void)
{
nrfx_err_t err_code;

IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr,
nrfx_grtc_irq_handler, 0);
#ifdef CONFIG_NRF_GRTC_TIMER_ISR_DIRECT
IRQ_DIRECT_CONNECT(DT_IRQN(GRTC_NODE),
DT_IRQ(GRTC_NODE, priority),
nrf_grtc_irq_handler,
0);
#else
IRQ_CONNECT(DT_IRQN(GRTC_NODE),
DT_IRQ(GRTC_NODE, priority),
nrfx_isr,
nrfx_grtc_irq_handler,
0);
#endif

Check notice on line 486 in drivers/timer/nrf_grtc_timer.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/timer/nrf_grtc_timer.c:486 - IRQ_DIRECT_CONNECT(DT_IRQN(GRTC_NODE), - DT_IRQ(GRTC_NODE, priority), - nrf_grtc_irq_handler, + IRQ_DIRECT_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrf_grtc_irq_handler, 0); #else - IRQ_CONNECT(DT_IRQN(GRTC_NODE), - DT_IRQ(GRTC_NODE, priority), - nrfx_isr, - nrfx_grtc_irq_handler, - 0); + IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr, + nrfx_grtc_irq_handler, 0);

#if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && NRF_GRTC_HAS_CLKSEL
#if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC)
Expand Down
Loading