initial test harness for smp regression

This commit is contained in:
2026-03-24 18:00:50 +01:00
parent 7253aadd52
commit c11f68d20c
8 changed files with 605 additions and 12 deletions

View File

@@ -77,6 +77,8 @@
/************* Define ThreadX SMP constants. *************/
#define TX_DISABLE_INLINE
/* Define the ThreadX SMP maximum number of cores. */
#ifndef TX_THREAD_SMP_MAX_CORES
@@ -271,6 +273,109 @@ typedef unsigned short USHORT;
#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr)
#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr)
/* Define automated regression test extensions. These are required for the
ThreadX regression tests. */
typedef unsigned int TEST_FLAG;
extern TEST_FLAG threadx_byte_allocate_loop_test;
extern TEST_FLAG threadx_byte_release_loop_test;
extern TEST_FLAG threadx_mutex_suspension_put_test;
extern TEST_FLAG threadx_mutex_suspension_priority_test;
#ifndef TX_TIMER_PROCESS_IN_ISR
extern TEST_FLAG threadx_delete_timer_thread;
#endif
extern void abort_and_resume_byte_allocating_thread(void);
extern void abort_all_threads_suspended_on_mutex(void);
extern void suspend_lowest_priority(void);
#ifndef TX_TIMER_PROCESS_IN_ISR
extern void delete_timer_thread(void);
#endif
extern TEST_FLAG test_stack_analyze_flag;
extern TEST_FLAG test_initialize_flag;
extern TEST_FLAG test_forced_mutex_timeout;
#ifdef TX_REGRESSION_TEST
/* Define extension macros for automated coverage tests. */
#define TX_BYTE_ALLOCATE_EXTENSION \
if (threadx_byte_allocate_loop_test == ((TEST_FLAG)1)) \
{ \
pool_ptr->tx_byte_pool_owner = TX_NULL; \
threadx_byte_allocate_loop_test = ((TEST_FLAG)0); \
}
#define TX_BYTE_RELEASE_EXTENSION \
if (threadx_byte_release_loop_test == ((TEST_FLAG)1)) \
{ \
threadx_byte_release_loop_test = ((TEST_FLAG)0); \
abort_and_resume_byte_allocating_thread(); \
}
#define TX_MUTEX_PUT_EXTENSION_1 \
if (threadx_mutex_suspension_put_test == ((TEST_FLAG)1)) \
{ \
threadx_mutex_suspension_put_test = ((TEST_FLAG)0); \
abort_all_threads_suspended_on_mutex(); \
}
#define TX_MUTEX_PUT_EXTENSION_2 \
if (test_forced_mutex_timeout == ((TEST_FLAG)1)) \
{ \
test_forced_mutex_timeout = ((TEST_FLAG)0); \
_tx_thread_wait_abort(mutex_ptr->tx_mutex_suspension_list); \
}
#define TX_MUTEX_PRIORITY_CHANGE_EXTENSION \
if (threadx_mutex_suspension_priority_test == ((TEST_FLAG)1)) \
{ \
threadx_mutex_suspension_priority_test = ((TEST_FLAG)0); \
suspend_lowest_priority(); \
}
#ifndef TX_TIMER_PROCESS_IN_ISR
#define TX_TIMER_INITIALIZE_EXTENSION(a) \
if (threadx_delete_timer_thread == ((TEST_FLAG)1)) \
{ \
threadx_delete_timer_thread = ((TEST_FLAG)0); \
delete_timer_thread(); \
(a) = ((UINT)1); \
}
#endif
#define TX_THREAD_STACK_ANALYZE_EXTENSION \
if (test_stack_analyze_flag == ((TEST_FLAG)1)) \
{ \
thread_ptr->tx_thread_id = ((TEST_FLAG)0); \
test_stack_analyze_flag = ((TEST_FLAG)0); \
} \
else if (test_stack_analyze_flag == ((TEST_FLAG)2)) \
{ \
stack_ptr = thread_ptr->tx_thread_stack_start; \
test_stack_analyze_flag = ((TEST_FLAG)0); \
} \
else if (test_stack_analyze_flag == ((TEST_FLAG)3)) \
{ \
*stack_ptr = TX_STACK_FILL; \
test_stack_analyze_flag = ((TEST_FLAG)0); \
} \
else \
{ \
test_stack_analyze_flag = ((TEST_FLAG)0); \
}
#define TX_INITIALIZE_KERNEL_ENTER_EXTENSION \
if (test_initialize_flag == ((TEST_FLAG)1)) \
{ \
test_initialize_flag = ((TEST_FLAG)0); \
return; \
}
#endif
/* Define the ThreadX object creation extensions for the remaining objects. */
#define TX_BLOCK_POOL_CREATE_EXTENSION(pool_ptr)