From 0dff0b53cd0566c5c7563e73fd7e3c47aff73893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E8=80=BF=E5=AE=87?= Date: Sun, 7 Apr 2024 02:41:08 +0000 Subject: [PATCH] =?UTF-8?q?ThreadX=206.4.1=20=E5=86=85=E6=A0=B8=E9=80=82?= =?UTF-8?q?=E9=85=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/tx/regression/testcontrol.c | 4 ++++ .../threadx_event_flag_suspension_timeout_test.c | 4 ---- utility/rtos_compatibility_layers/posix/posix_demo.c | 9 +++++++++ utility/rtos_compatibility_layers/posix/px_mq_receive.c | 2 +- utility/rtos_compatibility_layers/posix/tx_posix.h | 4 ++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/test/tx/regression/testcontrol.c b/test/tx/regression/testcontrol.c index a53c50a5..77da1682 100644 --- a/test/tx/regression/testcontrol.c +++ b/test/tx/regression/testcontrol.c @@ -125,6 +125,7 @@ VOID (*test_entry)(void *); /* Define the prototypes for the test entry points. */ +#ifndef __aarch64__ void threadx_block_memory_basic_application_define(void *); void threadx_block_memory_error_detection_application_define(void *); void threadx_block_memory_suspension_application_define(void *); @@ -140,6 +141,7 @@ void threadx_byte_memory_suspension_timeout_application_define(void *); void threadx_byte_memory_thread_terminate_application_define(void *); void threadx_byte_memory_prioritize_application_define(void *); void threadx_byte_memory_information_application_define(void *); +#endif void threadx_event_flag_basic_application_define(void *); void threadx_event_flag_suspension_application_define(void *); @@ -241,6 +243,7 @@ TEST_ENTRY test_control_tests[] = test_application_define, #else +#ifndef __aarch64__ threadx_block_memory_basic_application_define, threadx_block_memory_error_detection_application_define, threadx_block_memory_prioritize_application_define, @@ -256,6 +259,7 @@ TEST_ENTRY test_control_tests[] = threadx_byte_memory_prioritize_application_define, threadx_byte_memory_thread_contention_application_define, threadx_byte_memory_information_application_define, +#endif threadx_event_flag_basic_application_define, threadx_event_flag_suspension_application_define, diff --git a/test/tx/regression/threadx_event_flag_suspension_timeout_test.c b/test/tx/regression/threadx_event_flag_suspension_timeout_test.c index c689c755..f5235190 100644 --- a/test/tx/regression/threadx_event_flag_suspension_timeout_test.c +++ b/test/tx/regression/threadx_event_flag_suspension_timeout_test.c @@ -180,14 +180,10 @@ UINT status; /* Check the run counters. */ if (((thread_1_counter != 32) -#ifdef __linux__ && (thread_1_counter != 33) /* Depending on the starting time, thread 1 can run either 32 or 33 rounds. */ -#endif ) || ((thread_2_counter != 13) -#ifdef __linux__ && (thread_2_counter != 14) /* When CPU starves, the thread 2 can run 14 ronuds. */ -#endif )) { diff --git a/utility/rtos_compatibility_layers/posix/posix_demo.c b/utility/rtos_compatibility_layers/posix/posix_demo.c index 339ad9bb..eb55c4fb 100644 --- a/utility/rtos_compatibility_layers/posix/posix_demo.c +++ b/utility/rtos_compatibility_layers/posix/posix_demo.c @@ -179,6 +179,8 @@ VOID *pthread_0_entry(VOID *pthread0_input) /* This pthread simply sits in while-forever-sleep loop */ while(1) { + printf("pthread-0 counter = %d \r\n", pthread_0_counter); + /* Increment the pthread counter.*/ pthread_0_counter++; /* sleep for a while */ @@ -203,6 +205,7 @@ VOID *pthread_1_entry(VOID *pthread1_input) /* This thread simply sends a messages to a queue shared by pthread 2. */ while(1) { + printf("pthread-1 counter = %d \r\n", pthread_1_counter); /* Increment the thread counter. */ pthread_1_counter++; @@ -236,6 +239,8 @@ struct timespec thread_2_sleep_time={0,0}; /* This pthread retrieves messages placed on the queue by pthread 1. */ while(1 ) { + printf("pthread-2 counter = %d \r\n", pthread_2_counter); + /* Increment the thread counter. */ pthread_2_counter++; pt2_status = mq_receive(q_des,msgr0,MAX_MESSAGE_SIZE,&priority); @@ -263,6 +268,7 @@ struct timespec thread_3_sleep_time={0,0}; /* This function compete for ownership of semaphore_0. */ while(1) { + printf("pthread-3 counter = %d \r\n", pthread_3_counter); /* Increment the thread counter. */ pthread_3_counter++; @@ -296,6 +302,7 @@ struct timespec thread_4_sleep_time={0,0}; while(1) { + printf("pthread-4 counter = %d \r\n", pthread_4_counter); /* Increment the thread counter. */ pthread_4_counter++; @@ -324,6 +331,8 @@ struct timespec thread_5_sleep_time={0,0}; while(1) { + printf("pthread-5 counter = %d \r\n", pthread_5_counter); + /* Increment the thread counter. */ pthread_5_counter++; /* now lock the mutex */ diff --git a/utility/rtos_compatibility_layers/posix/px_mq_receive.c b/utility/rtos_compatibility_layers/posix/px_mq_receive.c index 8fac9832..ab8b57ef 100644 --- a/utility/rtos_compatibility_layers/posix/px_mq_receive.c +++ b/utility/rtos_compatibility_layers/posix/px_mq_receive.c @@ -75,7 +75,7 @@ /* resulting in version 6.2.0 */ /* */ /**************************************************************************/ -ssize_t mq_receive( mqd_t mqdes, VOID * pMsg, size_t msgLen, ULONG *pMsgPrio) +pssize_t mq_receive( mqd_t mqdes, VOID * pMsg, size_t msgLen, ULONG *pMsgPrio) { TX_QUEUE * Queue; diff --git a/utility/rtos_compatibility_layers/posix/tx_posix.h b/utility/rtos_compatibility_layers/posix/tx_posix.h index 88986402..0f552ebe 100644 --- a/utility/rtos_compatibility_layers/posix/tx_posix.h +++ b/utility/rtos_compatibility_layers/posix/tx_posix.h @@ -287,7 +287,7 @@ typedef struct pthread_attr_obj } pthread_attr_t; -typedef INT ssize_t ; /* this should be pulled in from sys\types.h */ +typedef INT pssize_t ; /* this should be pulled in from sys\types.h */ typedef ALIGN_TYPE pthread_t; typedef ULONG mode_t; @@ -482,7 +482,7 @@ VOID *posix_initialize(VOID * posix_memory); INT mq_send(mqd_t mqdes, const char * msg_ptr, size_t msg_len,ULONG msg_prio ); -ssize_t mq_receive(mqd_t mqdes, VOID *pMsg, size_t msgLen, +pssize_t mq_receive(mqd_t mqdes, VOID *pMsg, size_t msgLen, ULONG *pMsgPrio ); INT mq_unlink(const char * mqName); INT mq_close(mqd_t mqdes); -- Gitee