Updated copyright headers and version number constants (#509)

* Updated version number constants

* Removed revision history from all files

* Added Eclipse ThreadX contributors' copyright header
This commit is contained in:
Frédéric Desbiens
2026-03-05 10:46:30 +01:00
committed by GitHub
parent 385d39f421
commit c3259a2160
5970 changed files with 90237 additions and 124072 deletions
+8 -8
View File
@@ -12,19 +12,19 @@ These are batch scripts and auxiliary files (expected test results, etc).
* Test_FVP: test the example using the ARM FVP platform.
## azrtos_cicd.old.bat
This is the main entry point for operations to be performed on several examples at the same time.
This script can be called from any location, it will automatically perform the requested operations on the examples of the repository where it is located.
This file outputs a summary to the screen and a detailed log file with all the output called azrtos_do.all.log
Call this scripts without parameters to get usage information.
The script parameters are case insensitive.
This is the main entry point for operations to be performed on several examples at the same time.
This script can be called from any location, it will automatically perform the requested operations on the examples of the repository where it is located.
This file outputs a summary to the screen and a detailed log file with all the output called azrtos_do.all.log
Call this scripts without parameters to get usage information.
The script parameters are case insensitive.
## Examples:
`azrtos_cicd.old.bat build tx ghs iar`
`azrtos_cicd.old.bat build tx ghs iar`
This will build all GHS and IAR example projects.
`azrtos_cicd.old.bat clean tx all`
`azrtos_cicd.old.bat clean tx all`
This cleans all ThreadX examples
`azrtos_cicd.old.bat build txm iar`
`azrtos_cicd.old.bat build txm iar`
This builds all ThreadX Modules IAR examples.
+8 -8
View File
@@ -219,7 +219,7 @@ ForEach ($f in $CsvFile) {
If (-not ($i.Name -match $m)) {
Write-Verbose ("Name mismatch: " + $m)
$match = $false;
}
}
}
}
@@ -229,11 +229,11 @@ ForEach ($f in $CsvFile) {
Write-Verbose ("Matching " + $m)
If (-not ($i.Keywords -match $m)) {
Write-Verbose ("Keywords mismatch: " + $m)
$match = $false
}
$match = $false
}
}
}
If ($MatchPath.Count -ne 0) {
Write-Verbose ("Matching path...")
ForEach ($m in $MatchPath) {
@@ -241,7 +241,7 @@ ForEach ($f in $CsvFile) {
If (-not ($i.Path -match $m)) {
Write-Verbose ("Path mismatch: " + $m)
$match = $false
}
}
}
}
@@ -281,7 +281,7 @@ ForEach ($f in $CsvFile) {
}
If ($Clean -and ($i.CleanScript -ne "")) {
Write-Progress -Activity $f -Status ($Stats.CurrentCsv.ToString() + "/" + $t.Count.ToString()) -CurrentOperation $i.Name -PercentComplete (1.0 * $Stats.CurrentCsv / $t.Count * 100)
Write-Progress -Activity $f -Status ($Stats.CurrentCsv.ToString() + "/" + $t.Count.ToString()) -CurrentOperation $i.Name -PercentComplete (1.0 * $Stats.CurrentCsv / $t.Count * 100)
$result = Invoke-CustomScript "Clean" $i.Name (Join-Path $ScriptDir $i.CleanEnvScript) (Join-Path $ScriptDir $i.CleanScript)
if ($result -ne 0) {
$Stats.CleanScriptERROR++
@@ -291,7 +291,7 @@ ForEach ($f in $CsvFile) {
}
If ($Build -and ($i.BuildScript -ne "")) {
Write-Progress -Activity $f -Status ($Stats.CurrentCsv.ToString() + "/" + $t.Count.ToString()) -CurrentOperation $i.Name -PercentComplete (1.0 * $Stats.CurrentCsv / $t.Count * 100)
Write-Progress -Activity $f -Status ($Stats.CurrentCsv.ToString() + "/" + $t.Count.ToString()) -CurrentOperation $i.Name -PercentComplete (1.0 * $Stats.CurrentCsv / $t.Count * 100)
$result = Invoke-CustomScript "Build" $i.Name (Join-Path $ScriptDir $i.BuildEnvScript) (Join-Path $ScriptDir $i.BuildScript)
if ($result -ne 0) {
$Stats.BuildScriptERROR++
@@ -301,7 +301,7 @@ ForEach ($f in $CsvFile) {
}
If ($Test -and ($i.TestScript -ne "")) {
Write-Progress -Activity $f -Status ($Stats.CurrentCsv.ToString() + "/" + $t.Count.ToString()) -CurrentOperation $i.Name -PercentComplete (1.0 * $Stats.CurrentCsv / $t.Count * 100)
Write-Progress -Activity $f -Status ($Stats.CurrentCsv.ToString() + "/" + $t.Count.ToString()) -CurrentOperation $i.Name -PercentComplete (1.0 * $Stats.CurrentCsv / $t.Count * 100)
$result = Invoke-CustomScript "Test" $i.Name (Join-Path $ScriptDir $i.TestEnvScript) (Join-Path $ScriptDir $i.TestScript)
if ($result -ne 0) {
$Stats.TestScriptERROR++
@@ -27,4 +27,4 @@ thread_4_counter = 0x0000000d
thread_5_counter = 0x00000005
thread_6_counter = 0x0000000d
thread_7_counter = 0x0000000d
MULTI>
MULTI>
+4 -4
View File
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
# Set up the project
project(threadx_smp
VERSION 6.0.0
VERSION 6.0.0
LANGUAGES C ASM
)
@@ -37,10 +37,10 @@ if (NOT TX_USER_FILE)
set(TX_USER_FILE ${PROJECT_DIR}/common_smp/inc/tx_user_sample.h)
else()
message(STATUS "Using custom tx_user.h file from ${TX_USER_FILE}")
endif()
endif()
configure_file(${TX_USER_FILE} ${CUSTOM_INC_DIR}/tx_user.h COPYONLY)
target_include_directories(${PROJECT_NAME}
PUBLIC
target_include_directories(${PROJECT_NAME}
PUBLIC
${CUSTOM_INC_DIR}
)
target_compile_definitions(${PROJECT_NAME} PUBLIC "TX_INCLUDE_USER_DEFINE_FILE" )
@@ -213,8 +213,8 @@ target_sources(${PROJECT_NAME}
)
# Add the Common/inc directory to the project include list
target_include_directories(${PROJECT_NAME}
PUBLIC
target_include_directories(${PROJECT_NAME}
PUBLIC
${CURRENT_DIR}/inc
)
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
/* This test is designed to test simple memory block pool creation, deletion, and
/* This test is designed to test simple memory block pool creation, deletion, and
allocates and releases. */
#include <stdio.h>
@@ -79,7 +79,7 @@ CHAR *pointer;
/* Determine if calling block pool create from initialization was successful. */
if (test_block_pool_create_init != TX_SUCCESS)
{
/* Error! */
error++;
}
@@ -87,7 +87,7 @@ CHAR *pointer;
/* Attempt to create a block pool from a timer. */
pointer = (CHAR *) 0x30000;
status = tx_block_pool_create(&pool_3, "pool 3", 100, pointer, 320);
/* Check status. */
if (status != TX_CALLER_ERROR)
{
@@ -98,7 +98,7 @@ CHAR *pointer;
/* Attempt to delete a block pool. */
status = tx_block_pool_delete(&pool_0);
/* Check status. */
if (status != TX_CALLER_ERROR)
{
@@ -106,7 +106,7 @@ CHAR *pointer;
/* Error! */
error++;
}
timer_executed = 1;
/* Attempt to allocate a block with suspension from a timer. */
@@ -190,8 +190,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;
@@ -203,8 +203,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,
18, 18, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -278,7 +278,7 @@ unsigned long fake_block[20];
block_memory.second_middle= 0x61718191;
block_memory.next_to_last = 0x99aabbcc;
block_memory.last = 0xddeeff00;
/* Create the block pool. */
status = tx_block_pool_create(&block_memory.pool, "pool memory", 16, &block_memory.pool_area[0], (2048*sizeof(ULONG))/sizeof(ULONG));
tx_block_pool_delete(&block_memory.pool);
@@ -304,7 +304,7 @@ unsigned long fake_block[20];
fake_block[0] = 0;
fake_block[1] = 0;
status = tx_block_release(&fake_block[2]);
/* Check status. */
if (status != TX_PTR_ERROR)
{
@@ -318,7 +318,7 @@ unsigned long fake_block[20];
fake_block[0] = 0;
fake_block[1] = (unsigned long) &fake_block[0];
status = tx_block_release(&fake_block[2]);
/* Check status. */
if (status != TX_PTR_ERROR)
{
@@ -328,7 +328,7 @@ unsigned long fake_block[20];
test_control_return(1);
}
#endif
/* Allocate first block from the pool. */
status = tx_block_allocate(&pool_0, (VOID **) &pointer_1, TX_NO_WAIT);
@@ -504,10 +504,10 @@ unsigned long fake_block[20];
/* Sleep for a bit... */
tx_thread_sleep(3);
/* Now resume the background thread. */
tx_thread_resume(&thread_1);
/* Sleep for a bit... */
tx_thread_sleep(3);
@@ -517,7 +517,7 @@ unsigned long fake_block[20];
/* Test for error. */
if ((error) || (timer_executed != 1) || (isr_executed != 1))
{
/* Block memory error. */
printf("ERROR #20\n");
test_control_return(1);
@@ -549,7 +549,7 @@ unsigned long fake_block[20];
}
else
{
/* Successful test. */
printf("SUCCESS!\n");
test_control_return(0);
@@ -562,7 +562,7 @@ static void thread_1_entry(ULONG thread_input)
while(1)
{
tx_thread_relinquish();
tx_thread_relinquish();
}
}
@@ -1,5 +1,5 @@
/* This test is designed to test error detection for simple memory block operations. */
#include <stdio.h>
#include "tx_api.h"
@@ -43,8 +43,8 @@ INT status;
/* 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;
@@ -160,7 +160,7 @@ INT i;
printf("ERROR #8\n");
test_control_return(1);
}
/* Allocate with bad pool pointer. */
pool_2.tx_block_pool_id = 0;
status = tx_block_allocate(&pool_2, (VOID **) TX_NULL, TX_NO_WAIT);
@@ -379,7 +379,7 @@ INT i;
thread_0_counter++;
#endif /* TX_DISABLE_ERROR_CHECKING */
/* All is good! */
printf("SUCCESS!\n");
test_control_return(0);
@@ -39,7 +39,7 @@ static TX_THREAD thread_6;
static TX_BLOCK_POOL block_pool_0;
static TX_BLOCK_POOL block_pool_2;
#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
static TX_BLOCK_POOL block_pool_1;
#endif
@@ -57,8 +57,8 @@ static void thread_5_entry(ULONG thread_input);
static void thread_6_entry(ULONG thread_input);
/* Direct core function to bypass the error checking shell. */
UINT _tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks,
ULONG *total_blocks, TX_THREAD **first_suspended,
UINT _tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks,
ULONG *total_blocks, TX_THREAD **first_suspended,
ULONG *suspended_count, TX_BLOCK_POOL **next_pool);
/* Prototype for test control return. */
@@ -78,7 +78,7 @@ static void test_isr(void)
tx_thread_wait_abort(&thread_3);
/* End the ISR processing. */
test_status = 2;
test_status = 2;
test_isr_dispatch = TX_NULL;
}
}
@@ -103,8 +103,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;
@@ -116,8 +116,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,
16, 16, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -129,8 +129,8 @@ 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,
15, 15, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -142,8 +142,8 @@ CHAR *pointer;
test_control_return(1);
}
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,
3, 3, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -155,8 +155,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
4, 4, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -168,8 +168,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
5, 5, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -181,8 +181,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
6, 6, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -197,7 +197,7 @@ CHAR *pointer;
/* Create the block_pool with one block. */
status = tx_block_pool_create(&block_pool_0, "block_pool 0", 30, pointer, 40);
pointer = pointer + 40;
/* Check for status. */
if (status != TX_SUCCESS)
{
@@ -282,7 +282,7 @@ ULONG timeouts;
tx_thread_resume(&thread_4);
tx_thread_resume(&thread_5);
tx_thread_resume(&thread_6);
/* Prioritize the block pool suspension list. */
status = tx_block_pool_prioritize(&block_pool_0);
@@ -294,10 +294,10 @@ ULONG timeouts;
printf("ERROR #12\n");
test_control_return(1);
}
/* Now loop to test the interrupt of the prioritize loop logic. */
test_status = 1;
test_isr_dispatch = test_isr;
test_isr_dispatch = test_isr;
do
{
@@ -314,10 +314,10 @@ ULONG timeouts;
}
} while (test_status == 1);
/* Now determine if thread 4 is at the front of the list... It should be! */
if (block_pool_0.tx_block_pool_suspension_list != &thread_4)
{
{
/* Block Pool error. */
printf("ERROR #14\n");
@@ -352,13 +352,13 @@ ULONG timeouts;
}
#endif
/* Now use the information services in order to test them. */
status = tx_block_pool_info_get(&block_pool_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL);
status += tx_block_pool_info_get(&block_pool_0, &name, &available, &total_blocks, &first_suspended, &suspended_count, &next_pool);
/* Check for an error condition. */
if ((status) || (available != block_pool_0.tx_block_pool_available) || (total_blocks != block_pool_0.tx_block_pool_total) ||
if ((status) || (available != block_pool_0.tx_block_pool_available) || (total_blocks != block_pool_0.tx_block_pool_total) ||
(first_suspended != &thread_4) || (suspended_count != block_pool_0.tx_block_pool_suspended_count) || (next_pool != &block_pool_0))
{
@@ -367,11 +367,11 @@ ULONG timeouts;
test_control_return(1);
}
#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
/* Call the core block pool info get function with a NULL pointer. */
status = _tx_block_pool_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL);
/* Check for the proper error code. */
if (status != TX_PTR_ERROR)
{
@@ -383,7 +383,7 @@ ULONG timeouts;
/* Call the core block pool info get function with a non-initialized pool. */
status = _tx_block_pool_performance_info_get(&block_pool_1, TX_NULL, TX_NULL, TX_NULL, TX_NULL);
/* Check for the proper error code. */
if (status != TX_PTR_ERROR)
{
@@ -396,11 +396,11 @@ ULONG timeouts;
/* Now get the pool performance information. */
status = tx_block_pool_performance_info_get(&block_pool_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL);
status += tx_block_pool_performance_info_get(&block_pool_0, &allocates, &releases, &suspensions, &timeouts);
/* Check for an error condition. */
if ((status) || (allocates != block_pool_0.tx_block_pool_performance_allocate_count) ||
(releases != block_pool_0.tx_block_pool_performance_release_count) ||
(suspensions != block_pool_0.tx_block_pool_performance_suspension_count) ||
if ((status) || (allocates != block_pool_0.tx_block_pool_performance_allocate_count) ||
(releases != block_pool_0.tx_block_pool_performance_release_count) ||
(suspensions != block_pool_0.tx_block_pool_performance_suspension_count) ||
(timeouts != block_pool_0.tx_block_pool_performance_timeout_count))
{
@@ -412,9 +412,9 @@ ULONG timeouts;
/* Now get the system pool performance information. */
status = tx_block_pool_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL);
status += tx_block_pool_performance_system_info_get(&allocates, &releases, &suspensions, &timeouts);
/* Check for an error condition. */
if ((status) || (allocates != _tx_block_pool_performance_allocate_count) || (releases != _tx_block_pool_performance_release_count) ||
if ((status) || (allocates != _tx_block_pool_performance_allocate_count) || (releases != _tx_block_pool_performance_release_count) ||
(suspensions != _tx_block_pool_performance_suspension_count) || (timeouts != _tx_block_pool_performance_timeout_count))
{
@@ -433,7 +433,7 @@ ULONG timeouts;
/* Call the block pool performance info get function. */
status = tx_block_pool_performance_info_get(&block_pool_0, &allocates, &releases, &suspensions, &timeouts);
/* Check for the proper error code. */
if (status != TX_FEATURE_NOT_ENABLED)
{
@@ -445,7 +445,7 @@ ULONG timeouts;
/* Call the block pool performance info get function. */
status = tx_block_pool_performance_info_get(TX_NULL, &allocates, &releases, &suspensions, &timeouts);
/* Check for the proper error code. */
if (status != TX_FEATURE_NOT_ENABLED)
{
@@ -457,7 +457,7 @@ ULONG timeouts;
/* Call the block pool performance info get function. */
status = tx_block_pool_performance_info_get(TX_NULL, TX_NULL, &releases, &suspensions, &timeouts);
/* Check for the proper error code. */
if (status != TX_FEATURE_NOT_ENABLED)
{
@@ -469,7 +469,7 @@ ULONG timeouts;
/* Call the block pool performance info get function. */
status = tx_block_pool_performance_info_get(TX_NULL, TX_NULL, TX_NULL, &suspensions, &timeouts);
/* Check for the proper error code. */
if (status != TX_FEATURE_NOT_ENABLED)
{
@@ -481,7 +481,7 @@ ULONG timeouts;
/* Call the block pool performance info get function. */
status = tx_block_pool_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &timeouts);
/* Check for the proper error code. */
if (status != TX_FEATURE_NOT_ENABLED)
{
@@ -493,7 +493,7 @@ ULONG timeouts;
/* Call the block pool performance info get function. */
status = tx_block_pool_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL);
/* Check for the proper error code. */
if (status != TX_FEATURE_NOT_ENABLED)
{
@@ -76,12 +76,12 @@ static void test_isr(void)
}
else
{
/* Abort the wait of thread 5. */
tx_thread_wait_abort(&thread_5);
/* End the ISR processing. */
test_status = 2;
test_status = 2;
test_isr_dispatch = TX_NULL;
}
}
@@ -107,8 +107,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;
@@ -120,8 +120,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,
16, 16, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -133,8 +133,8 @@ 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,
15, 15, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -146,8 +146,8 @@ CHAR *pointer;
test_control_return(1);
}
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,
3, 3, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -159,8 +159,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
4, 4, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -172,8 +172,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
5, 5, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -185,8 +185,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
6, 6, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -201,7 +201,7 @@ CHAR *pointer;
/* Create the block_pool with one block. */
status = tx_block_pool_create(&block_pool_0, "block_pool 0", 30, pointer, 40);
pointer = pointer + 40;
/* Check for status. */
if (status != TX_SUCCESS)
{
@@ -229,7 +229,7 @@ VOID *pointer;
/* Attempt to prioritize with a NULL pointer. */
status = tx_block_pool_prioritize(TX_NULL);
/* Check for an error condition. */
if (status != TX_POOL_ERROR)
{
@@ -242,7 +242,7 @@ VOID *pointer;
/* Attempt to prioritize with a bad pool pointer. */
block_pool_1.tx_block_pool_id = 0;
status = tx_block_pool_prioritize(&block_pool_1);
/* Check for an error condition. */
if (status != TX_POOL_ERROR)
{
@@ -296,7 +296,7 @@ VOID *pointer;
printf("ERROR #13\n");
test_control_return(1);
}
/* Call block pool prioritize again to test the don't-do-anything path in tx_block_pool_prioritize. */
status += tx_block_pool_prioritize(&block_pool_0);
@@ -307,7 +307,7 @@ VOID *pointer;
tx_thread_resume(&thread_4);
tx_thread_resume(&thread_5);
tx_thread_resume(&thread_6);
/* Prioritize the block pool suspension list. */
status = tx_block_pool_prioritize(&block_pool_0);
@@ -319,10 +319,10 @@ VOID *pointer;
printf("ERROR #14\n");
test_control_return(1);
}
/* Now loop to test the interrupt of the prioritize loop logic. */
test_status = 1;
test_isr_dispatch = test_isr;
test_isr_dispatch = test_isr;
do
{
@@ -339,10 +339,10 @@ VOID *pointer;
}
} while (test_status == 1);
/* Now determine if thread 4 is at the front of the list... It should be! */
if (block_pool_0.tx_block_pool_suspension_list != &thread_4)
{
{
/* Block Pool error. */
printf("ERROR #16\n");
@@ -43,8 +43,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;
@@ -56,8 +56,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;
@@ -69,8 +69,8 @@ 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;
@@ -186,7 +186,7 @@ CHAR *pointer_3;
}
/* At this point the other thread has run and there is one block free. */
/* Get the last block again. */
status = tx_block_allocate(&pool_0, (VOID **) &pointer_3, TX_NO_WAIT);
@@ -201,13 +201,13 @@ CHAR *pointer_3;
/* Set all the memory of the blocks. */
TX_MEMSET(pointer_3, (CHAR) 0xEF, 100);
/* Resume the second thread. */
tx_thread_resume(&thread_2);
/* Let both threads suspend on the block pool via relinquish. */
tx_thread_relinquish();
/* Now release the block. */
status = tx_block_release(pointer_3);
@@ -219,13 +219,13 @@ CHAR *pointer_3;
printf("ERROR #10\n");
test_control_return(1);
}
/* Let thread 1 release the block. */
tx_thread_relinquish();
/* Let thread 2 get the block and release the block. */
tx_thread_relinquish();
/* Check status and run counter. */
if ((thread_1_counter != 3) || (thread_2_counter != 1))
{
@@ -44,8 +44,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;
@@ -57,8 +57,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;
@@ -70,8 +70,8 @@ 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_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -116,7 +116,7 @@ CHAR *pointer_3;
status = tx_block_allocate(&pool_0, (VOID **) &pointer_1, TX_NO_WAIT);
status += tx_block_allocate(&pool_0, (VOID **) &pointer_2, TX_NO_WAIT);
status += tx_block_allocate(&pool_0, (VOID **) &pointer_3, TX_NO_WAIT);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -152,7 +152,7 @@ CHAR *pointer_3;
}
else
{
/* Successful test. */
printf("SUCCESS!\n");
test_control_return(0);
@@ -42,8 +42,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;
@@ -55,8 +55,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;
@@ -101,7 +101,7 @@ CHAR *pointer_3;
status = tx_block_allocate(&pool_0, (VOID **) &pointer_1, TX_NO_WAIT);
status += tx_block_allocate(&pool_0, (VOID **) &pointer_2, TX_NO_WAIT);
status += tx_block_allocate(&pool_0, (VOID **) &pointer_3, TX_NO_WAIT);
/* Increment the run counter. */
thread_0_counter++;
@@ -118,7 +118,7 @@ CHAR *pointer_3;
TX_MEMSET(pointer_1, (CHAR) 0xEF, 100);
TX_MEMSET(pointer_2, (CHAR) 0xEF, 100);
TX_MEMSET(pointer_3, (CHAR) 0xEF, 100);
/* Let other thread suspend on block pool. */
tx_thread_relinquish();
@@ -1,4 +1,4 @@
/* This test is designed to test simple memory byte pool creation, deletion, and
/* This test is designed to test simple memory byte pool creation, deletion, and
allocates and releases. */
#include <stdio.h>
@@ -84,7 +84,7 @@ CHAR *pointer;
/* Determine if calling byte pool create from initialization was successful. */
if (test_byte_pool_create_init != TX_SUCCESS)
{
/* Error! */
error++;
}
@@ -92,7 +92,7 @@ CHAR *pointer;
/* Attempt to create a byte pool from a timer. */
pointer = (CHAR *) 0x30000;
status = tx_byte_pool_create(&pool_2, "pool 2", pointer, 108);
/* Check status. */
if (status != TX_CALLER_ERROR)
{
@@ -138,14 +138,14 @@ CHAR *pointer;
/* Attempt to release byte memory from timer. */
pointer = (CHAR *) 0x30000;
status = tx_byte_release(pointer);
/* Check for error status! */
if (status != TX_CALLER_ERROR)
{
/* Error! */
error++;
}
}
timer_executed = 1;
#endif
@@ -209,14 +209,14 @@ UINT status;
/* Attempt to release byte memory from ISR. */
pointer = (CHAR *) 0x30000;
status = tx_byte_release(pointer);
/* Check for error status! */
if (status != TX_CALLER_ERROR)
{
/* Error! */
error++;
}
}
isr_executed = 1;
#endif
@@ -235,15 +235,15 @@ void threadx_byte_memory_basic_application_define(void *first_unused_memory)
UINT status;
CHAR *pointer;
/* Put first available memory address into a character pointer. */
pointer = (CHAR *) first_unused_memory;
/* 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;
@@ -290,44 +290,44 @@ CHAR *pointer;
printf("Running Byte Memory Basic Test...................................... ERROR #3a\n");
test_control_return(1);
}
/* Allocate first block. */
status += tx_byte_allocate(&pool_4, (VOID **) &block_0, 80, TX_NO_WAIT);
/* Save next search pointer. */
search_ptr_1 = pool_4.tx_byte_pool_search;
/* Clear the allocatged memory. */
TX_MEMSET(block_0, 0, 80);
/* Allocate another block. */
status += tx_byte_allocate(&pool_4, (VOID **) &block_1, 80, TX_NO_WAIT);
/* Clear the allocated block. */
TX_MEMSET(block_1, 0, 80);
/* Allocate the third and final block. */
status += tx_byte_allocate(&pool_4, (VOID **) &block_2, 80, TX_NO_WAIT);
/* Clear the allocated block. */
TX_MEMSET(block_2, 0, 80);
/* Release the first block. */
status += tx_byte_release(block_0);
/* Release the second block. */
status += tx_byte_release(block_1);
/* Manually move the search pointer to create the case where the search wraps and a merge happens on the search pointer
necessitating its update. */
pool_4.tx_byte_pool_search = search_ptr_1; /* Point to the middle block. */
/* Allocate a larger block that will wrap the search and require moving as well as an update of the search pointer. */
status += tx_byte_allocate(&pool_4, (VOID **) &block_3, 120, TX_NO_WAIT);
/* Clear the newly allocated block. */
/* Clear the newly allocated block. */
TX_MEMSET(block_3, 0, 120);
/* At this point, verify the search pointer was properly updated in the previous allocation. */
status += tx_byte_allocate(&pool_4, (VOID **) &block_4, 40, TX_NO_WAIT); /* Should fail since search pointer is now invalid! */
@@ -367,7 +367,7 @@ UCHAR *save_search;
byte_memory.second_middle= 0x61718191;
byte_memory.next_to_last = 0x99aabbcc;
byte_memory.last = 0xddeeff00;
/* Create the byte pool. */
status = tx_byte_pool_create(&byte_memory.pool, "pool memory", &byte_memory.pool_area[0], (2048*sizeof(ULONG))/sizeof(ULONG));
tx_byte_pool_delete(&byte_memory.pool);
@@ -477,7 +477,7 @@ UCHAR *save_search;
printf("ERROR #11\n");
test_control_return(1);
}
/* Test non-created pool pointer. */
pool_2.tx_byte_pool_id = 0;
status = tx_byte_allocate(&pool_2, (VOID **) &pointer_1, 24, TX_NO_WAIT);
@@ -530,15 +530,15 @@ UCHAR *save_search;
/* Test NULL pointer release. */
status = tx_byte_release(TX_NULL);
/* Check for error status! */
if (status != TX_PTR_ERROR)
{
/* Byte memory error. */
printf("ERROR #16\n");
test_control_return(1);
}
}
/* Allocate memory from the pool. */
status = tx_byte_allocate(&pool_0, (VOID **) &pointer_1, 24, TX_NO_WAIT);
@@ -599,30 +599,30 @@ UCHAR *save_search;
/* Test the byte release with a bad block pointer. */
status = _tx_byte_release(TX_NULL);
/* Check for error status! */
if (status != TX_PTR_ERROR)
{
/* Byte memory error. */
printf("ERROR #21\n");
test_control_return(1);
}
}
/* Test another bad block release... no pool pointer! */
array[0] = 0;
array[1] = 0;
array[2] = 0;
status = _tx_byte_release(&array[2]);
/* Check for error status! */
if (status != TX_PTR_ERROR)
{
/* Byte memory error. */
printf("ERROR #22\n");
test_control_return(1);
}
}
/* Test another bad block release.... pool pointer is not a valid pool! */
array[0] = 0;
@@ -630,16 +630,16 @@ UCHAR *save_search;
array[2] = 0;
array[3] = 0;
status = _tx_byte_release(&array[2]);
/* Check for error status! */
if (status != TX_PTR_ERROR)
{
/* Byte memory error. */
printf("ERROR #22\n");
test_control_return(1);
}
}
/* Now release each of the blocks. */
status = tx_byte_release(pointer_1);
@@ -776,7 +776,7 @@ UCHAR *save_search;
test_control_return(1);
}
/* Now allocate a block that should cause all of the blocks to merge
/* Now allocate a block that should cause all of the blocks to merge
together. */
status = tx_byte_allocate(&pool_0, (VOID **) &pointer_3, 88, TX_NO_WAIT);
@@ -813,9 +813,9 @@ UCHAR *save_search;
printf("ERROR #36\n");
test_control_return(1);
}
/* Now ensure the search pointer update in the byte search algorithm is updated. */
/* Allocate memory from the pool. */
status = tx_byte_allocate(&pool_0, (VOID **) &pointer_1, 24, TX_NO_WAIT);
@@ -851,10 +851,10 @@ UCHAR *save_search;
printf("ERROR #39\n");
test_control_return(1);
}
/* Release the middle block. */
status = tx_byte_release(pointer_2);
status = tx_byte_release(pointer_2);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -883,7 +883,7 @@ UCHAR *save_search;
status = tx_byte_release(pointer_3);
status += tx_byte_release(pointer_2);
status += tx_byte_release(pointer_1);
/* Move the search pointer to the third block to exercise that code in the byte search algorithm. */
pool_0.tx_byte_pool_search = (UCHAR *) pointer_3-8;
@@ -898,8 +898,8 @@ UCHAR *save_search;
printf("ERROR #42\n");
test_control_return(1);
}
#ifndef TX_DISABLE_ERROR_CHECKING
/* Create a timer for the test. */
@@ -917,14 +917,14 @@ UCHAR *save_search;
/* Test for error. */
if ((error) || (timer_executed != 1) || (isr_executed != 1))
{
/* Byte memory error. */
printf("ERROR #43\n");
test_control_return(1);
}
#endif
/* Delete both byte pools. */
status = tx_byte_pool_delete(&pool_0);
@@ -950,7 +950,7 @@ UCHAR *save_search;
/* Delete pool 4. */
status = tx_byte_pool_delete(&pool_4);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -959,10 +959,10 @@ UCHAR *save_search;
printf("ERROR #46\n");
test_control_return(1);
}
/* Create pool 4. */
status = tx_byte_pool_create(&pool_4, "pool 4", pool_4_memory, 300);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -985,15 +985,15 @@ UCHAR *save_search;
printf("ERROR #48\n");
test_control_return(1);
}
/* At this point, there should be three allocated blocks and the reserved block at the end. */
/* Now release all the blocks in reverse order. This should leave the search pointer at the last block. */
status = tx_byte_release(pointer_3);
save_search = pool_4.tx_byte_pool_search;
status += tx_byte_release(pointer_2);
status += tx_byte_release(pointer_1);
/* Move the search pointer back to the last block. */
pool_4.tx_byte_pool_search = save_search;
@@ -1004,12 +1004,12 @@ UCHAR *save_search;
/* Byte memory error. */
printf("ERROR #49\n");
test_control_return(1);
}
}
/* Now attempt to allocate a block that requires a merge, which should exercise the branch in byte search that does not
/* Now attempt to allocate a block that requires a merge, which should exercise the branch in byte search that does not
result in a search pointer change. */
status = tx_byte_allocate(&pool_4, (VOID **) &pointer_1, 168, TX_NO_WAIT);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -1017,21 +1017,21 @@ UCHAR *save_search;
/* Byte memory error. */
printf("ERROR #50\n");
test_control_return(1);
}
}
/* Release the last block. */
status = tx_byte_release(pointer_1);
/* Allocate all the blocks. */
status = tx_byte_allocate(&pool_4, (VOID **) &pointer_1, 84, TX_NO_WAIT);
status += tx_byte_allocate(&pool_4, (VOID **) &pointer_2, 84, TX_NO_WAIT);
status += tx_byte_allocate(&pool_4, (VOID **) &pointer_3, 84, TX_NO_WAIT);
/* Release all of the blocks in order. */
status += tx_byte_release(pointer_1);
status += tx_byte_release(pointer_2);
status += tx_byte_release(pointer_3);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -1039,7 +1039,7 @@ UCHAR *save_search;
/* Byte memory error. */
printf("ERROR #50\n");
test_control_return(1);
}
}
/* Now setup a special test to exercise the examine blocks equal to 0 path in the byte pool search. */
pool_4.tx_byte_pool_search = save_search;
@@ -1047,7 +1047,7 @@ UCHAR *save_search;
/* Call byte allocate to execise the examine blocks equal to 0 path on non-merge block condition. */
status = tx_byte_allocate(&pool_4, (VOID **) &pointer_1, 168, TX_NO_WAIT);
/* Check status. */
if (status != TX_NO_MEMORY)
{
@@ -1055,8 +1055,8 @@ UCHAR *save_search;
/* Byte memory error. */
printf("ERROR #51\n");
test_control_return(1);
}
}
/* Successful test. */
printf("SUCCESS!\n");
test_control_return(0);
@@ -76,7 +76,7 @@ static void test_isr(void)
tx_thread_wait_abort(&thread_3);
/* End the ISR processing. */
test_status = 2;
test_status = 2;
test_isr_dispatch = TX_NULL;
}
}
@@ -101,8 +101,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;
@@ -114,8 +114,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,
16, 16, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -127,8 +127,8 @@ 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,
15, 15, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -140,8 +140,8 @@ CHAR *pointer;
test_control_return(1);
}
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,
3, 3, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -153,8 +153,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
4, 4, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -166,8 +166,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
5, 5, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -179,8 +179,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
6, 6, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -195,7 +195,7 @@ CHAR *pointer;
/* Create the byte_pool with one byte. */
status = tx_byte_pool_create(&byte_pool_0, "byte_pool 0", pointer, 100);
pointer = pointer + 100;
/* Check for status. */
if (status != TX_SUCCESS)
{
@@ -274,7 +274,7 @@ ULONG timeouts;
printf("ERROR #11\n");
test_control_return(1);
}
/* At this point we are going to get more than 2 threads suspended. */
tx_thread_resume(&thread_1);
tx_thread_resume(&thread_2);
@@ -285,7 +285,7 @@ ULONG timeouts;
/* Prioritize the byte pool suspension list. */
status = tx_byte_pool_prioritize(&byte_pool_0);
/* Check status and make sure thread 3 is now at the front of the suspension list. */
if ((status != TX_SUCCESS) || (byte_pool_0.tx_byte_pool_suspension_list != &thread_3))
{
@@ -297,7 +297,7 @@ ULONG timeouts;
/* Now loop to test the interrupt of the prioritize loop logic. */
test_status = 1;
test_isr_dispatch = test_isr;
test_isr_dispatch = test_isr;
do
{
@@ -357,7 +357,7 @@ ULONG timeouts;
status += tx_byte_pool_info_get(&byte_pool_0, &name, &available, &fragments, &first_suspended, &suspended_count, &next_pool);
/* Check the status. */
if ((status != TX_SUCCESS) || (available != byte_pool_0.tx_byte_pool_available) || (fragments != byte_pool_0.tx_byte_pool_fragments) ||
if ((status != TX_SUCCESS) || (available != byte_pool_0.tx_byte_pool_available) || (fragments != byte_pool_0.tx_byte_pool_fragments) ||
(first_suspended != &thread_4) || (suspended_count != byte_pool_0.tx_byte_pool_suspended_count) || (next_pool != &byte_pool_0))
{
@@ -371,7 +371,7 @@ ULONG timeouts;
/* Get the byte pool performance information. */
status = tx_byte_pool_performance_info_get(TX_NULL, &allocates, &releases, &fragments_searched, &merges, &splits, &suspensions, &timeouts);
/* Check the status. */
if (status != TX_PTR_ERROR)
{
@@ -380,10 +380,10 @@ ULONG timeouts;
printf("ERROR #18\n");
test_control_return(1);
}
/* Get the byte pool performance information. */
status = tx_byte_pool_performance_info_get(&byte_pool_1, &allocates, &releases, &fragments_searched, &merges, &splits, &suspensions, &timeouts);
/* Check the status. */
if (status != TX_PTR_ERROR)
{
@@ -395,11 +395,11 @@ ULONG timeouts;
/* Get the byte pool performance information. */
status = tx_byte_pool_performance_info_get(&byte_pool_0, &allocates, &releases, &fragments_searched, &merges, &splits, &suspensions, &timeouts);
/* Check the status. */
if ((status != TX_SUCCESS) || (allocates != byte_pool_0.tx_byte_pool_performance_allocate_count) || (releases != byte_pool_0.tx_byte_pool_performance_release_count) ||
(fragments_searched != byte_pool_0.tx_byte_pool_performance_search_count) || (merges != byte_pool_0.tx_byte_pool_performance_merge_count) ||
(splits != byte_pool_0.tx_byte_pool_performance_split_count) || (suspensions != byte_pool_0.tx_byte_pool_performance_suspension_count) ||
if ((status != TX_SUCCESS) || (allocates != byte_pool_0.tx_byte_pool_performance_allocate_count) || (releases != byte_pool_0.tx_byte_pool_performance_release_count) ||
(fragments_searched != byte_pool_0.tx_byte_pool_performance_search_count) || (merges != byte_pool_0.tx_byte_pool_performance_merge_count) ||
(splits != byte_pool_0.tx_byte_pool_performance_split_count) || (suspensions != byte_pool_0.tx_byte_pool_performance_suspension_count) ||
(timeouts != byte_pool_0.tx_byte_pool_performance_timeout_count))
{
@@ -410,11 +410,11 @@ ULONG timeouts;
/* Get the byte pool system performance information. */
status = tx_byte_pool_performance_system_info_get(&allocates, &releases, &fragments_searched, &merges, &splits, &suspensions, &timeouts);
/* Check the status. */
if ((status != TX_SUCCESS) || (allocates != _tx_byte_pool_performance_allocate_count) || (releases != _tx_byte_pool_performance_release_count) ||
(fragments_searched != _tx_byte_pool_performance_search_count) || (merges != _tx_byte_pool_performance_merge_count) ||
(splits != _tx_byte_pool_performance_split_count) || (suspensions != _tx_byte_pool_performance_suspension_count) ||
if ((status != TX_SUCCESS) || (allocates != _tx_byte_pool_performance_allocate_count) || (releases != _tx_byte_pool_performance_release_count) ||
(fragments_searched != _tx_byte_pool_performance_search_count) || (merges != _tx_byte_pool_performance_merge_count) ||
(splits != _tx_byte_pool_performance_split_count) || (suspensions != _tx_byte_pool_performance_suspension_count) ||
(timeouts != _tx_byte_pool_performance_timeout_count))
{
@@ -74,12 +74,12 @@ static void test_isr(void)
}
else
{
/* Abort the wait of thread 5. */
tx_thread_wait_abort(&thread_5);
/* End the ISR processing. */
test_status = 2;
test_status = 2;
test_isr_dispatch = TX_NULL;
}
}
@@ -105,8 +105,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;
@@ -118,8 +118,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,
16, 16, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -131,8 +131,8 @@ 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,
15, 15, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -144,8 +144,8 @@ CHAR *pointer;
test_control_return(1);
}
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,
3, 3, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -157,8 +157,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
4, 4, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -170,8 +170,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
5, 5, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -183,8 +183,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
6, 6, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -199,7 +199,7 @@ CHAR *pointer;
/* Create the byte_pool with one byte. */
status = tx_byte_pool_create(&byte_pool_0, "byte_pool 0", pointer, 100);
pointer = pointer + 100;
/* Check for status. */
if (status != TX_SUCCESS)
{
@@ -296,7 +296,7 @@ VOID *pointer;
/* Call byte pool prioritize again to test the don't-do-anything path in tx_byte_pool_prioritize. */
status += tx_byte_pool_prioritize(&byte_pool_0);
/* At this point we are going to get more than 2 threads suspended. */
tx_thread_resume(&thread_1);
tx_thread_resume(&thread_2);
@@ -307,7 +307,7 @@ VOID *pointer;
/* Prioritize the byte pool suspension list. */
status = tx_byte_pool_prioritize(&byte_pool_0);
/* Check status and make sure thread 3 is now at the front of the suspension list. */
if ((status != TX_SUCCESS) || (byte_pool_0.tx_byte_pool_suspension_list != &thread_3))
{
@@ -319,7 +319,7 @@ VOID *pointer;
/* Now loop to test the interrupt of the prioritize loop logic. */
test_status = 1;
test_isr_dispatch = test_isr;
test_isr_dispatch = test_isr;
do
{
@@ -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);
}
@@ -44,8 +44,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;
@@ -57,8 +57,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;
@@ -71,8 +71,8 @@ CHAR *pointer;
}
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_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -110,7 +110,7 @@ CHAR *pointer;
/* Inform user. */
printf("Running Byte Memory Suspension Timeout Test......................... ");
/* Increment the thread counter. */
thread_0_counter++;
@@ -126,7 +126,7 @@ CHAR *pointer;
test_control_return(1);
}
/* Sleep to allow the other thread to suspend and timeout on the memory
/* Sleep to allow the other thread to suspend and timeout on the memory
pool once. */
tx_thread_sleep(64);
@@ -140,7 +140,7 @@ CHAR *pointer;
}
else
{
/* Successful test. */
printf("SUCCESS!\n");
test_control_return(0);
@@ -1,6 +1,6 @@
/* This test is designed to test contention of two threads on a single
memory byte pool. */
#include <stdio.h>
#include "tx_api.h"
@@ -49,8 +49,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, 1, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -62,8 +62,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, 1, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -75,8 +75,8 @@ 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, 1, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -91,7 +91,7 @@ CHAR *pointer;
/* Create byte pool 0. */
status = tx_byte_pool_create(&pool_0, "pool 0", pointer, 108);
pointer = pointer + 108;
/* Save off the intial pool size. */
initial_pool_size = pool_0.tx_byte_pool_available;
@@ -128,7 +128,7 @@ CHAR *pointer;
{
/* Allocate memory from the pool. This size will cause merge activity
because the search pointer will sit in this large block about half
because the search pointer will sit in this large block about half
the time. */
status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 60, TX_WAIT_FOREVER);
@@ -158,7 +158,7 @@ CHAR *pointer;
/* Check the time. */
if (tx_time_get() > 1280)
break;
break;
/* Increment the thread counter. */
thread_0_counter++;
@@ -166,7 +166,7 @@ CHAR *pointer;
/* Set the done flag. */
test_done = TX_TRUE;
/* Sleep to let the other threads finish up! */
tx_thread_sleep(2);
@@ -215,7 +215,7 @@ CHAR *pointer;
/* Check for status. */
if (status != TX_SUCCESS)
return;
/* Increment the thread counter. */
thread_1_counter++;
}
@@ -248,7 +248,7 @@ CHAR *pointer;
/* Check for status. */
if (status != TX_SUCCESS)
return;
/* Increment the thread counter. */
thread_2_counter++;
}
@@ -41,8 +41,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;
@@ -54,8 +54,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;
@@ -96,7 +96,7 @@ CHAR *pointer;
/* Increment the thread counter. */
thread_0_counter++;
/* Allocate memory from the pool. Only one block of this size will fit. */
status = tx_byte_allocate(&pool_0, (VOID **) &pointer, 60, TX_NO_WAIT);
@@ -114,7 +114,7 @@ CHAR *pointer;
/* Terminate the other thread. */
status = tx_thread_terminate(&thread_1);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -147,7 +147,7 @@ CHAR *pointer;
printf("ERROR #7\n");
test_control_return(1);
}
/* Successful test. */
printf("SUCCESS!\n");
test_control_return(0);
@@ -75,14 +75,14 @@ ULONG actual_events;
/* Determine if calling event flag create from initialization was successful. */
if (test_event_flags_from_init != TX_SUCCESS)
{
/* Error! */
error++;
}
/* Attempt to create an event flag group from a timer. */
status = tx_event_flags_create(&group_2, "group 2");
/* Check status. */
if (status != TX_CALLER_ERROR)
{
@@ -185,8 +185,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;
@@ -198,8 +198,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,
18, 18, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -213,7 +213,7 @@ CHAR *pointer;
/* Create event flag group 0 and 1. */
status = tx_event_flags_create(&group_0, "group 0");
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -231,7 +231,7 @@ CHAR *pointer;
printf("Running Event Flag Basic Test....................................... ERROR #4\n");
test_control_return(1);
}
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
@@ -278,7 +278,7 @@ CHAR *pointer;
test_control_return(1);
}
#endif
}
@@ -300,11 +300,11 @@ ULONG actual_events;
event_flag_memory.second = 0x55667788;
event_flag_memory.next_to_last = 0x99aabbcc;
event_flag_memory.last = 0xddeeff00;
/* Create the event flag group. */
status = tx_event_flags_create(&event_flag_memory.event_flags, "group memory");
tx_event_flags_delete(&event_flag_memory.event_flags);
/* Check for status. */
if ((status != TX_SUCCESS) ||
(event_flag_memory.first != 0x11223344) ||
@@ -312,7 +312,7 @@ ULONG actual_events;
(event_flag_memory.next_to_last != 0x99aabbcc) ||
(event_flag_memory.last != 0xddeeff00))
{
/* Event flag error. */
printf("ERROR #7\n");
test_control_return(1);
@@ -324,7 +324,7 @@ ULONG actual_events;
/* Try to create with a NULL pointer. */
status = tx_event_flags_create(TX_NULL, "group 0");
/* Check status. */
if (status != TX_GROUP_ERROR)
{
@@ -333,10 +333,10 @@ ULONG actual_events;
printf("ERROR #8\n");
test_control_return(1);
}
/* Try to create with a bad size. */
status = _txe_event_flags_create(&group_3, "group 3", (sizeof(TX_EVENT_FLAGS_GROUP)+1));
/* Check status. */
if (status != TX_GROUP_ERROR)
{
@@ -345,10 +345,10 @@ ULONG actual_events;
printf("ERROR #9\n");
test_control_return(1);
}
/* Try to create an already created group. */
status = tx_event_flags_create(&group_0, "group 0");
/* Check status. */
if (status != TX_GROUP_ERROR)
{
@@ -369,7 +369,7 @@ ULONG actual_events;
printf("ERROR #11\n");
test_control_return(1);
}
/* Delete with a non-created pointer. */
group_2.tx_event_flags_group_id = 0;
status = tx_event_flags_delete(&group_2);
@@ -518,7 +518,7 @@ ULONG actual_events;
printf("ERROR #23\n");
test_control_return(1);
}
/* Attempt to get events from an empty event flag group. AND CLEAR option. */
status = tx_event_flags_get(&group_0, 0x80008000, TX_AND_CLEAR, &actual_events, TX_NO_WAIT);
@@ -604,7 +604,7 @@ ULONG actual_events;
printf("ERROR #30\n");
test_control_return(1);
}
/* Attempt to get events from event flag group. AND CLEAR option. */
status = tx_event_flags_get(&group_0, 0x80008000, TX_AND_CLEAR, &actual_events, TX_NO_WAIT);
@@ -691,7 +691,7 @@ ULONG actual_events;
/* Test for error. */
if ((error) || (timer_executed != 1) || (isr_executed != 1))
{
/* Block memory error. */
printf("ERROR #36\n");
test_control_return(1);
@@ -737,7 +737,7 @@ static void thread_1_entry(ULONG thread_input)
while(1)
{
tx_thread_relinquish();
tx_thread_relinquish();
}
}
@@ -54,8 +54,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;
@@ -69,7 +69,7 @@ CHAR *pointer;
/* Create event flag group 0 and 1. */
status = tx_event_flags_create(&group_0, "group 0");
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -87,10 +87,10 @@ CHAR *pointer;
printf("Running Event Flag Information Test................................. ERROR #3\n");
test_control_return(1);
}
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check status. */
@@ -162,7 +162,7 @@ ULONG timeouts;
printf("ERROR #7\n");
test_control_return(1);
}
/* Attempt to get events from an empty event flag group. AND CLEAR option. */
status = tx_event_flags_get(&group_0, 0x80008000, TX_AND_CLEAR, &actual_events, TX_NO_WAIT);
@@ -248,7 +248,7 @@ ULONG timeouts;
printf("ERROR #14\n");
test_control_return(1);
}
/* Attempt to get events from event flag group. AND CLEAR option. */
status = tx_event_flags_get(&group_0, 0x80008000, TX_AND_CLEAR, &actual_events, TX_NO_WAIT);
@@ -343,7 +343,7 @@ ULONG timeouts;
/* Get information about the event flag group. */
status = tx_event_flags_info_get(&group_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL);
status += tx_event_flags_info_get(&group_0, &name, &current_flags, &first_suspended, &suspended_count, &next_group);
/* Check the status. */
if ((status != TX_SUCCESS) || (current_flags != group_0.tx_event_flags_group_current) || (first_suspended != TX_NULL) || (suspended_count != 0) || (next_group != &group_1))
{
@@ -357,7 +357,7 @@ ULONG timeouts;
/* Get performance information with NULL pointer. */
status = _tx_event_flags_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL);
/* Check the status. */
if (status != TX_PTR_ERROR)
{
@@ -370,9 +370,9 @@ ULONG timeouts;
/* Get performance information on the event flag group. */
status = tx_event_flags_performance_info_get(&group_0, TX_NULL, TX_NULL, TX_NULL, TX_NULL);
status += tx_event_flags_performance_info_get(&group_0, &sets, &gets, &suspensions, &timeouts);
/* Check the status. */
if ((status != TX_SUCCESS) || (sets != group_0.tx_event_flags_group_performance_set_count) || (gets != group_0.tx_event_flags_group__performance_get_count) ||
if ((status != TX_SUCCESS) || (sets != group_0.tx_event_flags_group_performance_set_count) || (gets != group_0.tx_event_flags_group__performance_get_count) ||
(suspensions != group_0.tx_event_flags_group___performance_suspension_count) || (timeouts != group_0.tx_event_flags_group____performance_timeout_count))
{
@@ -384,9 +384,9 @@ ULONG timeouts;
/* Get system performance information on all event flags groups. */
status = tx_event_flags_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL);
status += tx_event_flags_performance_system_info_get(&sets, &gets, &suspensions, &timeouts);
/* Check the status. */
if ((status != TX_SUCCESS) || (sets != _tx_event_flags_performance_set_count) || (gets != _tx_event_flags_performance_get_count) ||
if ((status != TX_SUCCESS) || (sets != _tx_event_flags_performance_set_count) || (gets != _tx_event_flags_performance_get_count) ||
(suspensions != _tx_event_flags_performance_suspension_count) || (timeouts != _tx_event_flags_performance_timeout_count))
{
@@ -64,7 +64,7 @@ static volatile UINT miss_count = 0;
condition_count++;
}
/*
/*
It is possible for this test to get into a resonance condition in which
the ISR never occurs while preemption is disabled (especially if the
ISR is installed in the periodic timer interrupt handler, which is
@@ -88,10 +88,10 @@ static volatile UINT miss_count = 0;
/* Setup some event flags just so we can clear them. */
status += tx_event_flags_set(&event_flags_0, 0x30000, TX_OR);
/* Clear the same flags immediately. */
status += tx_event_flags_set(&event_flags_0, 0xFFFEFFFF, TX_AND);
/* Clear the same flags immediately. */
status += tx_event_flags_set(&event_flags_0, 0xFFFDFFFC, TX_AND);
@@ -101,11 +101,11 @@ static volatile UINT miss_count = 0;
/* Get the events from an ISR. */
status = tx_event_flags_get(&event_flags_0, 0x30000, TX_OR, &actual, TX_NO_WAIT);
/* Check to make sure this results in an error. */
if (status != TX_NO_EVENTS)
return;
/* Do a set and a get consume from an ISR. */
status = tx_event_flags_set(&event_flags_0, 0x000000C0, TX_OR);
@@ -141,8 +141,8 @@ CHAR *pointer;
/* Put system definition stuff in here, e.g. thread creates and other assorted
create information. */
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_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -154,8 +154,8 @@ CHAR *pointer;
test_control_return(1);
}
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;
@@ -167,8 +167,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;
@@ -182,7 +182,7 @@ CHAR *pointer;
/* Create event flags group. */
status = tx_event_flags_create(&event_flags_0, "event_flags 0");
/* Check for status. */
if (status != TX_SUCCESS)
{
@@ -201,7 +201,7 @@ CHAR *pointer;
printf("Running Event Flag Set/Clear from ISR Test.......................... ERROR #5\n");
test_control_return(1);
}
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&event_flags_0, event_set_notify);
@@ -242,7 +242,7 @@ ULONG actual;
printf("Running Event Flag Set/Clear from ISR Test.......................... ");
/* Setup the test ISR. */
test_isr_dispatch = test_isr;
test_isr_dispatch = test_isr;
/* Loop to exploit the probability window inside tx_event_flags_set call. */
while (condition_count < 40)
@@ -252,7 +252,7 @@ ULONG actual;
status = tx_event_flags_get(&event_flags_0, 2, TX_OR_CLEAR, &actual, 4);
/* Determine if we have an unexpected result. */
if (status != TX_SUCCESS)
if (status != TX_SUCCESS)
{
/* Test error! */
@@ -279,7 +279,7 @@ ULONG actual;
}
/* Setup the test ISR. */
test_isr_dispatch = TX_NULL;
test_isr_dispatch = TX_NULL;
/* Let the other threads run once more... */
tx_thread_relinquish();
@@ -318,7 +318,7 @@ ULONG actual;
status = tx_event_flags_get(&event_flags_0, 1, TX_OR_CLEAR, &actual, 4);
/* Determine if we have an unexpected result. */
if (status != TX_SUCCESS)
if (status != TX_SUCCESS)
{
break;
@@ -63,7 +63,7 @@ static volatile UINT miss_count = 0;
condition_count++;
}
/*
/*
It is possible for this test to get into a resonance condition in which
the ISR never occurs while preemption is disabled (especially if the
ISR is installed in the periodic timer interrupt handler, which is
@@ -85,10 +85,10 @@ static volatile UINT miss_count = 0;
/* Abort the threads 1 and 2. */
status += tx_thread_wait_abort(&thread_0);
status += tx_thread_wait_abort(&thread_1);
if (status == TX_SUCCESS)
{
event_flags_wait_abort_counter++;
}
}
@@ -114,8 +114,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;
@@ -127,8 +127,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;
@@ -140,8 +140,8 @@ 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_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -155,7 +155,7 @@ CHAR *pointer;
/* Create event flags group. */
status = tx_event_flags_create(&event_flags_0, "event_flags 0");
/* Check for status. */
if (status != TX_SUCCESS)
{
@@ -174,10 +174,10 @@ CHAR *pointer;
printf("Running Event Flag Wait Abort from ISR Test......................... ERROR #5\n");
test_control_return(1);
}
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&event_flags_0, event_set_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check status. */
@@ -216,7 +216,7 @@ ULONG actual;
printf("Running Event Flag Wait Abort from ISR Test......................... ");
/* Setup the test ISR. */
test_isr_dispatch = test_isr;
test_isr_dispatch = test_isr;
/* Loop to exploit the probability window inside tx_event_flags_set call. */
while (condition_count < 40)
@@ -226,7 +226,7 @@ ULONG actual;
status = tx_event_flags_get(&event_flags_0, 2, TX_OR_CLEAR, &actual, 4);
/* Determine if we have an unexpected result. */
if (status != TX_WAIT_ABORTED)
if (status != TX_WAIT_ABORTED)
{
/* Test error! */
@@ -253,7 +253,7 @@ ULONG actual;
}
/* Setup the test ISR. */
test_isr_dispatch = TX_NULL;
test_isr_dispatch = TX_NULL;
/* Let the other threads run once more... */
tx_thread_relinquish();
@@ -292,7 +292,7 @@ ULONG actual;
status = tx_event_flags_get(&event_flags_0, 1, TX_OR_CLEAR, &actual, 4);
/* Determine if we have an unexpected result. */
if (status != TX_WAIT_ABORTED)
if (status != TX_WAIT_ABORTED)
{
break;
@@ -54,8 +54,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;
@@ -67,8 +67,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,
18, 18, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -80,8 +80,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
18, 18, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -106,7 +106,7 @@ CHAR *pointer;
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check status. */
@@ -160,7 +160,7 @@ UINT status;
printf("ERROR #7\n");
test_control_return(1);
}
/* Now terminate thread 1. */
status = tx_thread_terminate(&thread_1);
@@ -206,9 +206,9 @@ UINT status;
test_control_return(1);
}
/* At this point, thread 2 is suspended on the flags again. Or some flags that are
/* At this point, thread 2 is suspended on the flags again. Or some flags that are
not needed. */
/* Set an event flag that is not needed. */
status = tx_event_flags_set(&group_0, 0x00000001, TX_OR);
@@ -231,7 +231,7 @@ UINT status;
tx_thread_sleep(5);
/* Check status and run counters. */
if ((status != TX_SUCCESS) || (thread_1_counter != 1) || (thread_2_counter != 3) ||
if ((status != TX_SUCCESS) || (thread_1_counter != 1) || (thread_2_counter != 3) ||
(_tx_thread_preempt_disable))
{
@@ -280,7 +280,7 @@ UINT status;
/* Check status. */
if (status != TX_SUCCESS)
{
thread_1_counter = 0; /* Make an error! */
thread_1_counter = 0; /* Make an error! */
return;
}
}
@@ -55,8 +55,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;
@@ -68,8 +68,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -81,8 +81,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -94,8 +94,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -120,7 +120,7 @@ CHAR *pointer;
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check status. */
@@ -51,8 +51,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;
@@ -64,8 +64,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -78,8 +78,8 @@ CHAR *pointer;
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -101,10 +101,10 @@ CHAR *pointer;
printf("Running Event Flag Suspension/Consumption Unique Bit Test........... ERROR #4\n");
test_control_return(1);
}
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check status. */
@@ -140,7 +140,7 @@ UINT status;
/* Inform user. */
printf("Running Event Flag Suspension/Consumption Unique Bit Test........... ");
/* Increment run counter. */
thread_0_counter++;
@@ -51,8 +51,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;
@@ -64,8 +64,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -78,8 +78,8 @@ CHAR *pointer;
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -104,7 +104,7 @@ CHAR *pointer;
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check status. */
@@ -140,7 +140,7 @@ UINT status;
/* Inform user. */
printf("Running Event Flag Suspension Unique Bit Test....................... ");
/* Increment run counter. */
thread_0_counter++;
@@ -58,8 +58,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;
@@ -71,8 +71,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -84,8 +84,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -97,8 +97,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -110,8 +110,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -136,7 +136,7 @@ CHAR *pointer;
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check status. */
@@ -223,11 +223,11 @@ int i;
/* Resume thread 4 so it can suspend on the event flag group too. */
status += tx_thread_resume(&thread_4);
/* Determine if there was an error. */
if ((status != TX_SUCCESS) || (thread_4_counter != 1))
{
/* Event flag error. */
printf("ERROR #11\n");
test_control_return(1);
@@ -239,7 +239,7 @@ int i;
/* Determine if there was an error. */
if ((status != TX_SUCCESS) || (thread_4_counter != 2))
{
/* Event flag error. */
printf("ERROR #12\n");
test_control_return(1);
@@ -54,8 +54,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;
@@ -67,12 +67,12 @@ 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,
16, 16, 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,
18, 18, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -84,8 +84,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -110,7 +110,7 @@ CHAR *pointer;
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check status. */
@@ -140,7 +140,7 @@ CHAR *pointer;
static void thread_0_entry(ULONG thread_input)
{
ULONG actual_events;
UINT status;
@@ -200,7 +200,7 @@ UINT status;
ULONG actual_events;
/* Wait for event flags. */
while(1)
{
@@ -52,8 +52,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;
@@ -65,8 +65,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -78,8 +78,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -101,7 +101,7 @@ CHAR *pointer;
printf("Running Event Flag Thread Terminate Test............................ ERROR #4\n");
test_control_return(1);
}
/* Register the event set notify function. */
status = tx_event_flags_set_notify(&group_0, event_set_notify);
@@ -10,7 +10,7 @@ TEST_FLAG test_forced_mutex_timeout;
TEST_FLAG threadx_mutex_suspension_put_test;
TEST_FLAG threadx_mutex_suspension_priority_test;
TEST_FLAG threadx_byte_allocate_loop_test;
TEST_FLAG test_initialize_flag;
TEST_FLAG test_initialize_flag;
TEST_FLAG threadx_byte_release_loop_test;
TEST_FLAG test_stack_analyze_flag;
@@ -29,7 +29,7 @@ UINT test_event_flags_from_init;
UINT test_byte_pool_create_init;
UINT test_block_pool_create_init;
UINT test_timer_create_init;
UINT mutex_priority_change_extension_selection;
UINT mutex_priority_change_extension_selection;
UINT priority_change_extension_selection;
@@ -1,4 +1,4 @@
/* This test is designed to test the interrupt control service call avaialbe to the
/* This test is designed to test the interrupt control service call avaialbe to the
application. */
#include <stdio.h>
@@ -36,8 +36,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;
+34 -34
View File
@@ -77,7 +77,7 @@ UINT status;
/* Attempt to create a mutex from a timer. */
status = tx_mutex_create(&mutex_4, "mutex 4", TX_NO_INHERIT);
/* Check status. */
if (status != TX_CALLER_ERROR)
{
@@ -96,7 +96,7 @@ UINT status;
/* Error! */
error++;
}
/* Attempt to get from mutex from a timer with suspension. */
status = tx_mutex_get(&mutex_2, 100);
@@ -124,7 +124,7 @@ UINT status;
/* Attempt to create a mutex from an ISR. */
status = tx_mutex_create(&mutex_4, "mutex 4", TX_NO_INHERIT);
/* Check status. */
if (status != TX_CALLER_ERROR)
{
@@ -201,29 +201,29 @@ 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,
16, 16, TX_NO_TIME_SLICE, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
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,
16, 16, TX_NO_TIME_SLICE, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
status += tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status += tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
18, 18, TX_NO_TIME_SLICE, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status += tx_thread_create(&thread_3, "thread 3", thread_3_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
18, 18, TX_NO_TIME_SLICE, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
18, 18, TX_NO_TIME_SLICE, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -309,11 +309,11 @@ UINT status;
mutex_memory.second = 0x55667788;
mutex_memory.next_to_last = 0x99aabbcc;
mutex_memory.last = 0xddeeff00;
/* Create the semaphore. */
status = tx_mutex_create(&mutex_memory.mutex, "mutex memory", TX_INHERIT);
tx_mutex_delete(&mutex_memory.mutex);
/* Check for status. */
if ((status != TX_SUCCESS) ||
(mutex_memory.first != 0x11223344) ||
@@ -326,7 +326,7 @@ UINT status;
printf("ERROR #6\n");
test_control_return(1);
}
/* Increment thread 0 counter. */
thread_0_counter++;
@@ -334,7 +334,7 @@ UINT status;
/* Attempt to create a mutex with a NULL pointer. */
status = tx_mutex_create(TX_NULL, "mutex 2", TX_INHERIT);
/* Check status. */
if (status != TX_MUTEX_ERROR)
{
@@ -346,7 +346,7 @@ UINT status;
/* Attempt to create a mutex with a bad size. */
status = _txe_mutex_create(&mutex_5, "mutex 5", TX_INHERIT, (sizeof(TX_MUTEX)+1));
/* Check status. */
if (status != TX_MUTEX_ERROR)
{
@@ -358,7 +358,7 @@ UINT status;
/* Attempt to create a mutex that has already been created. */
status = tx_mutex_create(&mutex_2, "mutex 2", TX_INHERIT);
/* Check status. */
if (status != TX_MUTEX_ERROR)
{
@@ -370,7 +370,7 @@ UINT status;
/* Attempt to create a mutex with a bad inheritance option. */
status = tx_mutex_create(&mutex_4, "mutex 4", 14);
/* Check status. */
if (status != TX_INHERIT_ERROR)
{
@@ -509,7 +509,7 @@ UINT status;
/* Attempt to get the mutex. Should be unsuccessful. */
status = tx_mutex_get(&mutex_1, TX_NO_WAIT);
/* Check status. */
if (status != TX_NOT_AVAILABLE)
{
@@ -535,7 +535,7 @@ UINT status;
}
status = tx_mutex_delete(&mutex_1);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -592,7 +592,7 @@ UINT status;
/* Test for error. */
if ((error) || (timer_executed != 1) || (isr_executed != 1))
{
/* Block memory error. */
printf("ERROR #26\n");
test_control_return(1);
@@ -603,7 +603,7 @@ UINT status;
/* Release mutex multiple times. */
status = tx_mutex_put(&mutex_2);
status += tx_mutex_put(&mutex_2);
/* Check status. */
if (status != TX_NOT_OWNED)
{
@@ -624,7 +624,7 @@ UINT status;
printf("ERROR #28\n");
test_control_return(1);
}
/* Delete mutex. */
status = tx_mutex_delete(&mutex_2);
@@ -639,14 +639,14 @@ UINT status;
/* Get mutex 8. */
status = tx_mutex_get(&mutex_8, TX_WAIT_FOREVER);
/* Start thread 3 and 4. */
status += tx_thread_resume(&thread_3);
status += tx_thread_resume(&thread_4);
/* Sleep to let thread 3 suspend on the mutex. */
tx_thread_sleep(2);
/* Now, put the mutex to give it to thread 3. */
status += tx_mutex_put(&mutex_8);
@@ -660,7 +660,7 @@ UINT status;
}
status = tx_mutex_delete(&mutex_3);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -713,14 +713,14 @@ UINT status;
test_control_return(1);
}
/* Create and obtain a couple mutexes so the thread completion can release them. */
/* Create and obtain a couple mutexes so the thread completion can release them. */
status = tx_mutex_create(&mutex_6, "mutex 6", TX_NO_INHERIT);
status += tx_mutex_create(&mutex_7, "mutex 7", TX_NO_INHERIT);
status += tx_mutex_get(&mutex_6, TX_NO_WAIT);
status += tx_mutex_get(&mutex_7, TX_NO_WAIT);
status += tx_mutex_get(&mutex_6, TX_NO_WAIT);
status += tx_mutex_get(&mutex_7, TX_NO_WAIT);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -738,7 +738,7 @@ static void thread_2_entry(ULONG thread_input)
while(1)
{
tx_thread_relinquish();
tx_thread_relinquish();
}
}
@@ -748,7 +748,7 @@ static void thread_3_entry(ULONG thread_input)
while(1)
{
tx_mutex_get(&mutex_8, TX_WAIT_FOREVER);
tx_mutex_put(&mutex_8);
}
@@ -760,7 +760,7 @@ static void thread_4_entry(ULONG thread_input)
while(1)
{
tx_mutex_get(&mutex_8, TX_WAIT_FOREVER);
tx_mutex_put(&mutex_8);
}
@@ -47,8 +47,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -60,8 +60,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -73,8 +73,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -50,14 +50,14 @@ 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,
16, 16, TX_NO_TIME_SLICE, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
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,
16, 16, TX_NO_TIME_SLICE, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -196,7 +196,7 @@ ULONG inheritances;
/* Attempt to get the mutex. Should be unsuccessful. */
status = tx_mutex_get(&mutex_1, TX_NO_WAIT);
/* Check status. */
if (status != TX_NOT_AVAILABLE)
{
@@ -222,7 +222,7 @@ ULONG inheritances;
}
status = tx_mutex_delete(&mutex_1);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -289,7 +289,7 @@ ULONG inheritances;
status += tx_mutex_info_get(&mutex_2, &name, &count, &owner, &first_suspended, &suspended_count, &next_mutex);
/* Check status. */
if ((status != TX_SUCCESS) || (count != mutex_2.tx_mutex_ownership_count) || (owner != mutex_2.tx_mutex_owner) ||
if ((status != TX_SUCCESS) || (count != mutex_2.tx_mutex_ownership_count) || (owner != mutex_2.tx_mutex_owner) ||
(first_suspended != mutex_2.tx_mutex_suspension_list) || (suspended_count != mutex_2.tx_mutex_suspended_count) || (next_mutex != mutex_2.tx_mutex_created_next))
{
@@ -314,7 +314,7 @@ ULONG inheritances;
/* Now get the performance inforamtion. */
status = tx_mutex_performance_info_get(&mutex_2, &puts, &gets, &suspensions, &timeouts, &inversions, &inheritances);
/* Check status. */
if ((status != TX_SUCCESS) || (puts != mutex_2.tx_mutex_performance_put_count) || (gets != mutex_2.tx_mutex_performance_get_count) ||
(suspensions != mutex_2.tx_mutex_performance_suspension_count) || (timeouts != mutex_2.tx_mutex_performance_timeout_count) ||
@@ -325,10 +325,10 @@ ULONG inheritances;
printf("ERROR #19\n");
test_control_return(1);
}
/* Now get the system performance inforamtion. */
status = tx_mutex_performance_system_info_get(&puts, &gets, &suspensions, &timeouts, &inversions, &inheritances);
/* Check status. */
if ((status != TX_SUCCESS) || (puts != _tx_mutex_performance_put_count) || (gets != _tx_mutex_performance_get_count) ||
(suspensions != _tx_mutex_performance_suspension_count) || (timeouts != _tx_mutex_performance_timeout_count) ||
@@ -537,7 +537,7 @@ ULONG inheritances;
}
status = tx_mutex_delete(&mutex_3);
/* Check status. */
if (status != TX_SUCCESS)
{
@@ -9,7 +9,7 @@
/* Define the ThreadX object control blocks... */
static TX_THREAD thread_0;
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
static TX_THREAD thread_1;
static TX_THREAD thread_2;
static TX_THREAD thread_3;
@@ -37,7 +37,7 @@ static ULONG thread_6_counter;
/* Define thread prototypes. */
static void thread_0_entry(ULONG thread_input);
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
static void thread_1_entry(ULONG thread_input);
static void thread_2_entry(ULONG thread_input);
static void thread_3_entry(ULONG thread_input);
@@ -66,8 +66,8 @@ UINT status;
pointer = (CHAR *) first_unused_memory;
/* Create thread. */
status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
pointer, DEMO_STACK_SIZE,
status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
pointer, DEMO_STACK_SIZE,
16, 1, TX_NO_TIME_SLICE, TX_AUTO_START);
pointer = pointer + DEMO_STACK_SIZE;
@@ -79,11 +79,11 @@ UINT status;
test_control_return(1);
}
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
/* Create thread. */
status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1,
pointer, DEMO_STACK_SIZE,
status = tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_DONT_START);
pointer = pointer + DEMO_STACK_SIZE;
@@ -96,8 +96,8 @@ UINT status;
}
/* Create thread. */
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2,
pointer, DEMO_STACK_SIZE,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2,
pointer, DEMO_STACK_SIZE,
4, 4, TX_NO_TIME_SLICE, TX_DONT_START);
pointer = pointer + DEMO_STACK_SIZE;
@@ -110,8 +110,8 @@ UINT status;
}
/* Create thread. */
status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3,
pointer, DEMO_STACK_SIZE,
status = tx_thread_create(&thread_3, "thread 3", thread_3_entry, 3,
pointer, DEMO_STACK_SIZE,
30, 1, TX_NO_TIME_SLICE, TX_AUTO_START);
pointer = pointer + DEMO_STACK_SIZE;
@@ -124,8 +124,8 @@ UINT status;
}
/* Create thread. */
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, DEMO_STACK_SIZE,
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, DEMO_STACK_SIZE,
4, 4, TX_NO_TIME_SLICE, TX_DONT_START);
pointer = pointer + DEMO_STACK_SIZE;
@@ -138,8 +138,8 @@ UINT status;
}
/* Create thread. */
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, DEMO_STACK_SIZE,
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, DEMO_STACK_SIZE,
2, 2, TX_NO_TIME_SLICE, TX_DONT_START);
pointer = pointer + DEMO_STACK_SIZE;
@@ -152,8 +152,8 @@ UINT status;
}
/* Create thread. */
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, DEMO_STACK_SIZE,
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, DEMO_STACK_SIZE,
30, 30, TX_NO_TIME_SLICE, TX_DONT_START);
pointer = pointer + DEMO_STACK_SIZE;
@@ -188,7 +188,7 @@ UINT status;
static void thread_0_entry(ULONG thread_input)
{
#ifdef TX_DISABLE_PREEMPTION_THRESHOLD
#ifdef TX_DISABLE_PREEMPTION_THRESHOLD
/* Preemption threshold is not enabled, skip this test. */
@@ -196,8 +196,8 @@ static void thread_0_entry(ULONG thread_input)
printf("Running Mutex Nested Priority Inheritance Test...................... SUCCESS!\n");
test_control_return(0);
#else
#else
UINT test_case = 0;
UINT loop_count = 0;
UINT priority;
@@ -238,7 +238,7 @@ UINT status;
test_control_return(1);
}
/* Release the mutexes... Depending on the order they are released should dictate
/* Release the mutexes... Depending on the order they are released should dictate
the thread's returned to priority. */
if (test_case == 0)
{
@@ -267,7 +267,7 @@ UINT status;
}
tx_mutex_put(&mutex_0);
/* No change. */
if (thread_0.tx_thread_priority != 15)
{
@@ -281,7 +281,7 @@ UINT status;
{
priority = thread_0.tx_thread_priority;
tx_mutex_put(&mutex_0);
tx_mutex_put(&mutex_0);
/* Should have no change in priority since nothing was inherited for this mutex. */
if (thread_0.tx_thread_priority != priority)
@@ -292,7 +292,7 @@ UINT status;
test_control_return(4);
}
tx_mutex_put(&mutex_1);
tx_mutex_put(&mutex_1);
/* Should not do anything since mutex 2 elevated to a higher priority. */
if (thread_0.tx_thread_priority != priority)
@@ -303,7 +303,7 @@ UINT status;
test_control_return(5);
}
tx_mutex_put(&mutex_2);
tx_mutex_put(&mutex_2);
/* Should go back to priority 15. */
if (thread_0.tx_thread_priority != 15)
@@ -317,7 +317,7 @@ UINT status;
else if (test_case == 2)
{
tx_mutex_put(&mutex_2);
tx_mutex_put(&mutex_2);
/* Should go back to priority 8. */
if (thread_0.tx_thread_priority != 8)
@@ -328,7 +328,7 @@ UINT status;
test_control_return(7);
}
tx_mutex_put(&mutex_0);
tx_mutex_put(&mutex_0);
/* Should not do anything. */
if (thread_0.tx_thread_priority != 8)
@@ -339,7 +339,7 @@ UINT status;
test_control_return(8);
}
tx_mutex_put(&mutex_1);
tx_mutex_put(&mutex_1);
/* Should go back to priority 15. */
if (thread_0.tx_thread_priority != 15)
@@ -354,7 +354,7 @@ UINT status;
{
priority = thread_0.tx_thread_priority;
tx_mutex_put(&mutex_1);
tx_mutex_put(&mutex_1);
/* Should not do anything since mutex 2 is still owned. */
if (thread_0.tx_thread_priority != priority)
@@ -366,7 +366,7 @@ UINT status;
}
tx_mutex_put(&mutex_0);
/* Should not do anything. */
if (thread_0.tx_thread_priority != priority)
{
@@ -376,7 +376,7 @@ UINT status;
test_control_return(11);
}
tx_mutex_put(&mutex_2);
tx_mutex_put(&mutex_2);
/* Should finally go back to priority 15. */
if (thread_0.tx_thread_priority != 15)
@@ -391,7 +391,7 @@ UINT status;
{
priority = thread_0.tx_thread_priority;
tx_mutex_put(&mutex_1);
tx_mutex_put(&mutex_1);
/* Should not do anything since mutex 2 is still owned. */
if (thread_0.tx_thread_priority != priority)
@@ -402,7 +402,7 @@ UINT status;
test_control_return(13);
}
tx_mutex_put(&mutex_2);
tx_mutex_put(&mutex_2);
/* Should reurn us back to priority 15. */
if (thread_0.tx_thread_priority != 15)
@@ -413,7 +413,7 @@ UINT status;
test_control_return(14);
}
tx_mutex_put(&mutex_0);
tx_mutex_put(&mutex_0);
/* Should not do anything. */
if (thread_0.tx_thread_priority != 15)
@@ -428,7 +428,7 @@ UINT status;
{
priority = thread_0.tx_thread_priority;
tx_mutex_put(&mutex_0);
tx_mutex_put(&mutex_0);
/* Should not do anything since mutex 2 is still owned. */
if (thread_0.tx_thread_priority != priority)
@@ -439,7 +439,7 @@ UINT status;
test_control_return(16);
}
tx_mutex_put(&mutex_2);
tx_mutex_put(&mutex_2);
/* Should reurn us back to priority 8. */
if (thread_0.tx_thread_priority != 8)
@@ -451,7 +451,7 @@ UINT status;
}
tx_mutex_put(&mutex_1);
/* Should return us back to priority 15. */
if (thread_0.tx_thread_priority != 15)
{
@@ -470,60 +470,60 @@ UINT status;
/* Check for thread 3 running... this should not happen! */
if (thread_3_counter != 50)
{
printf("ERROR #25\n");
test_control_return(19);
}
/* At this point, mutex 3 owned by this thread. */
/* Resume thread 6, lowest priority thread. */
status = tx_thread_resume(&thread_6);
/* Check for an error. */
if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 15) || (thread_6_counter != 0))
{
printf("ERROR #27\n");
test_control_return(19);
}
/* Now resume thread 4. */
status = tx_thread_resume(&thread_4);
/* Check for an error. */
if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 4) || (thread_6_counter != 0))
{
printf("ERROR #28\n");
test_control_return(19);
}
/* Now resume thread 5. */
status = tx_thread_resume(&thread_5);
/* Check for an error. */
if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 2) || (thread_6_counter != 0))
{
printf("ERROR #29\n");
test_control_return(19);
}
/* Sleep to let thread 6 run, which is lower priority. */
tx_thread_sleep(1);
/* Now release the mutex. */
status = tx_mutex_put(&mutex_3);
/* Check for an error. */
if ((status != TX_SUCCESS) || (thread_0.tx_thread_priority != 15) || (thread_6_counter != 0) || (thread_4_counter != 1) || (thread_5_counter != 1))
{
printf("ERROR #30\n");
test_control_return(19);
}
/* Sleep to let thread 6 run and release the mutex. */
tx_thread_sleep(2);
@@ -534,7 +534,7 @@ UINT status;
#endif
}
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
#ifndef TX_DISABLE_PREEMPTION_THRESHOLD
static void thread_1_entry(ULONG thread_input)
{
@@ -551,8 +551,8 @@ UINT old_threshold;
/* Update the thread priority and thread preemption-threshold of thread 0. */
tx_thread_priority_change(&thread_0, 15, &old_priority);
tx_thread_preemption_change(&thread_0, 14, &old_threshold);
tx_thread_preemption_change(&thread_0, 14, &old_threshold);
/* Get mutex. */
tx_mutex_get(&mutex_1, TX_WAIT_FOREVER);
tx_mutex_put(&mutex_1);
@@ -564,8 +564,8 @@ UINT old_threshold;
/* Update the thread priority and thread preemption-threshold of thread 0. */
tx_thread_priority_change(&thread_0, 15, &old_priority);
tx_thread_preemption_change(&thread_0, 8, &old_threshold);
tx_thread_preemption_change(&thread_0, 8, &old_threshold);
/* Get mutex. */
tx_mutex_get(&mutex_1, TX_WAIT_FOREVER);
tx_mutex_put(&mutex_1);
@@ -638,7 +638,7 @@ static void thread_4_entry(ULONG thread_input)
while(1)
{
/* Get priority inherit mutex. */
tx_mutex_get(&mutex_3, TX_WAIT_FOREVER);
@@ -43,8 +43,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -56,8 +56,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -43,8 +43,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -56,8 +56,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,
15, 15, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -1,4 +1,4 @@
/* This test is designed to test the mutex suspension and priority inheritance with another
/* This test is designed to test the mutex suspension and priority inheritance with another
thread resuming the higher priority thread by doing a mutex put. Higher-priority thread should preempt. */
#include <stdio.h>
@@ -74,16 +74,16 @@ CHAR *pointer;
/* Test for an error creating/using a mutex from initialization. */
if (test_mutex_from_init != TX_SUCCESS)
{
printf("Running Mutex Priority Inheritance Test............................. ERROR #0\n");
test_control_return(1);
}
}
/* 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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -95,8 +95,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,
15, 15, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -108,8 +108,8 @@ 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,
14, 14, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -123,8 +123,8 @@ CHAR *pointer;
/* Create a high-priority thread that will get all the priority inheritance mutexes and return from
it's entry function in order to test the auto delete feature. */
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
10, 10, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -137,8 +137,8 @@ CHAR *pointer;
}
/* Create a higher-priority thread that is used to get thread 4 into a priority inheritance state. */
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
8, 8, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -152,8 +152,8 @@ CHAR *pointer;
/* Create a higher-priority thread that is used to suspend on priority inheritance mutex 3. */
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
6, 6, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -167,8 +167,8 @@ CHAR *pointer;
/* Create a higher-priority thread that is used to suspend on priority inheritance mutex 3. */
status = tx_thread_create(&thread_7, "thread 7", thread_7_entry, 7,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_7, "thread 7", thread_7_entry, 7,
pointer, TEST_STACK_SIZE_PRINTF,
7, 7, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -246,7 +246,7 @@ UINT status;
/* Resume thread 4 to test the automatic release of the mutexes. */
tx_thread_resume(&thread_4);
/* Determine if thread 4 was able to get the mutexes before completion... and
have its original priority restored after the priority inheritance. */
if ((thread_4_counter != 1) || (thread_5_counter != 1) || (thread_4.tx_thread_priority != 10) ||
@@ -274,10 +274,10 @@ UINT status;
printf("ERROR #13\n");
test_control_return(1);
}
/* Release mutex 2 to be compatible with original test. */
tx_mutex_put(&mutex_2);
/* Now resume the higher priority thread to cause suspension. */
tx_thread_resume(&thread_1);
@@ -314,8 +314,8 @@ UINT status;
printf("ERROR #16\n");
test_control_return(1);
}
/* Now sleep for 20 ticks in order to test the priority inheritance change of a
/* Now sleep for 20 ticks in order to test the priority inheritance change of a
non-ready thread. */
tx_thread_sleep(20);
@@ -330,10 +330,10 @@ UINT status;
/* Resume thread 2 in order to get two threads suspended on the mutex. */
tx_thread_resume(&thread_2);
/* Now do a mutex put to release both threads suspended on this mutex. */
status = tx_mutex_put(&mutex_0);
/* The other thread should now be suspended on the mutex. */
if ((status != TX_SUCCESS) || (thread_1_counter != 4) || (thread_2_counter != 2) || (thread_0.tx_thread_priority != 16))
{
@@ -342,7 +342,7 @@ UINT status;
printf("ERROR #18\n");
test_control_return(1);
}
/* At this point, get the mutex again. */
status = tx_mutex_get(&mutex_0, TX_NO_WAIT);
@@ -354,7 +354,7 @@ UINT status;
printf("ERROR #19\n");
test_control_return(1);
}
/* Abort the sleep. */
tx_thread_wait_abort(&thread_1);
tx_thread_wait_abort(&thread_2);
@@ -362,10 +362,10 @@ UINT status;
/* Now both threads are suspended again on mutex... and then terminate them. */
tx_thread_terminate(&thread_1);
tx_thread_terminate(&thread_2);
/* Now do a mutex put to release both threads suspended on this mutex. */
status = tx_mutex_put(&mutex_0);
/* The other thread should now be suspended on the mutex. */
if ((status != TX_SUCCESS) || (thread_1_counter != 5) || (thread_2_counter != 3) || (thread_0.tx_thread_priority != 16))
{
@@ -376,21 +376,21 @@ UINT status;
}
/* Now test the timeout on the suspension list of a priority inheritance mutex. */
/* First, obtain priority inheritance mutex 3. */
status = tx_mutex_get(&mutex_3, TX_WAIT_FOREVER);
/* Next resume threads 6 and 7 so they will block on trying to get this mutex forever. */
status += tx_thread_resume(&thread_7);
status += tx_thread_resume(&thread_6);
/* Now set the flag which will cause the last thread in the suspension list to timeout (abort)
resulting in a NULL suspension list and covering that branch condition in tx_mutex_put */
test_forced_mutex_timeout = 1;
/* Perform a mutex put to release the mutex. */
status += tx_mutex_put(&mutex_3);
/* Now check for errors. */
#ifndef TX_MISRA_ENABLE
#ifndef TX_MANUAL_TEST
@@ -404,9 +404,9 @@ UINT status;
#endif
#else
if ((status != TX_SUCCESS) || (thread_6_counter != 1))
#endif
#endif
{
/* Mutex error. */
printf("ERROR #21\n");
test_control_return(1);
@@ -429,7 +429,7 @@ UINT status;
while(1)
{
/* Increment thread run counter. */
thread_1_counter++;
@@ -440,9 +440,9 @@ UINT status;
/* Did we get the right status? */
if (status == TX_SUCCESS)
thread_1_counter++;
/* Sleep for 10 ticks... to delay. */
tx_thread_sleep(10);
tx_thread_sleep(10);
}
}
@@ -458,7 +458,7 @@ UINT status;
while(1)
{
/* Increment thread run counter. */
thread_2_counter++;
@@ -469,9 +469,9 @@ UINT status;
/* Did we get the right status? */
if (status == TX_SUCCESS)
thread_2_counter++;
/* Sleep for 10 ticks... to delay. */
tx_thread_sleep(10);
tx_thread_sleep(10);
}
}
@@ -482,7 +482,7 @@ static void thread_4_entry(ULONG thread_input)
UINT status;
UINT old_priority;
/* Get mutex to cause additional ownership linked-list processing. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
status += tx_mutex_get(&mutex_1, TX_WAIT_FOREVER);
@@ -493,7 +493,7 @@ UINT old_priority;
/* Resume thread 5 to get into priority inheritance. */
tx_thread_resume(&thread_5);
/* Determine if all the mutex gets were successful... and we have
/* Determine if all the mutex gets were successful... and we have
inherited priority 8. */
if ((status == TX_SUCCESS) && (thread_4.tx_thread_priority == 8))
{
@@ -501,10 +501,10 @@ UINT old_priority;
/* Yes, increment the thread counter. */
thread_4_counter++;
}
/* Now, attempt to manually set this thread's priority to the same priority. */
status = tx_thread_priority_change(&thread_4, 8, &old_priority);
/* Determine if there is an error. */
if ((status != TX_SUCCESS) || (thread_4.tx_thread_user_priority != 8) || (old_priority != 10))
{
@@ -515,7 +515,7 @@ UINT old_priority;
/* Now attempt to manually set the same thread priority. */
status = tx_thread_priority_change(&thread_4, 8, &old_priority);
/* Determine if there is an error. */
if ((status != TX_SUCCESS) || (thread_4.tx_thread_user_priority != 8) || (old_priority != 8))
{
@@ -523,10 +523,10 @@ UINT old_priority;
/* Clear the counter, which will signal an error to the thread above. */
thread_4_counter = 0;
}
/* Now restore the original user priority of 10. */
status = tx_thread_priority_change(&thread_4, 10, &old_priority);
/* Determine if there is an error. */
if ((status != TX_SUCCESS) || (thread_4.tx_thread_user_priority != 10) || (old_priority != 8))
{
@@ -535,7 +535,7 @@ UINT old_priority;
thread_4_counter = 0;
}
/* Now fall through and make sure the mutex cleanup function
/* Now fall through and make sure the mutex cleanup function
releases all the mutexes. */
}
@@ -545,7 +545,7 @@ static void thread_5_entry(ULONG thread_input)
UINT status;
/* Get mutex to cause priority inheritance in thread 4. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
@@ -557,7 +557,7 @@ UINT status;
thread_5_counter++;
}
/* Now fall through and make sure the mutex cleanup function
/* Now fall through and make sure the mutex cleanup function
releases all the mutexes. */
}
@@ -567,7 +567,7 @@ static void thread_6_entry(ULONG thread_input)
UINT status;
/* Get mutex to cause priority inheritance in thread 0. */
status = tx_mutex_get(&mutex_3, TX_WAIT_FOREVER);
@@ -579,7 +579,7 @@ UINT status;
thread_6_counter++;
}
/* Now fall through and make sure the mutex cleanup function
/* Now fall through and make sure the mutex cleanup function
releases all the mutexes. */
}
@@ -589,7 +589,7 @@ static void thread_7_entry(ULONG thread_input)
UINT status;
/* Get mutex to cause priority inheritance in thread 0. */
status = tx_mutex_get(&mutex_3, TX_WAIT_FOREVER);
@@ -601,7 +601,7 @@ UINT status;
thread_7_counter++;
}
/* Now fall through and make sure the mutex cleanup function
/* Now fall through and make sure the mutex cleanup function
releases all the mutexes. */
}
@@ -76,12 +76,12 @@ static void test_isr(void)
}
else
{
/* Abort the wait of thread 5. */
tx_thread_wait_abort(&thread_5);
/* End the ISR processing. */
test_status = 2;
test_status = 2;
test_isr_dispatch = TX_NULL;
}
}
@@ -107,8 +107,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -120,8 +120,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,
15, 15, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -133,8 +133,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
14, 14, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -146,8 +146,8 @@ CHAR *pointer;
test_control_return(1);
}
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,
3, 3, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -159,8 +159,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
4, 4, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -172,8 +172,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, TEST_STACK_SIZE_PRINTF,
5, 5, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -185,8 +185,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_6, "thread 6", thread_6_entry, 6,
pointer, TEST_STACK_SIZE_PRINTF,
6, 6, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -323,7 +323,7 @@ UINT status;
tx_thread_resume(&thread_4);
tx_thread_resume(&thread_5);
tx_thread_resume(&thread_6);
/* Prioritize the block pool suspension list. */
status = tx_mutex_prioritize(&mutex_0);
@@ -338,7 +338,7 @@ UINT status;
/* Now loop to test the interrupt of the prioritize loop logic. */
test_status = 1;
test_isr_dispatch = test_isr;
test_isr_dispatch = test_isr;
do
{
@@ -355,10 +355,10 @@ UINT status;
}
} while (test_status == 1);
/* Now determine if thread 4 is at the front of the list... It should be! */
if (mutex_0.tx_mutex_suspension_list != &thread_4)
{
{
/* Mutex error. */
printf("ERROR #17\n");
@@ -382,19 +382,19 @@ UINT status;
while (1)
{
/* Suspend on the mutex. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Release the mutex. */
status += tx_mutex_put(&mutex_0);
/* Did we get the right status? */
if (status == TX_SUCCESS)
thread_1_counter++;
/* Self suspend. */
tx_thread_suspend(&thread_1);
tx_thread_suspend(&thread_1);
}
}
@@ -407,19 +407,19 @@ UINT status;
while (1)
{
/* Suspend on the mutex. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Release the mutex. */
status += tx_mutex_put(&mutex_0);
/* Did we get the right status? */
if (status == TX_SUCCESS)
thread_2_counter++;
/* Self suspend. */
tx_thread_suspend(&thread_2);
tx_thread_suspend(&thread_2);
}
}
@@ -432,19 +432,19 @@ UINT status;
while (1)
{
/* Suspend on the mutex. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Release the mutex. */
status += tx_mutex_put(&mutex_0);
/* Did we get the right status? */
if (status == TX_SUCCESS)
thread_3_counter++;
/* Self suspend. */
tx_thread_suspend(&thread_3);
tx_thread_suspend(&thread_3);
}
}
@@ -457,19 +457,19 @@ UINT status;
while (1)
{
/* Suspend on the mutex. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Release the mutex. */
status += tx_mutex_put(&mutex_0);
/* Did we get the right status? */
if (status == TX_SUCCESS)
thread_4_counter++;
/* Self suspend. */
tx_thread_suspend(&thread_4);
tx_thread_suspend(&thread_4);
}
}
@@ -482,19 +482,19 @@ UINT status;
while (1)
{
/* Suspend on the mutex. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Release the mutex. */
status += tx_mutex_put(&mutex_0);
/* Did we get the right status? */
if (status == TX_SUCCESS)
thread_5_counter++;
/* Self suspend. */
tx_thread_suspend(&thread_5);
tx_thread_suspend(&thread_5);
}
}
@@ -507,19 +507,19 @@ UINT status;
while (1)
{
/* Suspend on the mutex. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Release the mutex. */
status += tx_mutex_put(&mutex_0);
/* Did we get the right status? */
if (status == TX_SUCCESS)
thread_6_counter++;
/* Self suspend. */
tx_thread_suspend(&thread_6);
tx_thread_suspend(&thread_6);
}
}
@@ -17,7 +17,7 @@ static TX_THREAD low_priority;
static TX_MUTEX mutex_0;
static TX_MUTEX mutex_1;
extern UINT mutex_priority_change_extension_selection;
extern UINT mutex_priority_change_extension_selection;
/* Define thread prototypes. */
@@ -44,7 +44,7 @@ extern TEST_FLAG threadx_mutex_suspension_priority_test;
#endif
/* This test routine is used to get NULL suspension lists in various parts of tx_mutex_put. This is hooked up to IRQ 0 on this simulation and is entered manually at the
/* This test routine is used to get NULL suspension lists in various parts of tx_mutex_put. This is hooked up to IRQ 0 on this simulation and is entered manually at the
correct time. */
void abort_all_threads_suspended_on_mutex(void)
{
@@ -56,7 +56,7 @@ TX_THREAD *thread_ptr;
{
if (thread_ptr -> tx_thread_state == TX_MUTEX_SUSP)
tx_thread_wait_abort(thread_ptr);
thread_ptr = thread_ptr -> tx_thread_created_next;
if (thread_ptr == _tx_thread_created_ptr)
break;
@@ -64,7 +64,7 @@ TX_THREAD *thread_ptr;
}
/* This test routine is used to get a thread of a non ready state into _tx_mutex_change, called froim _tx_mutex_put. This is hooked up to IRQ 1 on this simulation and is entered manually at the
/* This test routine is used to get a thread of a non ready state into _tx_mutex_change, called froim _tx_mutex_put. This is hooked up to IRQ 1 on this simulation and is entered manually at the
correct time. */
void suspend_lowest_priority(void)
{
@@ -77,7 +77,7 @@ TX_THREAD *thread_ptr;
/* Determine which extension to perform... to get to the different error checks in _tx_mutex_priority_change. */
if (mutex_priority_change_extension_selection == 0)
{
/* Setup the thread pointer. */
thread_ptr = &thread_0;
@@ -114,7 +114,7 @@ TX_THREAD *thread_ptr;
}
else if (mutex_priority_change_extension_selection == 1)
{
/* Make the mapped core field to be invalid to exercise the error checking branch for core_index. */
thread_0.tx_thread_smp_core_mapped = TX_THREAD_SMP_MAX_CORES;
}
@@ -140,28 +140,28 @@ 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, 0,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
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,
1, 1, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
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,
2, 2, 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,
3, 3, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
status += tx_thread_create(&thread_4, "thread 4", thread_4_entry, 4,
pointer, TEST_STACK_SIZE_PRINTF,
4, 4, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
status += tx_thread_create(&low_priority, "low priority", low_priority_entry, 30,
pointer, TEST_STACK_SIZE_PRINTF,
status += tx_thread_create(&low_priority, "low priority", low_priority_entry, 30,
pointer, TEST_STACK_SIZE_PRINTF,
30, 30, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -225,7 +225,7 @@ UINT status;
/* Get the mutex. */
status = tx_mutex_get(&mutex_1, TX_WAIT_FOREVER);
/* Make sure the three higher priority threads suspend on the mutex. */
tx_thread_resume(&thread_4);
tx_thread_resume(&thread_3);
@@ -245,16 +245,16 @@ UINT status;
#endif
/* Now some hand testing for tx_mutex_priority_change. */
/* Resume the low priority thread. */
/* Resume the low priority thread. */
tx_thread_resume(&low_priority);
/* Disable interrupts. */
TX_DISABLE
/* Simulate a call from inside of mutex put, but doing it here makes life easier. */
_tx_thread_preempt_disable++;
/* Move the current thread to a lower priority. */
_tx_mutex_priority_change(&thread_0, 15);
_tx_mutex_priority_change(&thread_0, 16);
@@ -263,16 +263,16 @@ UINT status;
_tx_mutex_priority_change(&low_priority, 28);
_tx_mutex_priority_change(&low_priority, 29);
_tx_mutex_priority_change(&low_priority, 30);
/* Change the priority of the current thread, such that we should have reverse the preemption-threshold issue. */
thread_0.tx_thread_user_priority = 30;
thread_0.tx_thread_user_preempt_threshold = 30;
_tx_mutex_priority_change(&thread_0, 30);
_tx_mutex_priority_change(&thread_0, 30);
/* Change to an even lower priority. */
thread_0.tx_thread_user_priority = 31;
thread_0.tx_thread_user_preempt_threshold = 31;
_tx_mutex_priority_change(&thread_0, 31);
_tx_mutex_priority_change(&thread_0, 31);
/* Move back to a higher-priority. */
thread_0.tx_thread_user_priority = 30;
@@ -284,31 +284,31 @@ UINT status;
/* Set BP here and step into code and step through the code until the internal thread resume function returns, then issue an IRQ 1 to cause an ISR to suspend the thread and test the first condition. */
_tx_mutex_priority_change(&thread_0, 30);
#else
/* Set the flag to suspend the thread and test the first condition after internal resume is called. */
mutex_priority_change_extension_selection = 0;
threadx_mutex_suspension_priority_test = 1;
_tx_mutex_priority_change(&thread_0, 30);
#endif
/* Resume this thread. */
tx_thread_resume(&thread_0);
_tx_mutex_priority_change(&thread_0, 16);
/* Change to an even lower priority. */
thread_0.tx_thread_user_priority = 27;
thread_0.tx_thread_user_preempt_threshold = 27;
_tx_mutex_priority_change(&thread_0, 28);
_tx_mutex_priority_change(&thread_0, 28);
/* Setup the low priority thread infromation. */
low_priority.tx_thread_user_priority = 30;
low_priority.tx_thread_user_preempt_threshold = 29;
_tx_mutex_priority_change(&low_priority, 31);
/* Change to an even lower priority. */
thread_0.tx_thread_user_priority = 30;
thread_0.tx_thread_user_preempt_threshold = 29;
_tx_mutex_priority_change(&thread_0, 26);
_tx_mutex_priority_change(&thread_0, 26);
#ifdef TX_MANUAL_TEST
@@ -317,30 +317,30 @@ UINT status;
_tx_mutex_priority_change(&thread_0, 30);
thread_0.tx_thread_smp_core_mapped = 0;
#else
/* Set the flag to suspend the thread and test the first condition after internal resume is called. */
mutex_priority_change_extension_selection = 1;
threadx_mutex_suspension_priority_test = 1;
_tx_mutex_priority_change(&thread_0, 30);
thread_0.tx_thread_smp_core_mapped = 0;
#endif
#endif
/* Move the thread back to priority 28. */
_tx_mutex_priority_change(&thread_0, 28);
#ifdef TX_MANUAL_TEST
/* Set BP here and step into code and step through the code until the internal thread resume function returns, and then issue the IRQ that modifies the original priority. */
mutex_priority_change_extension_selection = 2;
_tx_mutex_priority_change(&thread_0, 29);
#else
/* Set the flag to suspend the thread and test the first condition after internal resume is called. */
mutex_priority_change_extension_selection = 2;
threadx_mutex_suspension_priority_test = 1;
_tx_mutex_priority_change(&thread_0, 29);
_tx_thread_execute_ptr[0] = &thread_0;
#endif
#endif
#ifdef TX_MANUAL_TEST
@@ -348,12 +348,12 @@ UINT status;
mutex_priority_change_extension_selection = 3;
_tx_mutex_priority_change(&thread_0, 30);
#else
/* Set the flag to suspend the thread and test the first condition after internal resume is called. */
mutex_priority_change_extension_selection = 3;
threadx_mutex_suspension_priority_test = 1;
_tx_mutex_priority_change(&thread_0, 30);
#endif
#endif
#ifdef TX_MANUAL_TEST
@@ -363,14 +363,14 @@ UINT status;
_tx_mutex_priority_change(&thread_0, 31);
_tx_thread_preemption__threshold_scheduled = temp_thread;
#else
/* Set the flag to suspend the thread and test the first condition after internal resume is called. */
temp_thread = _tx_thread_preemption__threshold_scheduled;
mutex_priority_change_extension_selection = 4;
threadx_mutex_suspension_priority_test = 1;
_tx_mutex_priority_change(&thread_0, 31);
_tx_thread_preemption__threshold_scheduled = temp_thread;
#endif
#endif
/* Just change to same priority to ensure that path is executed. */
mutex_priority_change_extension_selection = 0;
@@ -378,18 +378,18 @@ UINT status;
thread_0.tx_thread_user_priority = 31;
thread_0.tx_thread_user_preempt_threshold = 30;
thread_0.tx_thread_priority = 31;
thread_0.tx_thread_preempt_threshold = 30;
thread_0.tx_thread_preempt_threshold = 30;
_tx_mutex_priority_change(&thread_0, 31);
thread_0.tx_thread_user_priority = 31;
thread_0.tx_thread_user_preempt_threshold = 31;
thread_0.tx_thread_priority = 31;
thread_0.tx_thread_preempt_threshold = 31;
thread_0.tx_thread_preempt_threshold = 31;
_tx_mutex_priority_change(&thread_0, 31);
tx_thread_resume(&thread_0);
/* Restore the preempt disable flag. */
/* Restore the preempt disable flag. */
_tx_thread_preempt_disable--;
/* Restore interrupts. */
TX_RESTORE
@@ -47,8 +47,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -60,8 +60,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -73,8 +73,8 @@ CHAR *pointer;
test_control_return(1);
}
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
status = tx_thread_create(&thread_2, "thread 2", thread_2_entry, 1,
pointer, TEST_STACK_SIZE_PRINTF,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -1,5 +1,5 @@
/* This test is designed to test immediate response queue services including create
and delete. This test is for queue sizes of 8 ULONG. Two queues are used one with
and delete. This test is for queue sizes of 8 ULONG. Two queues are used one with
a capacity of 1 message and another with a capacity of 3 messages. */
#include <stdio.h>
@@ -40,8 +40,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -111,9 +111,9 @@ ULONG expected_message[8];
printf("ERROR #4\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -163,9 +163,9 @@ ULONG expected_message[8];
printf("ERROR #8\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -218,7 +218,7 @@ ULONG expected_message[8];
status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
source_message[0]++;
source_message[7]++;
if (status != TX_SUCCESS)
{
@@ -227,9 +227,9 @@ ULONG expected_message[8];
printf("ERROR #12\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -320,9 +320,9 @@ ULONG expected_message[8];
printf("ERROR #18\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -1,5 +1,5 @@
/* This test is designed to test immediate response queue services including create
and delete. This test is for queue sizes of 4 ULONG. Two queues are used one with
and delete. This test is for queue sizes of 4 ULONG. Two queues are used one with
a capacity of 1 message and another with a capacity of 3 messages. */
#include <stdio.h>
@@ -40,8 +40,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -111,9 +111,9 @@ ULONG expected_message[4];
printf("ERROR #4\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -163,9 +163,9 @@ ULONG expected_message[4];
printf("ERROR #8\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -218,7 +218,7 @@ ULONG expected_message[4];
status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
source_message[0]++;
source_message[3]++;
if (status != TX_SUCCESS)
{
@@ -227,9 +227,9 @@ ULONG expected_message[4];
printf("ERROR #12\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -320,9 +320,9 @@ ULONG expected_message[4];
printf("ERROR #18\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -1,5 +1,5 @@
/* This test is designed to test immediate response queue services including create
and delete. This test is for queue sizes of 16 ULONG. Two queues are used one with
and delete. This test is for queue sizes of 16 ULONG. Two queues are used one with
a capacity of 1 message and another with a capacity of 3 messages. */
#include <stdio.h>
@@ -40,8 +40,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -110,9 +110,9 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE];
printf("ERROR #4\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -162,9 +162,9 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE];
printf("ERROR #8\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -217,7 +217,7 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE];
status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
source_message[0]++;
source_message[TX_QUEUE_MESSAGE_MAX_SIZE - 1]++;
if (status != TX_SUCCESS)
{
@@ -226,9 +226,9 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE];
printf("ERROR #12\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -319,9 +319,9 @@ ULONG expected_message[TX_QUEUE_MESSAGE_MAX_SIZE];
printf("ERROR #18\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -1,5 +1,5 @@
/* This test is designed to test immediate response queue services including create
and delete. This test is for queue sizes of 1 ULONG. Two queues are used one with
and delete. This test is for queue sizes of 1 ULONG. Two queues are used one with
a capacity of 1 message and another with a capacity of 3 messages. */
#include <stdio.h>
@@ -40,7 +40,7 @@ static void thread_0_entry(ULONG thread_input);
static void thread_1_entry(ULONG thread_input);
UINT _txe_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,
UINT _txe_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,
VOID *queue_start, ULONG queue_size, UINT queue_control_block_size);
@@ -65,7 +65,7 @@ ULONG destination;
/* Determine if calling queue create from initialization was successful. */
if (test_queue_from_init != TX_SUCCESS)
{
/* Error! */
error++;
}
@@ -84,7 +84,7 @@ ULONG destination;
/* Attempt to delete a queue from a timer. */
status = tx_queue_delete(&queue_0);
/* Check for status. */
if (status != TX_CALLER_ERROR)
{
@@ -95,7 +95,7 @@ ULONG destination;
/* Attempt to send something with suspension from a timer. */
status = tx_queue_front_send(&queue_0, &source, 100);
/* Check for status. */
if (status != TX_WAIT_ERROR)
{
@@ -106,7 +106,7 @@ ULONG destination;
/* Attempt to send something with suspension from a timer. */
status = tx_queue_send(&queue_0, &source, 100);
/* Check for status. */
if (status != TX_WAIT_ERROR)
{
@@ -117,7 +117,7 @@ ULONG destination;
/* Attempt to receive something with suspension from a timer. */
status = tx_queue_receive(&queue_0, &destination, 100);
/* Check for status. */
if (status != TX_WAIT_ERROR)
{
@@ -158,7 +158,7 @@ ULONG destination;
/* Attempt to delete a queue from an ISR. */
status = tx_queue_delete(&queue_0);
/* Check for status. */
if (status != TX_CALLER_ERROR)
{
@@ -169,7 +169,7 @@ ULONG destination;
/* Attempt to send something with suspension from an ISR. */
status = tx_queue_front_send(&queue_0, &source, 100);
/* Check for status. */
if (status != TX_WAIT_ERROR)
{
@@ -180,7 +180,7 @@ ULONG destination;
/* Attempt to send something with suspension from an ISR. */
status = tx_queue_send(&queue_0, &source, 100);
/* Check for status. */
if (status != TX_WAIT_ERROR)
{
@@ -191,7 +191,7 @@ ULONG destination;
/* Attempt to receive something with suspension from an ISR. */
status = tx_queue_receive(&queue_0, &destination, 100);
/* Check for status. */
if (status != TX_WAIT_ERROR)
{
@@ -224,13 +224,13 @@ 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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
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,
18, 18, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -380,7 +380,7 @@ CHAR *pointer;
/* Attempt to delete a NULL pointer. */
status = tx_queue_delete(TX_NULL);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -393,7 +393,7 @@ CHAR *pointer;
/* Attempt to delete a non-created queue. */
queue_2.tx_queue_id = 0;
status = tx_queue_delete(&queue_2);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -405,7 +405,7 @@ CHAR *pointer;
/* Attempt to flush a NULL pointer. */
status = tx_queue_flush(TX_NULL);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -418,7 +418,7 @@ CHAR *pointer;
/* Attempt to flush a non-created queue. */
queue_2.tx_queue_id = 0;
status = tx_queue_flush(&queue_2);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -430,7 +430,7 @@ CHAR *pointer;
/* Attempt to send something to the front of a non-queue. */
status = tx_queue_front_send(TX_NULL, &source_message, TX_NO_WAIT);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -439,11 +439,11 @@ CHAR *pointer;
printf("ERROR #15\n");
test_control_return(1);
}
/* Attempt to send something to the front of a non-created queue. */
queue_2.tx_queue_id = 0;
status = tx_queue_front_send(&queue_2, &source_message, TX_NO_WAIT);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -455,7 +455,7 @@ CHAR *pointer;
/* Attempt to send something with a NULL source pointer. */
status = tx_queue_front_send(&queue_0, TX_NULL, TX_NO_WAIT);
/* Check for status. */
if (status != TX_PTR_ERROR)
{
@@ -467,7 +467,7 @@ CHAR *pointer;
/* Attempt to send something to a non-queue. */
status = tx_queue_send(TX_NULL, &source_message, TX_NO_WAIT);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -476,11 +476,11 @@ CHAR *pointer;
printf("ERROR #18\n");
test_control_return(1);
}
/* Attempt to send something to a non-created queue. */
queue_2.tx_queue_id = 0;
status = tx_queue_send(&queue_2, &source_message, TX_NO_WAIT);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -492,7 +492,7 @@ CHAR *pointer;
/* Attempt to send something with a NULL source pointer. */
status = tx_queue_send(&queue_0, TX_NULL, TX_NO_WAIT);
/* Check for status. */
if (status != TX_PTR_ERROR)
{
@@ -504,7 +504,7 @@ CHAR *pointer;
/* Attempt to receive something from a non-queue. */
status = tx_queue_receive(TX_NULL, &dest_message, TX_NO_WAIT);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -517,7 +517,7 @@ CHAR *pointer;
/* Attempt to receive something from a non-created queue. */
queue_2.tx_queue_id = 0;
status = tx_queue_receive(&queue_2, &dest_message, TX_NO_WAIT);
/* Check for status. */
if (status != TX_QUEUE_ERROR)
{
@@ -529,7 +529,7 @@ CHAR *pointer;
/* Attempt to receive something to a NULL destination. */
status = tx_queue_receive(&queue_0, TX_NULL, TX_NO_WAIT);
/* Check for status. */
if (status != TX_PTR_ERROR)
{
@@ -550,9 +550,9 @@ CHAR *pointer;
printf("ERROR #24\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -602,7 +602,7 @@ CHAR *pointer;
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, &source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -649,7 +649,7 @@ CHAR *pointer;
source_message++;
status += tx_queue_send(&queue_1, &source_message, TX_NO_WAIT);
source_message++;
if (status != TX_SUCCESS)
{
@@ -657,9 +657,9 @@ CHAR *pointer;
printf("ERROR #32\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -735,9 +735,9 @@ CHAR *pointer;
printf("ERROR #38\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, &source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -810,7 +810,7 @@ CHAR *pointer;
/* Resume thread 1 so that we can take an interrupt on top of it. */
tx_thread_resume(&thread_1);
/* Sleep for a bit... */
tx_thread_sleep(3);
@@ -820,7 +820,7 @@ CHAR *pointer;
/* Test for error. */
if ((error) || (timer_executed != 1) || (isr_executed != 1))
{
/* Queue error. */
printf("ERROR #44\n");
test_control_return(1);
@@ -1,5 +1,5 @@
/* This test is designed to test immediate response queue services including create
and delete. This test is for queue sizes of 16 ULONG. Two queues are used one with
and delete. This test is for queue sizes of 16 ULONG. Two queues are used one with
a capacity of 1 message and another with a capacity of 3 messages. */
#include <stdio.h>
@@ -40,8 +40,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -111,9 +111,9 @@ ULONG expected_message[16];
printf("ERROR #4\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -163,9 +163,9 @@ ULONG expected_message[16];
printf("ERROR #8\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -218,7 +218,7 @@ ULONG expected_message[16];
status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
source_message[0]++;
source_message[15]++;
if (status != TX_SUCCESS)
{
@@ -227,9 +227,9 @@ ULONG expected_message[16];
printf("ERROR #12\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -320,9 +320,9 @@ ULONG expected_message[16];
printf("ERROR #18\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -1,5 +1,5 @@
/* This test is designed to test immediate response queue services including create
and delete. This test is for queue sizes of 2 ULONG. Two queues are used one with
and delete. This test is for queue sizes of 2 ULONG. Two queues are used one with
a capacity of 1 message and another with a capacity of 3 messages. */
#include <stdio.h>
@@ -54,8 +54,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -116,7 +116,7 @@ ULONG expected_message[2];
queue_memory.second_middle= 0x61718191;
queue_memory.next_to_last = 0x99aabbcc;
queue_memory.last = 0xddeeff00;
/* Create the queue. */
status = tx_queue_create(&queue_memory.queue, "queue memory", TX_2_ULONG, &queue_memory.queue_area[0], (2048*sizeof(ULONG))/sizeof(ULONG));
tx_queue_delete(&queue_memory.queue);
@@ -151,9 +151,9 @@ ULONG expected_message[2];
printf("ERROR #5\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -203,9 +203,9 @@ ULONG expected_message[2];
printf("ERROR #9\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_0, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -258,7 +258,7 @@ ULONG expected_message[2];
status += tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
source_message[0]++;
source_message[1]++;
if (status != TX_SUCCESS)
{
@@ -267,9 +267,9 @@ ULONG expected_message[2];
printf("ERROR #13\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -360,9 +360,9 @@ ULONG expected_message[2];
printf("ERROR #19\n");
test_control_return(1);
}
/* Attempt to place something on a full queue. */
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
status = tx_queue_send(&queue_1, source_message, TX_NO_WAIT);
/* Should be an error. */
if (status != TX_QUEUE_FULL)
@@ -54,8 +54,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,
16, 16, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -67,8 +67,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,
15, 15, 100, TX_AUTO_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -80,8 +80,8 @@ 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,
15, 15, 100, TX_DONT_START);
pointer = pointer + TEST_STACK_SIZE_PRINTF;
@@ -107,7 +107,7 @@ CHAR *pointer;
/* Setup queue send notification. */
status = tx_queue_send_notify(&queue_0, queue_notify);
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Check for status. */
@@ -117,7 +117,7 @@ CHAR *pointer;
printf("Running Queue Empty Suspension Test................................. ERROR #5\n");
test_control_return(1);
}
#else
/* Check for status. */
@@ -128,7 +128,7 @@ CHAR *pointer;
test_control_return(1);
}
#endif
#endif
}
@@ -193,12 +193,12 @@ ULONG source_message[2] = {0x12345678, 0};
/* Now resume thread 2 to get another thread suspended on an empty queue. */
tx_thread_resume(&thread_2);
/* Now send 2 messages to wakeup both threads! */
source_message[0]++;
status = tx_queue_send(&queue_0, &source_message[0], TX_NO_WAIT);
status += tx_queue_send(&queue_0, &source_message[0], TX_NO_WAIT);
/* Check status and run count of other thread - it should have got the
message already. */
if ((status != TX_SUCCESS) || (thread_1_counter != 2) || (thread_2_counter != 1))

Some files were not shown because too many files have changed in this diff Show More