Add support for architectures with stack alignment requirements in preparation for various 32 bit ports.

NOTE: The atomThreadCreate() and atmoOSInit() APIs have changed to take stack_bottom rather than stack_top and to allow optional stack-checking on a per-thread basis.
This commit is contained in:
Kelvin Lawson
2011-05-27 16:41:18 +01:00
parent 00d4e3f2af
commit af84aa9848
34 changed files with 203 additions and 177 deletions

View File

@@ -63,8 +63,8 @@ uint32_t test_start (void)
/* atomThreadCreate: Pass a bad TCB pointer */
if (atomThreadCreate (NULL, TEST_THREAD_PRIO, test_thread_func, 0,
&test_thread_stack[TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_ERR_PARAM)
&test_thread_stack[0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_ERR_PARAM)
{
ATOMLOG (_STR("Bad TCB check\n"));
failures++;
@@ -72,8 +72,8 @@ uint32_t test_start (void)
/* atomThreadCreate: Pass a bad entry point */
if (atomThreadCreate (&tcb1, TEST_THREAD_PRIO, NULL, 0,
&test_thread_stack[TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_ERR_PARAM)
&test_thread_stack[0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_ERR_PARAM)
{
ATOMLOG (_STR("Bad entry check\n"));
failures++;
@@ -81,7 +81,7 @@ uint32_t test_start (void)
/* atomThreadCreate: Pass a bad stack pointer */
if (atomThreadCreate (&tcb1, TEST_THREAD_PRIO, test_thread_func, 0,
NULL, TEST_THREAD_STACK_SIZE) != ATOM_ERR_PARAM)
NULL, TEST_THREAD_STACK_SIZE, TRUE) != ATOM_ERR_PARAM)
{
ATOMLOG (_STR("Bad stack ptr check\n"));
failures++;
@@ -89,7 +89,7 @@ uint32_t test_start (void)
/* atomThreadCreate: Pass a bad stack size */
if (atomThreadCreate (&tcb1, TEST_THREAD_PRIO, test_thread_func, 0,
&test_thread_stack[TEST_THREAD_STACK_SIZE - 1], 0) != ATOM_ERR_PARAM)
&test_thread_stack[0], 0, TRUE) != ATOM_ERR_PARAM)
{
ATOMLOG (_STR("Bad stack size check\n"));
failures++;

View File

@@ -95,8 +95,8 @@ uint32_t test_start (void)
/* Create low priority thread */
if (atomThreadCreate (&tcb[0], 253, test_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
ATOMLOG (_STR("Bad thread create\n"));
failures++;
@@ -104,8 +104,8 @@ uint32_t test_start (void)
/* Create high priority thread */
else if (atomThreadCreate (&tcb[1], 252, test_thread_func, 1,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
ATOMLOG (_STR("Bad thread create\n"));
failures++;

View File

@@ -97,29 +97,29 @@ uint32_t test_start (void)
* a spell in which this thread was run.
*/
if (atomThreadCreate (&tcb[0], TEST_THREAD_PRIO + 1, test_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
ATOMLOG (_STR("Bad thread create\n"));
failures++;
}
else if (atomThreadCreate (&tcb[1], TEST_THREAD_PRIO + 1, test_thread_func, 1,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
ATOMLOG (_STR("Bad thread create\n"));
failures++;
}
else if (atomThreadCreate (&tcb[2], TEST_THREAD_PRIO + 1, test_thread_func, 2,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
ATOMLOG (_STR("Bad thread create\n"));
failures++;
}
else if (atomThreadCreate (&tcb[3], TEST_THREAD_PRIO + 1, test_thread_func, 3,
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[3][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
ATOMLOG (_STR("Bad thread create\n"));
failures++;

View File

@@ -137,8 +137,8 @@ uint32_t test_start (void)
}
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));
@@ -200,8 +200,8 @@ uint32_t test_start (void)
}
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 2\n"));

View File

@@ -143,8 +143,8 @@ uint32_t test_start (void)
/* Create a test thread, the sole purpose of which is to own mutex2 */
g_owned = 0;
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));

View File

@@ -108,8 +108,8 @@ uint32_t test_start (void)
{
/* Create Thread 1 (lower priority thread A) */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -121,8 +121,8 @@ uint32_t test_start (void)
/* Create Thread 2 (lower priority thread B) */
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -134,8 +134,8 @@ uint32_t test_start (void)
/* Create Thread 3 (higher priority thread A) */
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -147,8 +147,8 @@ uint32_t test_start (void)
/* Create Thread 4 (higher priority thread B) */
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[3][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -288,4 +288,4 @@ static void test_thread_func (uint32_t param)
{
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
}
}
}

View File

@@ -101,8 +101,8 @@ uint32_t test_start (void)
/* Create Thread 1 */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -113,8 +113,8 @@ uint32_t test_start (void)
/* Create Thread 2 */
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -125,8 +125,8 @@ uint32_t test_start (void)
/* Create Thread 3 */
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -137,8 +137,8 @@ uint32_t test_start (void)
/* Create Thread 4 */
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[3][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -293,4 +293,4 @@ static void test_thread_func (uint32_t param)
{
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
}
}
}

View File

@@ -95,8 +95,8 @@ uint32_t test_start (void)
/* Create second thread */
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -299,4 +299,4 @@ static void test_thread_func (uint32_t param)
{
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
}
}
}

View File

@@ -100,8 +100,8 @@ uint32_t test_start (void)
/* Create second thread */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -290,4 +290,4 @@ static void test_thread_func (uint32_t param)
{
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
}
}
}

View File

@@ -93,8 +93,8 @@ uint32_t test_start (void)
/* Create second thread */
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -94,8 +94,8 @@ uint32_t test_start (void)
/* Create test thread 1 */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));
@@ -104,8 +104,8 @@ uint32_t test_start (void)
/* Create test thread 2 */
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 2\n"));
@@ -114,8 +114,8 @@ uint32_t test_start (void)
/* Create test thread 3 */
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 3\n"));

View File

@@ -88,8 +88,8 @@ uint32_t test_start (void)
/* Create second thread */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -90,8 +90,8 @@ uint32_t test_start (void)
/* Create a test thread that will block because the queue is empty */
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));
@@ -147,8 +147,8 @@ uint32_t test_start (void)
/* Create a test thread that will block because the queue is empty */
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 2\n"));

