diff options
| author | Frédéric Desbiens <[email protected]> | 2026-03-06 19:27:49 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-06 19:27:49 +0100 |
| commit | 3726d7906b4808bfec7855fc088e073199df9120 (patch) | |
| tree | 8789bfd03d1d49e1967e80d04aa4ff606fda43eb /test/smp/regression/threadx_byte_memory_suspension_test.c | |
| parent | 4b6e8100d932a3a67b34c6eb17f84f3bffb9e2ae (diff) | |
| parent | c3259a216026372e3833dd8996a68f77e8595fbd (diff) | |
Merge pull request #510 from eclipse-threadx/devv6.5.0.202601_rel
Merge changes ahead of the v6.5.0.202601 release
Diffstat (limited to 'test/smp/regression/threadx_byte_memory_suspension_test.c')
| -rw-r--r-- | test/smp/regression/threadx_byte_memory_suspension_test.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/test/smp/regression/threadx_byte_memory_suspension_test.c b/test/smp/regression/threadx_byte_memory_suspension_test.c index 069410c5..ba159894 100644 --- a/test/smp/regression/threadx_byte_memory_suspension_test.c +++ b/test/smp/regression/threadx_byte_memory_suspension_test.c @@ -43,12 +43,12 @@ UCHAR *search_ptr; /* Adjust the search pointer to avoid the search pointer change for this test. */ search_ptr = pool_0.tx_byte_pool_search; while (search_ptr >= pool_0.tx_byte_pool_search) - + { search_ptr = *((UCHAR **) ((VOID *) search_ptr)); } pool_0.tx_byte_pool_search = search_ptr; - + tx_thread_wait_abort(&thread_3); tx_thread_resume(&thread_3); } @@ -77,8 +77,8 @@ CHAR *pointer; /* Put system definition stuff in here, e.g. thread creates and other assorted create information. */ - status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -90,8 +90,8 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_AUTO_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -103,12 +103,12 @@ CHAR *pointer; test_control_return(1); } - status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, TEST_STACK_SIZE_PRINTF, + status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, TEST_STACK_SIZE_PRINTF, 17, 17, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; - status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, - pointer, TEST_STACK_SIZE_PRINTF, + status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3, + pointer, TEST_STACK_SIZE_PRINTF, 16, 16, 100, TX_DONT_START); pointer = pointer + TEST_STACK_SIZE_PRINTF; @@ -146,7 +146,7 @@ CHAR *pointer; /* Inform user. */ printf("Running Byte Memory Suspension Test................................. "); - + /* Increment the thread counter. */ thread_0_counter++; @@ -188,7 +188,7 @@ CHAR *pointer; printf("ERROR #7\n"); test_control_return(1); } - + /* Now allocate the memory again. Only one block of this size will fit. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 60, TX_NO_WAIT); @@ -200,15 +200,15 @@ CHAR *pointer; printf("ERROR #8\n"); test_control_return(1); } - + /* Resume the second thread. */ tx_thread_resume(&thread_2); - + /* Now relinquish to let both thread 1 and 2 suspend. */ tx_thread_relinquish(); - + /* At this point both threads should be suspended on the byte pool. */ - + /* Release the memory again. */ status = tx_byte_release(pointer); @@ -220,11 +220,11 @@ CHAR *pointer; printf("ERROR #9\n"); test_control_return(1); } - + /* Now relinquish to get the other threads to run once. */ tx_thread_relinquish(); tx_thread_relinquish(); - + /* At this point both threads 1 and 2 are suspended on the byte pool again. */ if ((thread_1_counter != 3) && (thread_2_counter != 1)) { @@ -233,7 +233,7 @@ CHAR *pointer; printf("ERROR #10\n"); test_control_return(1); } - + /* Now allocate the memory again. Only one block of this size will fit. */ status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 60, TX_NO_WAIT); @@ -245,25 +245,25 @@ CHAR *pointer; printf("ERROR #10a\n"); test_control_return(1); } - + /* Resume thread 3 to get it suspended on the the pool. */ tx_thread_resume(&thread_3); #ifdef TX_MANUAL_TEST /* Set BP hear. Now release the memory and step into the code. After byte search issue IRQ2 mannually, which will - make thread 3 abort the first request and make another request of a different size. This is the path we are trying + make thread 3 abort the first request and make another request of a different size. This is the path we are trying to generate in the test. */ status = tx_byte_release(pointer); #else - /* Set the flag that will make thread 3 abort the first request and make another request of a different size. This tests the memory size change path + /* Set the flag that will make thread 3 abort the first request and make another request of a different size. This tests the memory size change path in the byte release loop logic. */ threadx_byte_release_loop_test = 1; status = tx_byte_release(pointer); #endif - + /* Check status. */ if (status != TX_SUCCESS) { @@ -273,7 +273,7 @@ CHAR *pointer; test_control_return(1); } else - { + { /* Successful test. */ printf("SUCCESS!\n"); @@ -307,7 +307,7 @@ CHAR *pointer; /* Check for status. */ if (status != TX_SUCCESS) return; - + /* Let thread 0 run again. */ tx_thread_relinquish(); } @@ -339,7 +339,7 @@ CHAR *pointer; /* Check for status. */ if (status != TX_SUCCESS) return; - + /* Let thread 0 run again. */ tx_thread_relinquish(); } @@ -370,7 +370,7 @@ CHAR *pointer; threadx_byte_allocate_loop_test = 1; status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 90, TX_WAIT_FOREVER); #endif - + /* Check for status. */ if (status != TX_SUCCESS) return; @@ -384,7 +384,7 @@ CHAR *pointer; /* Check for status. */ if (status != TX_SUCCESS) return; - + /* suspend this thread. */ tx_thread_suspend(&thread_3); } |
