From 7c2ea3fe6b18a48e6ac53db572601541c5dfda32 Mon Sep 17 00:00:00 2001 From: Dev10-sys Date: Sat, 21 Nov 2026 14:53:33 +0530 Subject: [PATCH] Dropped the SMP Linux port memory sync test coverage macro In _tx_initialize_kernel_enter (common_smp/src/tx_initialize_kernel_enter.c), the kernel waits for secondary cores to become ready with a loop: do { ... } while (other_core_status != ((ULONG) 0)); On the SMP Linux port, virtual cores are simulated rather than backed by hardware secondary cores. TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION (tx_port.h:427) zeroes _tx_thread_system_state[1 .. TX_THREAD_SMP_MAX_CORES-1] on core 0 before the loop begins, causing the loop condition to evaluate to false on the first pass. To force both outcomes of the loop-back branch in coverage reports, the port's TX_REGRESSION_TEST block defined TX_PORT_SPECIFIC_MEMORY_SYNCHRONIZATION to fold core 0's own _tx_thread_system_state[0] into other_core_status and clear it. This artificially forced a second loop pass, misrepresenting the loop-back branch as covered when the port cannot exercise it. Dropped the TX_PORT_SPECIFIC_MEMORY_SYNCHRONIZATION macro from the TX_REGRESSION_TEST block in ports_smp/linux/gnu/inc/tx_port.h, falling back to its default empty definition in common_smp/inc/tx_api.h. Line 167 remains 100% line-covered while the coverage report accurately reflects that the loop-back edge is unreached on this simulated port. Verified with the full SMP regression suite: all 118 ctest cases pass cleanly. Fixes: #768 Signed-off-by: Dev10-sys --- ports_smp/linux/gnu/inc/tx_port.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports_smp/linux/gnu/inc/tx_port.h b/ports_smp/linux/gnu/inc/tx_port.h index 2a2e7ee42..843d264f8 100644 --- a/ports_smp/linux/gnu/inc/tx_port.h +++ b/ports_smp/linux/gnu/inc/tx_port.h @@ -194,10 +194,6 @@ extern UINT priority_change_extension_selection; /* Define extension macros for automated coverage tests. */ -#define TX_PORT_SPECIFIC_MEMORY_SYNCHRONIZATION other_core_status = other_core_status + _tx_thread_system_state[0]; \ - _tx_thread_system_state[0] = 0; - - #define TX_BYTE_ALLOCATE_EXTENSION if (threadx_byte_allocate_loop_test == ((TEST_FLAG) 1)) \ { \ pool_ptr -> tx_byte_pool_owner = TX_NULL; \