View File

@@ -107,8 +107,8 @@ uint32_t test_start (void)
/* Create a test thread that will block because the queue is full */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));
@@ -178,8 +178,8 @@ uint32_t test_start (void)
/* Create a test thread that will block because the queue is full */
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 2\n"));

View File

@@ -115,8 +115,8 @@ uint32_t test_start (void)
/* Create Thread 1 (lower priority thread A) */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -128,8 +128,8 @@ uint32_t test_start (void)
/* Create Thread 2 (lower priority thread B) */
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -141,8 +141,8 @@ uint32_t test_start (void)
/* Create Thread 3 (higher priority thread A) */
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -154,8 +154,8 @@ uint32_t test_start (void)
/* Create Thread 4 (higher priority thread B) */
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[3][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -107,8 +107,8 @@ uint32_t test_start (void)
/* Create a test thread that will block because the queue is empty */
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO + 1, test1_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));

View File

@@ -94,8 +94,8 @@ uint32_t test_start (void)
/* Create test thread 1 */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));
@@ -104,8 +104,8 @@ uint32_t test_start (void)
/* Create test thread 2 */
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 2\n"));
@@ -114,8 +114,8 @@ uint32_t test_start (void)
/* Create test thread 3 */
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 3\n"));

View File

@@ -103,8 +103,8 @@ uint32_t test_start (void)
{
/* Create Thread 1 */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -115,8 +115,8 @@ uint32_t test_start (void)
/* Create Thread 2 */
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -127,8 +127,8 @@ uint32_t test_start (void)
/* Create Thread 3 */
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -139,8 +139,8 @@ uint32_t test_start (void)
/* Create Thread 4 */
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[3][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -133,8 +133,8 @@ uint32_t test_start (void)
}
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));
@@ -200,8 +200,8 @@ uint32_t test_start (void)
failures++;
}
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 2\n"));

View File

@@ -103,8 +103,8 @@ uint32_t test_start (void)
{
/* Create Thread 1 (lower priority thread A) */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -116,8 +116,8 @@ uint32_t test_start (void)
/* Create Thread 2 (lower priority thread B) */
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -129,8 +129,8 @@ uint32_t test_start (void)
/* Create Thread 3 (higher priority thread A) */
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -142,8 +142,8 @@ uint32_t test_start (void)
/* Create Thread 4 (higher priority thread B) */
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[3][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -97,8 +97,8 @@ uint32_t test_start (void)
{
/* Create Thread 1 */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -109,8 +109,8 @@ uint32_t test_start (void)
/* Create Thread 2 */
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -121,8 +121,8 @@ uint32_t test_start (void)
/* Create Thread 3 */
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));
@@ -133,8 +133,8 @@ uint32_t test_start (void)
/* Create Thread 4 */
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[3][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -84,8 +84,8 @@ uint32_t test_start (void)
{
/* Create second thread */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -94,8 +94,8 @@ uint32_t test_start (void)
/* Create second thread */
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -100,8 +100,8 @@ uint32_t test_start (void)
/* Create second thread */
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread\n"));

View File

@@ -110,8 +110,8 @@ uint32_t test_start (void)
/* Create thread 1: Higher priority than main thread so should sleep */
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO - 1, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));
@@ -120,8 +120,8 @@ uint32_t test_start (void)
/* Create thread 2: Same priority as main thread so should not sleep */
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 0,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 2\n"));
@@ -130,8 +130,8 @@ uint32_t test_start (void)
/* Create thread 3: Same priority as main thread so should not sleep */
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO + 1, test_thread_func, 0,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 3\n"));

View File

@@ -87,8 +87,8 @@ uint32_t test_start (void)
{
/* Create test thread 1 */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 1\n"));
@@ -97,8 +97,8 @@ uint32_t test_start (void)
/* Create test thread 2 */
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 2\n"));
@@ -107,8 +107,8 @@ uint32_t test_start (void)
/* Create test thread 3 */
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Error creating test thread 3\n"));

View File

@@ -73,8 +73,8 @@ uint32_t test_start (void)
/* Create Thread 1 */
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[0][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Thread1\n"));
@@ -83,8 +83,8 @@ uint32_t test_start (void)
/* Create Thread 2 */
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[1][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Thread2\n"));
@@ -93,8 +93,8 @@ uint32_t test_start (void)
/* Create Thread 3 */
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
TEST_THREAD_STACK_SIZE) != ATOM_OK)
&test_thread_stack[2][0],
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
{
/* Fail */
ATOMLOG (_STR("Thread3\n"));