From 9727812fb2bcb6dda29c32cbb053014daba6e018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Desbiens?= Date: Sun, 9 Aug 2026 09:19:44 -0400 Subject: [PATCH] Removed the duplicated function body in the Cortex-M4 AC6 port _tx_thread_system_return_inline() in the Cortex-M4 AC6 tx_port.h was followed by a second, orphaned copy of its own body. The copy had no function header, so it declared interrupt_save at file scope and then placed statements there, which does not compile. It is also the older version of the body, without the dsb and isb barriers, so it was left behind rather than intended: the barriers were added by commit 33efad3f and the previous text was not removed. Delete the orphaned copy. What remains is the same body every sibling port carries: after this change ports/cortex_m4/ac6/inc/tx_port.h differs from ports/cortex_m4/iar/inc/tx_port.h and ports/cortex_m7/ac6/inc/tx_port.h only in the port name in the banner and the version string, as it should. Verified by compiling the function in isolation, which fails on the file scope statements before the change and is clean afterwards, and by a structural scan of all 208 tx_port.h files in the repository confirming this was the only occurrence. Fixes https://github.com/eclipse-threadx/threadx/issues/569 Assisted-by: Claude Code (Opus 5) --- ports/cortex_m4/ac6/inc/tx_port.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/ports/cortex_m4/ac6/inc/tx_port.h b/ports/cortex_m4/ac6/inc/tx_port.h index 4b634b64b..e1d21df1a 100644 --- a/ports/cortex_m4/ac6/inc/tx_port.h +++ b/ports/cortex_m4/ac6/inc/tx_port.h @@ -11,6 +11,7 @@ // Some portions generated by Gemini (Gemini 2.0 Flash). // Some portions generated by Copilot (Claude Sonnet 4.6). +// Some portions generated by Claude Code (Opus 5). /**************************************************************************/ @@ -594,21 +595,6 @@ unsigned int interrupt_save; __restore_interrupt(interrupt_save); } } -unsigned int interrupt_save; - - /* Set PendSV to invoke ThreadX scheduler. */ - *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); - if (__get_ipsr_value() == 0) - { - interrupt_save = __get_interrupt_posture(); -#ifdef TX_PORT_USE_BASEPRI - __set_basepri_value(0); -#else - __enable_interrupts(); -#endif - __restore_interrupt(interrupt_save); - } -} #define TX_INTERRUPT_SAVE_AREA UINT interrupt_save; #define TX_DISABLE interrupt_save = __disable_interrupts();