mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-04-18 01:39:05 +02:00
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:
@@ -62,7 +62,7 @@ typedef struct atom_tcb
|
|||||||
|
|
||||||
/* Details used if thread stack-checking is required */
|
/* Details used if thread stack-checking is required */
|
||||||
#ifdef ATOM_STACK_CHECKING
|
#ifdef ATOM_STACK_CHECKING
|
||||||
POINTER stack_top; /* Pointer to top of stack allocation */
|
POINTER stack_bottom; /* Pointer to bottom of stack allocation */
|
||||||
uint32_t stack_size; /* Size of stack allocation in bytes */
|
uint32_t stack_size; /* Size of stack allocation in bytes */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ extern uint8_t atomOSStarted;
|
|||||||
|
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
extern uint8_t atomOSInit (void *idle_thread_stack_top, uint32_t stack_size);
|
extern uint8_t atomOSInit (void *idle_thread_stack_bottom, uint32_t idle_thread_stack_size, uint8_t idle_thread_stack_check);
|
||||||
extern void atomOSStart (void);
|
extern void atomOSStart (void);
|
||||||
|
|
||||||
extern void atomSched (uint8_t timer_tick);
|
extern void atomSched (uint8_t timer_tick);
|
||||||
@@ -113,7 +113,7 @@ extern ATOM_TCB *tcbDequeuePriority (ATOM_TCB **tcb_queue_ptr, uint8_t priority)
|
|||||||
|
|
||||||
extern ATOM_TCB *atomCurrentContext (void);
|
extern ATOM_TCB *atomCurrentContext (void);
|
||||||
|
|
||||||
extern uint8_t atomThreadCreate (ATOM_TCB *tcb_ptr, uint8_t priority, void (*entry_point)(uint32_t), uint32_t entry_param, void *stack_top, uint32_t stack_size);
|
extern uint8_t atomThreadCreate (ATOM_TCB *tcb_ptr, uint8_t priority, void (*entry_point)(uint32_t), uint32_t entry_param, void *stack_bottom, uint32_t stack_size, uint8_t stack_check);
|
||||||
extern uint8_t atomThreadStackCheck (ATOM_TCB *tcb_ptr, uint32_t *used_bytes, uint32_t *free_bytes);
|
extern uint8_t atomThreadStackCheck (ATOM_TCB *tcb_ptr, uint32_t *used_bytes, uint32_t *free_bytes);
|
||||||
|
|
||||||
extern void archContextSwitch (ATOM_TCB *old_tcb_ptr, ATOM_TCB *new_tcb_ptr);
|
extern void archContextSwitch (ATOM_TCB *old_tcb_ptr, ATOM_TCB *new_tcb_ptr);
|
||||||
|
|||||||
@@ -369,25 +369,31 @@ static void atomThreadSwitch(ATOM_TCB *old_tcb, ATOM_TCB *new_tcb)
|
|||||||
* new thread may be scheduled in before the function returns.
|
* new thread may be scheduled in before the function returns.
|
||||||
*
|
*
|
||||||
* Optionally prefills the thread stack with a known value to enable stack
|
* Optionally prefills the thread stack with a known value to enable stack
|
||||||
* usage checking (if the ATOM_STACK_CHECKING macro is defined).
|
* usage checking (if the ATOM_STACK_CHECKING macro is defined and
|
||||||
|
* stack_check parameter is set to TRUE).
|
||||||
*
|
*
|
||||||
* @param[in] tcb_ptr Pointer to the thread's TCB storage
|
* @param[in] tcb_ptr Pointer to the thread's TCB storage
|
||||||
* @param[in] priority Priority of the thread (0 to 255)
|
* @param[in] priority Priority of the thread (0 to 255)
|
||||||
* @param[in] entry_point Thread entry point
|
* @param[in] entry_point Thread entry point
|
||||||
* @param[in] entry_param Parameter passed to thread entry point
|
* @param[in] entry_param Parameter passed to thread entry point
|
||||||
* @param[in] stack_top Top of the stack area
|
* @param[in] stack_bottom Bottom of the stack area
|
||||||
* @param[in] stack_size Size of the stack area in bytes
|
* @param[in] stack_size Size of the stack area in bytes
|
||||||
|
* @param[in] stack_check TRUE to enable stack checking for this thread
|
||||||
*
|
*
|
||||||
* @retval ATOM_OK Success
|
* @retval ATOM_OK Success
|
||||||
* @retval ATOM_ERR_PARAM Bad parameters
|
* @retval ATOM_ERR_PARAM Bad parameters
|
||||||
* @retval ATOM_ERR_QUEUE Error putting the thread on the ready queue
|
* @retval ATOM_ERR_QUEUE Error putting the thread on the ready queue
|
||||||
*/
|
*/
|
||||||
uint8_t atomThreadCreate (ATOM_TCB *tcb_ptr, uint8_t priority, void (*entry_point)(uint32_t), uint32_t entry_param, void *stack_top, uint32_t stack_size)
|
uint8_t atomThreadCreate (ATOM_TCB *tcb_ptr, uint8_t priority, void (*entry_point)(uint32_t), uint32_t entry_param, void *stack_bottom, uint32_t stack_size, uint8_t stack_check)
|
||||||
{
|
{
|
||||||
CRITICAL_STORE;
|
CRITICAL_STORE;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
uint8_t *stack_top;
|
||||||
|
#ifdef ATOM_STACK_CHECKING
|
||||||
|
int32_t count;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((tcb_ptr == NULL) || (entry_point == NULL) || (stack_top == NULL)
|
if ((tcb_ptr == NULL) || (entry_point == NULL) || (stack_bottom == NULL)
|
||||||
|| (stack_size == 0))
|
|| (stack_size == 0))
|
||||||
{
|
{
|
||||||
/* Bad parameters */
|
/* Bad parameters */
|
||||||
@@ -411,6 +417,13 @@ uint8_t atomThreadCreate (ATOM_TCB *tcb_ptr, uint8_t priority, void (*entry_poin
|
|||||||
tcb_ptr->entry_point = entry_point;
|
tcb_ptr->entry_point = entry_point;
|
||||||
tcb_ptr->entry_param = entry_param;
|
tcb_ptr->entry_param = entry_param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate a pointer to the topmost stack entry, suitably aligned
|
||||||
|
* for the architecture. This may discard the top few bytes if the
|
||||||
|
* stack size is not a multiple of the stack entry/alignment size.
|
||||||
|
*/
|
||||||
|
stack_top = (uint8_t *)stack_bottom + (stack_size & ~(STACK_ALIGN_SIZE - 1)) - STACK_ALIGN_SIZE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional processing only required if stack-checking is
|
* Additional processing only required if stack-checking is
|
||||||
* enabled. Incurs a slight overhead on each thread creation
|
* enabled. Incurs a slight overhead on each thread creation
|
||||||
@@ -418,25 +431,29 @@ uint8_t atomThreadCreate (ATOM_TCB *tcb_ptr, uint8_t priority, void (*entry_poin
|
|||||||
* compiled out if not desired.
|
* compiled out if not desired.
|
||||||
*/
|
*/
|
||||||
#ifdef ATOM_STACK_CHECKING
|
#ifdef ATOM_STACK_CHECKING
|
||||||
|
/* Set up stack-checking if enabled for this thread */
|
||||||
/* Store the stack details for use by the stack-check function */
|
if (stack_check)
|
||||||
tcb_ptr->stack_top = stack_top;
|
|
||||||
tcb_ptr->stack_size = stack_size;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prefill the stack with a known value. This is used later in
|
|
||||||
* calls to atomThreadStackCheck() to get an indication of how
|
|
||||||
* much stack has been used during runtime.
|
|
||||||
*/
|
|
||||||
while (stack_size > 0)
|
|
||||||
{
|
{
|
||||||
/* Initialise all stack bytes from bottom up to 0x5A */
|
/* Store the stack details for use by the stack-check function */
|
||||||
*((uint8_t *)stack_top - (stack_size - 1)) = STACK_CHECK_BYTE;
|
tcb_ptr->stack_bottom = stack_bottom;
|
||||||
stack_size--;
|
tcb_ptr->stack_size = stack_size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefill the stack with a known value. This is used later in
|
||||||
|
* calls to atomThreadStackCheck() to get an indication of how
|
||||||
|
* much stack has been used during runtime.
|
||||||
|
*/
|
||||||
|
count = (int32_t)stack_size;
|
||||||
|
while (count > 0)
|
||||||
|
{
|
||||||
|
/* Initialise all stack bytes from top down to 0x5A */
|
||||||
|
*((uint8_t *)stack_bottom + (count - 1)) = STACK_CHECK_BYTE;
|
||||||
|
count--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* Avoid compiler warnings due to unused stack_size variable */
|
/* Avoid compiler warning due to unused parameter */
|
||||||
stack_size = stack_size;
|
stack_check = stack_check;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -528,10 +545,10 @@ uint8_t atomThreadStackCheck (ATOM_TCB *tcb_ptr, uint32_t *used_bytes, uint32_t
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Starting at the far end, count the unmodified areas until a
|
* Starting at the bottom end, count the unmodified areas until a
|
||||||
* modified byte is found.
|
* modified byte is found.
|
||||||
*/
|
*/
|
||||||
stack_ptr = (uint8_t *)tcb_ptr->stack_top - (tcb_ptr->stack_size - 1);
|
stack_ptr = (uint8_t *)tcb_ptr->stack_bottom;
|
||||||
for (i = 0; i < tcb_ptr->stack_size; i++)
|
for (i = 0; i < tcb_ptr->stack_size; i++)
|
||||||
{
|
{
|
||||||
/* Loop until a modified byte is found */
|
/* Loop until a modified byte is found */
|
||||||
@@ -647,13 +664,14 @@ ATOM_TCB *atomCurrentContext (void)
|
|||||||
* operating system facilities are being initialised. They are normally
|
* operating system facilities are being initialised. They are normally
|
||||||
* enabled by the archFirstThreadRestore() routine in the architecture port.
|
* enabled by the archFirstThreadRestore() routine in the architecture port.
|
||||||
*
|
*
|
||||||
* @param[in] idle_thread_stack_top Ptr to top of stack area for idle thread
|
* @param[in] idle_thread_stack_bottom Ptr to bottom of stack for idle thread
|
||||||
* @param[in] idle_thread_stack_size Size of idle thread stack in bytes
|
* @param[in] idle_thread_stack_size Size of idle thread stack in bytes
|
||||||
|
* @param[in] idle_thread_stack_check TRUE if stack checking required on idle thread
|
||||||
*
|
*
|
||||||
* @retval ATOM_OK Success
|
* @retval ATOM_OK Success
|
||||||
* @retval ATOM_ERROR Initialisation error
|
* @retval ATOM_ERROR Initialisation error
|
||||||
*/
|
*/
|
||||||
uint8_t atomOSInit (void *idle_thread_stack_top, uint32_t idle_thread_stack_size)
|
uint8_t atomOSInit (void *idle_thread_stack_bottom, uint32_t idle_thread_stack_size, uint8_t idle_thread_stack_check)
|
||||||
{
|
{
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
@@ -667,8 +685,9 @@ uint8_t atomOSInit (void *idle_thread_stack_top, uint32_t idle_thread_stack_size
|
|||||||
IDLE_THREAD_PRIORITY,
|
IDLE_THREAD_PRIORITY,
|
||||||
atomIdleThread,
|
atomIdleThread,
|
||||||
0,
|
0,
|
||||||
idle_thread_stack_top,
|
idle_thread_stack_bottom,
|
||||||
idle_thread_stack_size);
|
idle_thread_stack_size,
|
||||||
|
idle_thread_stack_check);
|
||||||
|
|
||||||
/* Return status */
|
/* Return status */
|
||||||
return (status);
|
return (status);
|
||||||
|
|||||||
@@ -41,6 +41,9 @@
|
|||||||
*/
|
*/
|
||||||
#define NULL ((void *)(0))
|
#define NULL ((void *)(0))
|
||||||
|
|
||||||
|
/* Size of each stack entry / stack alignment size (e.g. 8 bits) */
|
||||||
|
#define STACK_ALIGN_SIZE sizeof(unsigned char)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Architecture-specific types.
|
* Architecture-specific types.
|
||||||
* Uses the stdint.h naming convention, so if stdint.h is available on the
|
* Uses the stdint.h naming convention, so if stdint.h is available on the
|
||||||
|
|||||||
@@ -43,6 +43,8 @@
|
|||||||
/* Required number of system ticks per second (normally 100 for 10ms tick) */
|
/* Required number of system ticks per second (normally 100 for 10ms tick) */
|
||||||
#define SYSTEM_TICKS_PER_SEC 100
|
#define SYSTEM_TICKS_PER_SEC 100
|
||||||
|
|
||||||
|
/* Size of each stack entry / stack alignment size (8 bits on AVR) */
|
||||||
|
#define STACK_ALIGN_SIZE sizeof(uint8_t)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Architecture-specific types.
|
* Architecture-specific types.
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
* stack for application code local variables etc.
|
* stack for application code local variables etc.
|
||||||
*
|
*
|
||||||
* With all OS tests implemented to date on the AVR, the Main thread
|
* With all OS tests implemented to date on the AVR, the Main thread
|
||||||
* stack has not exceeded 198 bytes. To allow all tests to run we set
|
* stack has not exceeded 201 bytes. To allow all tests to run we set
|
||||||
* a minimum main thread stack size of 204 bytes. This may increase in
|
* a minimum main thread stack size of 204 bytes. This may increase in
|
||||||
* future as the codebase changes but for the time being is enough to
|
* future as the codebase changes but for the time being is enough to
|
||||||
* cope with all of the automated tests.
|
* cope with all of the automated tests.
|
||||||
@@ -167,17 +167,15 @@ int main ( void )
|
|||||||
/**
|
/**
|
||||||
* Initialise the OS before creating our threads.
|
* Initialise the OS before creating our threads.
|
||||||
*
|
*
|
||||||
* Note that we tell the OS that the idle stack is half its actual
|
* Note that we cannot enable stack-checking on the idle thread on
|
||||||
* size. This prevents it prefilling the bottom half with known
|
* this platform because we are already using part of the idle
|
||||||
* values for stack-checkig purposes, which we cannot allow because
|
* thread's stack now as our startup stack. Prefilling for stack
|
||||||
* we are temporarily using it for our own stack. The remainder will
|
* checking would overwrite our current stack.
|
||||||
* still be available once the OS is started, this only prevents the
|
|
||||||
* OS from prefilling it.
|
|
||||||
*
|
*
|
||||||
* If you are not reusing the idle thread's stack during startup then
|
* If you are not reusing the idle thread's stack during startup then
|
||||||
* you should pass in the correct size here.
|
* you are free to enable stack-checking here.
|
||||||
*/
|
*/
|
||||||
status = atomOSInit(&idle_thread_stack[IDLE_STACK_SIZE_BYTES - 1], (IDLE_STACK_SIZE_BYTES/2));
|
status = atomOSInit(&idle_thread_stack[0], IDLE_STACK_SIZE_BYTES, FALSE);
|
||||||
if (status == ATOM_OK)
|
if (status == ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Enable the system tick timer */
|
/* Enable the system tick timer */
|
||||||
@@ -186,8 +184,9 @@ int main ( void )
|
|||||||
/* Create an application thread */
|
/* Create an application thread */
|
||||||
status = atomThreadCreate(&main_tcb,
|
status = atomThreadCreate(&main_tcb,
|
||||||
TEST_THREAD_PRIO, main_thread_func, 0,
|
TEST_THREAD_PRIO, main_thread_func, 0,
|
||||||
&main_thread_stack[MAIN_STACK_SIZE_BYTES - 1],
|
&main_thread_stack[0],
|
||||||
MAIN_STACK_SIZE_BYTES);
|
MAIN_STACK_SIZE_BYTES,
|
||||||
|
TRUE);
|
||||||
if (status == ATOM_OK)
|
if (status == ATOM_OK)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
/* Required number of system ticks per second (normally 100 for 10ms tick) */
|
/* Required number of system ticks per second (normally 100 for 10ms tick) */
|
||||||
#define SYSTEM_TICKS_PER_SEC 100
|
#define SYSTEM_TICKS_PER_SEC 100
|
||||||
|
|
||||||
|
/* Size of each stack entry / stack alignment size (8 bits on STM8) */
|
||||||
|
#define STACK_ALIGN_SIZE sizeof(u8)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Architecture-specific types.
|
* Architecture-specific types.
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ NO_REG_SAVE void main ( void )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Initialise the OS before creating our threads */
|
/* Initialise the OS before creating our threads */
|
||||||
status = atomOSInit(&idle_thread_stack[IDLE_STACK_SIZE_BYTES - 1], IDLE_STACK_SIZE_BYTES);
|
status = atomOSInit(&idle_thread_stack[0], IDLE_STACK_SIZE_BYTES, TRUE);
|
||||||
if (status == ATOM_OK)
|
if (status == ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Enable the system tick timer */
|
/* Enable the system tick timer */
|
||||||
@@ -148,8 +148,9 @@ NO_REG_SAVE void main ( void )
|
|||||||
/* Create an application thread */
|
/* Create an application thread */
|
||||||
status = atomThreadCreate(&main_tcb,
|
status = atomThreadCreate(&main_tcb,
|
||||||
TEST_THREAD_PRIO, main_thread_func, 0,
|
TEST_THREAD_PRIO, main_thread_func, 0,
|
||||||
&main_thread_stack[MAIN_STACK_SIZE_BYTES - 1],
|
&main_thread_stack[0],
|
||||||
MAIN_STACK_SIZE_BYTES);
|
MAIN_STACK_SIZE_BYTES,
|
||||||
|
TRUE);
|
||||||
if (status == ATOM_OK)
|
if (status == ATOM_OK)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* atomThreadCreate: Pass a bad TCB pointer */
|
/* atomThreadCreate: Pass a bad TCB pointer */
|
||||||
if (atomThreadCreate (NULL, TEST_THREAD_PRIO, test_thread_func, 0,
|
if (atomThreadCreate (NULL, TEST_THREAD_PRIO, test_thread_func, 0,
|
||||||
&test_thread_stack[TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_ERR_PARAM)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_ERR_PARAM)
|
||||||
{
|
{
|
||||||
ATOMLOG (_STR("Bad TCB check\n"));
|
ATOMLOG (_STR("Bad TCB check\n"));
|
||||||
failures++;
|
failures++;
|
||||||
@@ -72,8 +72,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* atomThreadCreate: Pass a bad entry point */
|
/* atomThreadCreate: Pass a bad entry point */
|
||||||
if (atomThreadCreate (&tcb1, TEST_THREAD_PRIO, NULL, 0,
|
if (atomThreadCreate (&tcb1, TEST_THREAD_PRIO, NULL, 0,
|
||||||
&test_thread_stack[TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_ERR_PARAM)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_ERR_PARAM)
|
||||||
{
|
{
|
||||||
ATOMLOG (_STR("Bad entry check\n"));
|
ATOMLOG (_STR("Bad entry check\n"));
|
||||||
failures++;
|
failures++;
|
||||||
@@ -81,7 +81,7 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* atomThreadCreate: Pass a bad stack pointer */
|
/* atomThreadCreate: Pass a bad stack pointer */
|
||||||
if (atomThreadCreate (&tcb1, TEST_THREAD_PRIO, test_thread_func, 0,
|
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"));
|
ATOMLOG (_STR("Bad stack ptr check\n"));
|
||||||
failures++;
|
failures++;
|
||||||
@@ -89,7 +89,7 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* atomThreadCreate: Pass a bad stack size */
|
/* atomThreadCreate: Pass a bad stack size */
|
||||||
if (atomThreadCreate (&tcb1, TEST_THREAD_PRIO, test_thread_func, 0,
|
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"));
|
ATOMLOG (_STR("Bad stack size check\n"));
|
||||||
failures++;
|
failures++;
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create low priority thread */
|
/* Create low priority thread */
|
||||||
if (atomThreadCreate (&tcb[0], 253, test_thread_func, 0,
|
if (atomThreadCreate (&tcb[0], 253, test_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
ATOMLOG (_STR("Bad thread create\n"));
|
ATOMLOG (_STR("Bad thread create\n"));
|
||||||
failures++;
|
failures++;
|
||||||
@@ -104,8 +104,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create high priority thread */
|
/* Create high priority thread */
|
||||||
else if (atomThreadCreate (&tcb[1], 252, test_thread_func, 1,
|
else if (atomThreadCreate (&tcb[1], 252, test_thread_func, 1,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
ATOMLOG (_STR("Bad thread create\n"));
|
ATOMLOG (_STR("Bad thread create\n"));
|
||||||
failures++;
|
failures++;
|
||||||
|
|||||||
@@ -97,29 +97,29 @@ uint32_t test_start (void)
|
|||||||
* a spell in which this thread was run.
|
* a spell in which this thread was run.
|
||||||
*/
|
*/
|
||||||
if (atomThreadCreate (&tcb[0], TEST_THREAD_PRIO + 1, test_thread_func, 0,
|
if (atomThreadCreate (&tcb[0], TEST_THREAD_PRIO + 1, test_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
ATOMLOG (_STR("Bad thread create\n"));
|
ATOMLOG (_STR("Bad thread create\n"));
|
||||||
failures++;
|
failures++;
|
||||||
}
|
}
|
||||||
else if (atomThreadCreate (&tcb[1], TEST_THREAD_PRIO + 1, test_thread_func, 1,
|
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[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
ATOMLOG (_STR("Bad thread create\n"));
|
ATOMLOG (_STR("Bad thread create\n"));
|
||||||
failures++;
|
failures++;
|
||||||
}
|
}
|
||||||
else if (atomThreadCreate (&tcb[2], TEST_THREAD_PRIO + 1, test_thread_func, 2,
|
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[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
ATOMLOG (_STR("Bad thread create\n"));
|
ATOMLOG (_STR("Bad thread create\n"));
|
||||||
failures++;
|
failures++;
|
||||||
}
|
}
|
||||||
else if (atomThreadCreate (&tcb[3], TEST_THREAD_PRIO + 1, test_thread_func, 3,
|
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[3][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
ATOMLOG (_STR("Bad thread create\n"));
|
ATOMLOG (_STR("Bad thread create\n"));
|
||||||
failures++;
|
failures++;
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ uint32_t test_start (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
|
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
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,
|
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 2\n"));
|
ATOMLOG (_STR("Error creating test thread 2\n"));
|
||||||
|
|||||||
@@ -143,8 +143,8 @@ uint32_t test_start (void)
|
|||||||
/* Create a test thread, the sole purpose of which is to own mutex2 */
|
/* Create a test thread, the sole purpose of which is to own mutex2 */
|
||||||
g_owned = 0;
|
g_owned = 0;
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
ATOMLOG (_STR("Error creating test thread 1\n"));
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ uint32_t test_start (void)
|
|||||||
{
|
{
|
||||||
/* Create Thread 1 (lower priority thread A) */
|
/* Create Thread 1 (lower priority thread A) */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -121,8 +121,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 2 (lower priority thread B) */
|
/* Create Thread 2 (lower priority thread B) */
|
||||||
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
|
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -134,8 +134,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 3 (higher priority thread A) */
|
/* Create Thread 3 (higher priority thread A) */
|
||||||
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -147,8 +147,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 4 (higher priority thread B) */
|
/* Create Thread 4 (higher priority thread B) */
|
||||||
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
||||||
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[3][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -288,4 +288,4 @@ static void test_thread_func (uint32_t param)
|
|||||||
{
|
{
|
||||||
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
|
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 1 */
|
/* Create Thread 1 */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -113,8 +113,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 2 */
|
/* Create Thread 2 */
|
||||||
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
|
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -125,8 +125,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 3 */
|
/* Create Thread 3 */
|
||||||
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -137,8 +137,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 4 */
|
/* Create Thread 4 */
|
||||||
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
||||||
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[3][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -293,4 +293,4 @@ static void test_thread_func (uint32_t param)
|
|||||||
{
|
{
|
||||||
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
|
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create second thread */
|
/* Create second thread */
|
||||||
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -299,4 +299,4 @@ static void test_thread_func (uint32_t param)
|
|||||||
{
|
{
|
||||||
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
|
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create second thread */
|
/* Create second thread */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -290,4 +290,4 @@ static void test_thread_func (uint32_t param)
|
|||||||
{
|
{
|
||||||
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
|
atomTimerDelay (SYSTEM_TICKS_PER_SEC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create second thread */
|
/* Create second thread */
|
||||||
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create test thread 1 */
|
/* Create test thread 1 */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
ATOMLOG (_STR("Error creating test thread 1\n"));
|
||||||
@@ -104,8 +104,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create test thread 2 */
|
/* Create test thread 2 */
|
||||||
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
|
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 2\n"));
|
ATOMLOG (_STR("Error creating test thread 2\n"));
|
||||||
@@ -114,8 +114,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create test thread 3 */
|
/* Create test thread 3 */
|
||||||
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
|
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 3\n"));
|
ATOMLOG (_STR("Error creating test thread 3\n"));
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create second thread */
|
/* Create second thread */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create a test thread that will block because the queue is empty */
|
/* Create a test thread that will block because the queue is empty */
|
||||||
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
|
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
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 */
|
/* Create a test thread that will block because the queue is empty */
|
||||||
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
|
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 2\n"));
|
ATOMLOG (_STR("Error creating test thread 2\n"));
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create a test thread that will block because the queue is full */
|
/* Create a test thread that will block because the queue is full */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
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 */
|
/* Create a test thread that will block because the queue is full */
|
||||||
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
|
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 2\n"));
|
ATOMLOG (_STR("Error creating test thread 2\n"));
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 1 (lower priority thread A) */
|
/* Create Thread 1 (lower priority thread A) */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -128,8 +128,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 2 (lower priority thread B) */
|
/* Create Thread 2 (lower priority thread B) */
|
||||||
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
|
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -141,8 +141,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 3 (higher priority thread A) */
|
/* Create Thread 3 (higher priority thread A) */
|
||||||
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -154,8 +154,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 4 (higher priority thread B) */
|
/* Create Thread 4 (higher priority thread B) */
|
||||||
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
||||||
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[3][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create a test thread that will block because the queue is empty */
|
/* 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,
|
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[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
ATOMLOG (_STR("Error creating test thread 1\n"));
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create test thread 1 */
|
/* Create test thread 1 */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
ATOMLOG (_STR("Error creating test thread 1\n"));
|
||||||
@@ -104,8 +104,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create test thread 2 */
|
/* Create test thread 2 */
|
||||||
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
|
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 2\n"));
|
ATOMLOG (_STR("Error creating test thread 2\n"));
|
||||||
@@ -114,8 +114,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create test thread 3 */
|
/* Create test thread 3 */
|
||||||
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
|
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 3\n"));
|
ATOMLOG (_STR("Error creating test thread 3\n"));
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ uint32_t test_start (void)
|
|||||||
{
|
{
|
||||||
/* Create Thread 1 */
|
/* Create Thread 1 */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -115,8 +115,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 2 */
|
/* Create Thread 2 */
|
||||||
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
|
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -127,8 +127,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 3 */
|
/* Create Thread 3 */
|
||||||
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -139,8 +139,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 4 */
|
/* Create Thread 4 */
|
||||||
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
||||||
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[3][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
@@ -133,8 +133,8 @@ uint32_t test_start (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
|
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test1_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
ATOMLOG (_STR("Error creating test thread 1\n"));
|
||||||
@@ -200,8 +200,8 @@ uint32_t test_start (void)
|
|||||||
failures++;
|
failures++;
|
||||||
}
|
}
|
||||||
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
|
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test2_thread_func, 0,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 2\n"));
|
ATOMLOG (_STR("Error creating test thread 2\n"));
|
||||||
|
|||||||
16
tests/sem3.c
16
tests/sem3.c
@@ -103,8 +103,8 @@ uint32_t test_start (void)
|
|||||||
{
|
{
|
||||||
/* Create Thread 1 (lower priority thread A) */
|
/* Create Thread 1 (lower priority thread A) */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO+1, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -116,8 +116,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 2 (lower priority thread B) */
|
/* Create Thread 2 (lower priority thread B) */
|
||||||
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
|
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO+1, test_thread_func, 2,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -129,8 +129,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 3 (higher priority thread A) */
|
/* Create Thread 3 (higher priority thread A) */
|
||||||
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -142,8 +142,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 4 (higher priority thread B) */
|
/* Create Thread 4 (higher priority thread B) */
|
||||||
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
||||||
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[3][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
16
tests/sem4.c
16
tests/sem4.c
@@ -97,8 +97,8 @@ uint32_t test_start (void)
|
|||||||
{
|
{
|
||||||
/* Create Thread 1 */
|
/* Create Thread 1 */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -109,8 +109,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 2 */
|
/* Create Thread 2 */
|
||||||
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
|
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -121,8 +121,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 3 */
|
/* Create Thread 3 */
|
||||||
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
@@ -133,8 +133,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 4 */
|
/* Create Thread 4 */
|
||||||
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
if (atomThreadCreate(&tcb[3], TEST_THREAD_PRIO, test_thread_func, 4,
|
||||||
&test_thread_stack[3][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[3][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ uint32_t test_start (void)
|
|||||||
{
|
{
|
||||||
/* Create second thread */
|
/* Create second thread */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create second thread */
|
/* Create second thread */
|
||||||
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create second thread */
|
/* Create second thread */
|
||||||
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread\n"));
|
ATOMLOG (_STR("Error creating test thread\n"));
|
||||||
|
|||||||
12
tests/sem8.c
12
tests/sem8.c
@@ -110,8 +110,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create thread 1: Higher priority than main thread so should sleep */
|
/* Create thread 1: Higher priority than main thread so should sleep */
|
||||||
else if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO - 1, test_thread_func, 1,
|
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[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
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 */
|
/* Create thread 2: Same priority as main thread so should not sleep */
|
||||||
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 0,
|
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 0,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 2\n"));
|
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 */
|
/* 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,
|
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[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 3\n"));
|
ATOMLOG (_STR("Error creating test thread 3\n"));
|
||||||
|
|||||||
12
tests/sem9.c
12
tests/sem9.c
@@ -87,8 +87,8 @@ uint32_t test_start (void)
|
|||||||
{
|
{
|
||||||
/* Create test thread 1 */
|
/* Create test thread 1 */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 0,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 1\n"));
|
ATOMLOG (_STR("Error creating test thread 1\n"));
|
||||||
@@ -97,8 +97,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create test thread 2 */
|
/* Create test thread 2 */
|
||||||
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
|
else if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 2\n"));
|
ATOMLOG (_STR("Error creating test thread 2\n"));
|
||||||
@@ -107,8 +107,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create test thread 3 */
|
/* Create test thread 3 */
|
||||||
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
|
else if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 2,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Error creating test thread 3\n"));
|
ATOMLOG (_STR("Error creating test thread 3\n"));
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 1 */
|
/* Create Thread 1 */
|
||||||
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
if (atomThreadCreate(&tcb[0], TEST_THREAD_PRIO, test_thread_func, 1,
|
||||||
&test_thread_stack[0][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[0][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Thread1\n"));
|
ATOMLOG (_STR("Thread1\n"));
|
||||||
@@ -83,8 +83,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 2 */
|
/* Create Thread 2 */
|
||||||
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
|
if (atomThreadCreate(&tcb[1], TEST_THREAD_PRIO, test_thread_func, 2,
|
||||||
&test_thread_stack[1][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[1][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Thread2\n"));
|
ATOMLOG (_STR("Thread2\n"));
|
||||||
@@ -93,8 +93,8 @@ uint32_t test_start (void)
|
|||||||
|
|
||||||
/* Create Thread 3 */
|
/* Create Thread 3 */
|
||||||
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
if (atomThreadCreate(&tcb[2], TEST_THREAD_PRIO, test_thread_func, 3,
|
||||||
&test_thread_stack[2][TEST_THREAD_STACK_SIZE - 1],
|
&test_thread_stack[2][0],
|
||||||
TEST_THREAD_STACK_SIZE) != ATOM_OK)
|
TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK)
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
ATOMLOG (_STR("Thread3\n"));
|
ATOMLOG (_STR("Thread3\n"));
|
||||||
|
|||||||
Reference in New Issue
Block a user