Fix function declarations on samples
This commit fixes the coding style of the function declarations and aligning the open and close brackets and change the style of parameter's documentation. Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com> Change-Id: I648d36eb29dafc7fcd87b8db01e682bea993e5d2 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
ef7e799909
commit
16a2c5800d
19 changed files with 540 additions and 678 deletions
|
@ -54,15 +54,16 @@ required by Security Development Lifecycle
|
||||||
* if either <src> or <dest> are NULL, or if the destination buffer <dest>
|
* if either <src> or <dest> are NULL, or if the destination buffer <dest>
|
||||||
* is too small.
|
* is too small.
|
||||||
*
|
*
|
||||||
|
* \param dest destination buffer
|
||||||
|
* \param nDestElem number of elements in destination buffer
|
||||||
|
* \param src source buffer
|
||||||
|
* \param nElem number of elements to copy
|
||||||
|
*
|
||||||
* RETURNS: 0 on success, otherwise invokes _NanoFatalErrorHandler()
|
* RETURNS: 0 on success, otherwise invokes _NanoFatalErrorHandler()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
errno_t __k_memcpy_s(
|
errno_t __k_memcpy_s(void *dest, size_t nDestElem, const void *src,
|
||||||
void *dest, /* destination buffer */
|
size_t nElem)
|
||||||
size_t nDestElem, /* # of elements in destination buffer */
|
|
||||||
const void *src, /* source buffer */
|
|
||||||
size_t nElem /* # of elements to copy */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if ((dest == NULL) || (src == NULL) || (nDestElem < nElem)) {
|
if ((dest == NULL) || (src == NULL) || (nDestElem < nElem)) {
|
||||||
_NanoFatalErrorHandler(_NANO_ERR_INVALID_STRING_OP,
|
_NanoFatalErrorHandler(_NANO_ERR_INVALID_STRING_OP,
|
||||||
|
@ -86,12 +87,13 @@ errno_t __k_memcpy_s(
|
||||||
* enabled, returns the number of elements in the string <str> to a maximum
|
* enabled, returns the number of elements in the string <str> to a maximum
|
||||||
* value of <maxElem>. Note that if <str> is NULL, it returns 0.
|
* value of <maxElem>. Note that if <str> is NULL, it returns 0.
|
||||||
*
|
*
|
||||||
|
* \param str string about which to find length
|
||||||
|
* \param maxElem maximum number of elements in the string
|
||||||
|
*
|
||||||
* RETURNS: number of elements in the null-terminated character string
|
* RETURNS: number of elements in the null-terminated character string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
size_t __strlen_s(const char *str, /* string about which to find length */
|
size_t __strlen_s(const char *str, size_t maxElem)
|
||||||
size_t maxElem /* maximum # of elements in the string */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
size_t len = 0; /* the calculated string length */
|
size_t len = 0; /* the calculated string length */
|
||||||
|
|
||||||
|
@ -117,15 +119,14 @@ size_t __strlen_s(const char *str, /* string about which to find length */
|
||||||
* if either <src> or <dest> are NULL, or if the buffer for destination string
|
* if either <src> or <dest> are NULL, or if the buffer for destination string
|
||||||
* <dest> is too small.
|
* <dest> is too small.
|
||||||
*
|
*
|
||||||
|
* \param dest destination string buffer
|
||||||
|
* \param nDestElem number of elements in destination buffer
|
||||||
|
* \param src source string buffer
|
||||||
|
*
|
||||||
* RETURNS: 0 on success, otherwise invokes _NanoFatalErrorHandler()
|
* RETURNS: 0 on success, otherwise invokes _NanoFatalErrorHandler()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
errno_t __strcpy_s
|
errno_t __strcpy_s(char *dest, size_t nDestElem, const char *src)
|
||||||
(
|
|
||||||
char * dest, /* destination string buffer */
|
|
||||||
size_t nDestElem, /* # of elements in destination buffer */
|
|
||||||
const char * src /* source string buffer */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int i = 0; /* loop counter */
|
int i = 0; /* loop counter */
|
||||||
|
|
||||||
|
|
|
@ -53,12 +53,14 @@
|
||||||
#define SLEEPTIME 500
|
#define SLEEPTIME 500
|
||||||
#define SLEEPTICKS (SLEEPTIME * sys_clock_ticks_per_sec / 1000)
|
#define SLEEPTICKS (SLEEPTIME * sys_clock_ticks_per_sec / 1000)
|
||||||
|
|
||||||
void helloLoop
|
/*
|
||||||
(
|
*
|
||||||
const char * taskname, /* task identification string */
|
* \param taskname task identification string
|
||||||
ksem_t mySem, /* task's own semaphore */
|
* \param mySem task's own semaphore
|
||||||
ksem_t otherSem /* other task's semaphore */
|
* \param otherSem other task's semaphore
|
||||||
)
|
*
|
||||||
|
*/
|
||||||
|
void helloLoop(const char *taskname, ksem_t mySem, ksem_t otherSem)
|
||||||
{
|
{
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,13 +74,12 @@ int criticalRtn (void)
|
||||||
*
|
*
|
||||||
* criticalLoop - common code for invoking task_offload_to_fiber()
|
* criticalLoop - common code for invoking task_offload_to_fiber()
|
||||||
*
|
*
|
||||||
|
* \param count number of critical section calls made thus far
|
||||||
|
*
|
||||||
* RETURNS: number of critical section calls made by task
|
* RETURNS: number of critical section calls made by task
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint32_t criticalLoop
|
uint32_t criticalLoop(uint32_t count)
|
||||||
(
|
|
||||||
uint32_t count /* number of critical section calls made thus far */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int32_t ticks;
|
int32_t ticks;
|
||||||
|
|
||||||
|
|
|
@ -76,10 +76,7 @@ extern struct nano_sem fiberSem; /* semaphore that allows test control the fiber
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_event_signal_handler
|
void isr_event_signal_handler(void *data)
|
||||||
(
|
|
||||||
void *data
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_INFO *pInfo = (ISR_INFO *) data;
|
ISR_INFO *pInfo = (ISR_INFO *) data;
|
||||||
|
|
||||||
|
@ -370,13 +367,12 @@ int fiberEventSignalTest(void)
|
||||||
*
|
*
|
||||||
* eventHandler - handler to run on EVENT_ID event
|
* eventHandler - handler to run on EVENT_ID event
|
||||||
*
|
*
|
||||||
|
* \param event signalled event
|
||||||
|
*
|
||||||
* RETURNS: <handlerRetVal>
|
* RETURNS: <handlerRetVal>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int eventHandler
|
int eventHandler(int event)
|
||||||
(
|
|
||||||
int event /* signalled event */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ARG_UNUSED(event);
|
ARG_UNUSED(event);
|
||||||
|
|
||||||
|
@ -389,13 +385,12 @@ int eventHandler
|
||||||
*
|
*
|
||||||
* altEventHandler - handler to run on ALT_EVENT event
|
* altEventHandler - handler to run on ALT_EVENT event
|
||||||
*
|
*
|
||||||
|
* \param event signalled event
|
||||||
|
*
|
||||||
* RETURNS: 1
|
* RETURNS: 1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int altEventHandler
|
int altEventHandler(int event)
|
||||||
(
|
|
||||||
int event /* signalled event */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ARG_UNUSED(event);
|
ARG_UNUSED(event);
|
||||||
|
|
||||||
|
|
|
@ -107,14 +107,13 @@ void printMyData(void)
|
||||||
* This routine verifies current value against expected value
|
* This routine verifies current value against expected value
|
||||||
* and returns TRUE if they are the same.
|
* and returns TRUE if they are the same.
|
||||||
*
|
*
|
||||||
|
* \param expectRetValue expect value
|
||||||
|
* \param currentRetValue current value
|
||||||
|
*
|
||||||
* RETURNS: TRUE, FALSE
|
* RETURNS: TRUE, FALSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL verifyRetValue
|
BOOL verifyRetValue(int expectRetValue, int currentRetValue)
|
||||||
(
|
|
||||||
int expectRetValue, /* expect value */
|
|
||||||
int currentRetValue /* current value */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return (expectRetValue == currentRetValue);
|
return (expectRetValue == currentRetValue);
|
||||||
} /* verifyRetValue */
|
} /* verifyRetValue */
|
||||||
|
@ -141,19 +140,15 @@ void initMicroObjects(void)
|
||||||
* This routine fills the FIFO queue with myData array. This assumes the
|
* This routine fills the FIFO queue with myData array. This assumes the
|
||||||
* queue is empty before we put in elements.
|
* queue is empty before we put in elements.
|
||||||
*
|
*
|
||||||
|
* \param queue FIFO queue
|
||||||
|
* \param numElements Number of elements used to inserted into the queue
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS, TC_FAIL
|
* RETURNS: TC_PASS, TC_FAIL
|
||||||
*
|
*
|
||||||
* Also updates tcRC when result is TC_FAIL.
|
* Also updates tcRC when result is TC_FAIL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int fillFIFO
|
int fillFIFO(kfifo_t queue, int numElements)
|
||||||
(
|
|
||||||
kfifo_t queue, /* FIFO queue */
|
|
||||||
int numElements /*
|
|
||||||
* number of elements used to inserted
|
|
||||||
* into the queue
|
|
||||||
*/
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int result = TC_PASS; /* TC_PASS or TC_FAIL for this function */
|
int result = TC_PASS; /* TC_PASS or TC_FAIL for this function */
|
||||||
int retValue; /* return value from task_fifo_xxx APIs */
|
int retValue; /* return value from task_fifo_xxx APIs */
|
||||||
|
@ -289,14 +284,13 @@ exitTest4:
|
||||||
* that they are in the right order. Expect the dequeue order as: myData[0],
|
* that they are in the right order. Expect the dequeue order as: myData[0],
|
||||||
* myData[1].
|
* myData[1].
|
||||||
*
|
*
|
||||||
|
* \param loopCnt number of elements passed to the for loop
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS, TC_FAIL
|
* RETURNS: TC_PASS, TC_FAIL
|
||||||
*
|
*
|
||||||
* Also updates tcRC when result is TC_FAIL.
|
* Also updates tcRC when result is TC_FAIL.
|
||||||
*/
|
*/
|
||||||
int verifyQueueData
|
int verifyQueueData(int loopCnt)
|
||||||
(
|
|
||||||
int loopCnt /* Number of elements passed to the for loop */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int result = TC_PASS; /* TC_PASS or TC_FAIL for this function */
|
int result = TC_PASS; /* TC_PASS or TC_FAIL for this function */
|
||||||
int retValue; /* task_fifo_xxx interface return value */
|
int retValue; /* task_fifo_xxx interface return value */
|
||||||
|
|
|
@ -74,14 +74,13 @@ int testMapFreeAllBlocks(void **P);
|
||||||
* This routine verifies current value against expected value
|
* This routine verifies current value against expected value
|
||||||
* and returns TRUE if they are the same.
|
* and returns TRUE if they are the same.
|
||||||
*
|
*
|
||||||
|
* \param expectRetValue expect value
|
||||||
|
* \param currentRetValue current value
|
||||||
|
*
|
||||||
* RETURNS: TRUE, FALSE
|
* RETURNS: TRUE, FALSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL verifyRetValue
|
BOOL verifyRetValue(int expectRetValue, int currentRetValue)
|
||||||
(
|
|
||||||
int expectRetValue, /* expect value */
|
|
||||||
int currentRetValue /* current value */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return (expectRetValue == currentRetValue);
|
return (expectRetValue == currentRetValue);
|
||||||
|
|
||||||
|
@ -160,13 +159,12 @@ exitTest1:
|
||||||
*
|
*
|
||||||
* task_mem_map_alloc(), task_mem_map_used_get()
|
* task_mem_map_alloc(), task_mem_map_used_get()
|
||||||
*
|
*
|
||||||
|
* \param p pointer to pointer of allocated blocks
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS, TC_FAIL
|
* RETURNS: TC_PASS, TC_FAIL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int testMapGetAllBlocks
|
int testMapGetAllBlocks(void **p)
|
||||||
(
|
|
||||||
void **p /* pointer to pointer of allocated blocks */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int retValue; /* task_mem_map_xxx interface return value */
|
int retValue; /* task_mem_map_xxx interface return value */
|
||||||
void *errPtr; /* Pointer to block */
|
void *errPtr; /* Pointer to block */
|
||||||
|
@ -233,13 +231,12 @@ int testMapGetAllBlocks
|
||||||
*
|
*
|
||||||
* task_mem_map_free(), task_mem_map_used_get()
|
* task_mem_map_free(), task_mem_map_used_get()
|
||||||
*
|
*
|
||||||
|
* \param p pointer to pointer of allocated blocks
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS, TC_FAIL
|
* RETURNS: TC_PASS, TC_FAIL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int testMapFreeAllBlocks
|
int testMapFreeAllBlocks(void **p)
|
||||||
(
|
|
||||||
void **p /* pointer to pointer of allocated blocks */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int retValue; /* task_mem_map_xxx interface return value */
|
int retValue; /* task_mem_map_xxx interface return value */
|
||||||
|
|
||||||
|
@ -289,12 +286,11 @@ int testMapFreeAllBlocks
|
||||||
*
|
*
|
||||||
* This routine prints out the pointers.
|
* This routine prints out the pointers.
|
||||||
*
|
*
|
||||||
|
* \param pointer pointer to pointer of allocated blocks
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
void printPointers
|
void printPointers(void **pointer)
|
||||||
(
|
|
||||||
void **pointer /* pointer to pointer of allocated blocks */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
TC_PRINT("%s: ", __func__);
|
TC_PRINT("%s: ", __func__);
|
||||||
for (int i = 0; i < NUMBLOCKS; i++) {
|
for (int i = 0; i < NUMBLOCKS; i++) {
|
||||||
|
|
|
@ -199,14 +199,13 @@ void microObjectsInit (void)
|
||||||
*
|
*
|
||||||
* receiveBufferCheck - check the contents of the receive buffer
|
* receiveBufferCheck - check the contents of the receive buffer
|
||||||
*
|
*
|
||||||
|
* \param buffer pointer to buffer to check
|
||||||
|
* \param size number of bytes to check
|
||||||
|
*
|
||||||
* RETURNS: <size> on success, index of wrong character on failure
|
* RETURNS: <size> on success, index of wrong character on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int receiveBufferCheck
|
int receiveBufferCheck(char *buffer, int size)
|
||||||
(
|
|
||||||
char * buffer, /* pointer to buffer to check */
|
|
||||||
int size /* number of bytes to check */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int j; /* loop counter */
|
int j; /* loop counter */
|
||||||
|
|
||||||
|
@ -225,16 +224,16 @@ int receiveBufferCheck
|
||||||
*
|
*
|
||||||
* pipePutHelperWork - helper routine to pipePutTest()
|
* pipePutHelperWork - helper routine to pipePutTest()
|
||||||
*
|
*
|
||||||
|
* \param singleItems testcase list (one item in the pipe)
|
||||||
|
* \param nSingles number of items in testcase
|
||||||
|
* \param manyItems testcase list (many items in the pipe)
|
||||||
|
* \param nMany number of items in testcase
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pipePutHelperWork
|
int pipePutHelperWork(SIZE_EXPECT *singleItems, int nSingles,
|
||||||
(
|
SIZE_EXPECT *manyItems, int nMany)
|
||||||
SIZE_EXPECT * singleItems, /* testcase list (one item in the pipe) */
|
|
||||||
int nSingles, /* # of items in testcase */
|
|
||||||
SIZE_EXPECT * manyItems, /* testcase list (many items in the pipe) */
|
|
||||||
int nMany /* # of items in testcase */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
int j; /* loop counter */
|
int j; /* loop counter */
|
||||||
|
@ -375,16 +374,16 @@ int pipePutHelper (void)
|
||||||
*
|
*
|
||||||
* This routine tests the task_pipe_put() API.
|
* This routine tests the task_pipe_put() API.
|
||||||
*
|
*
|
||||||
|
* \param singleItems testcase list (one item in the pipe)
|
||||||
|
* \param nSingles number of items in testcase
|
||||||
|
* \param manyItems testcase list (many items in the pipe)
|
||||||
|
* \param nMany number of items in testcase
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pipePutTestWork
|
int pipePutTestWork(SIZE_EXPECT *singleItems, int nSingles,
|
||||||
(
|
SIZE_EXPECT *manyItems, int nMany)
|
||||||
SIZE_EXPECT * singleItems, /* testcase list (one item in the pipe) */
|
|
||||||
int nSingles, /* # of items in testcase */
|
|
||||||
SIZE_EXPECT * manyItems, /* testcase list (many items in the pipe) */
|
|
||||||
int nMany /* # of items in testcase */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int rv; /* return code from task_pipe_put() */
|
int rv; /* return code from task_pipe_put() */
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
|
@ -851,14 +850,13 @@ int pipeGetTest (void)
|
||||||
*
|
*
|
||||||
* pipeGetWaitHelperWork - test task_pipe_get_wait()
|
* pipeGetWaitHelperWork - test task_pipe_get_wait()
|
||||||
*
|
*
|
||||||
|
* \param items testcase list for task_pipe_get_wait()
|
||||||
|
* \param nItems number of items in list
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pipeGetWaitHelperWork
|
int pipeGetWaitHelperWork(SIZE_EXPECT *items, int nItems)
|
||||||
(
|
|
||||||
SIZE_EXPECT * items, /* testcase list for task_pipe_get_wait() */
|
|
||||||
int nItems /* # of items in list */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
int rv; /* return value from task_pipe_put_wait() */
|
int rv; /* return value from task_pipe_put_wait() */
|
||||||
|
@ -921,14 +919,13 @@ int pipeGetWaitHelper (void)
|
||||||
*
|
*
|
||||||
* pipeGetWaitTestWork - test task_pipe_get_wait()
|
* pipeGetWaitTestWork - test task_pipe_get_wait()
|
||||||
*
|
*
|
||||||
|
* \param items testcase list for task_pipe_get_wait()
|
||||||
|
* \param nItems number of items in list
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pipeGetWaitTestWork
|
int pipeGetWaitTestWork(SIZE_EXPECT *items, int nItems)
|
||||||
(
|
|
||||||
SIZE_EXPECT * items, /* testcase list for task_pipe_get_wait() */
|
|
||||||
int nItems /* # of items in list */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
int rv; /* return code from task_pipe_get_wait() */
|
int rv; /* return code from task_pipe_get_wait() */
|
||||||
|
|
|
@ -129,11 +129,7 @@ static TEST_CASE defrag[] = {
|
||||||
* RETURNS: 0 if the same, non-zero if not the same
|
* RETURNS: 0 if the same, non-zero if not the same
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int blockCompare
|
int blockCompare(struct k_block *b1, struct k_block *b2)
|
||||||
(
|
|
||||||
struct k_block *b1,
|
|
||||||
struct k_block *b2
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
char *p1 = (char *) b1;
|
char *p1 = (char *) b1;
|
||||||
char *p2 = (char *) b2;
|
char *p2 = (char *) b2;
|
||||||
|
@ -157,13 +153,8 @@ int blockCompare
|
||||||
* RETURNS: task_mem_pool_alloc() return value
|
* RETURNS: task_mem_pool_alloc() return value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int poolBlockGetFunc
|
int poolBlockGetFunc(struct k_block *block, kmemory_pool_t pool, int size,
|
||||||
(
|
int32_t unused)
|
||||||
struct k_block *block,
|
|
||||||
kmemory_pool_t pool,
|
|
||||||
int size,
|
|
||||||
int32_t unused
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ARG_UNUSED(unused);
|
ARG_UNUSED(unused);
|
||||||
|
|
||||||
|
@ -177,13 +168,8 @@ int poolBlockGetFunc
|
||||||
* RETURNS: task_mem_pool_alloc_wait() return value
|
* RETURNS: task_mem_pool_alloc_wait() return value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int poolBlockGetWFunc
|
int poolBlockGetWFunc(struct k_block *block, kmemory_pool_t pool, int size,
|
||||||
(
|
int32_t unused)
|
||||||
struct k_block *block,
|
|
||||||
kmemory_pool_t pool,
|
|
||||||
int size,
|
|
||||||
int32_t unused
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ARG_UNUSED(unused);
|
ARG_UNUSED(unused);
|
||||||
|
|
||||||
|
@ -197,13 +183,8 @@ int poolBlockGetWFunc
|
||||||
* RETURNS: task_mem_pool_alloc_wait_timeout() return value
|
* RETURNS: task_mem_pool_alloc_wait_timeout() return value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int poolBlockGetWTFunc
|
int poolBlockGetWTFunc(struct k_block *block, kmemory_pool_t pool,
|
||||||
(
|
int size, int32_t timeout)
|
||||||
struct k_block *block,
|
|
||||||
kmemory_pool_t pool,
|
|
||||||
int size,
|
|
||||||
int32_t timeout
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return task_mem_pool_alloc_wait_timeout(block, pool, size, timeout);
|
return task_mem_pool_alloc_wait_timeout(block, pool, size, timeout);
|
||||||
}
|
}
|
||||||
|
@ -215,11 +196,7 @@ int poolBlockGetWTFunc
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void freeBlocks
|
void freeBlocks(TEST_CASE *tests, int nTests)
|
||||||
(
|
|
||||||
TEST_CASE *tests,
|
|
||||||
int nTests
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -237,13 +214,8 @@ void freeBlocks
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int poolBlockGetWork
|
int poolBlockGetWork(char *string, poolBlockGetFunc_t func,
|
||||||
(
|
TEST_CASE *tests, int nTests)
|
||||||
char *string,
|
|
||||||
poolBlockGetFunc_t func,
|
|
||||||
TEST_CASE *tests,
|
|
||||||
int nTests
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -414,11 +386,7 @@ int poolBlockGetWaitTest(void)
|
||||||
* RETURNS: task_mem_pool_move() return value
|
* RETURNS: task_mem_pool_move() return value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int poolMoveBlock
|
int poolMoveBlock(struct k_block *block, kmemory_pool_t pool)
|
||||||
(
|
|
||||||
struct k_block *block,
|
|
||||||
kmemory_pool_t pool
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return task_mem_pool_move(block, pool);
|
return task_mem_pool_move(block, pool);
|
||||||
}
|
}
|
||||||
|
@ -430,11 +398,7 @@ int poolMoveBlock
|
||||||
* RETURNS: task_mem_pool_move_wait() return value
|
* RETURNS: task_mem_pool_move_wait() return value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int poolMoveBlockW
|
int poolMoveBlockW(struct k_block *block, kmemory_pool_t pool)
|
||||||
(
|
|
||||||
struct k_block *block,
|
|
||||||
kmemory_pool_t pool
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return task_mem_pool_move_wait(block, pool);
|
return task_mem_pool_move_wait(block, pool);
|
||||||
}
|
}
|
||||||
|
@ -446,11 +410,7 @@ int poolMoveBlockW
|
||||||
* RETURNS: task_mem_pool_move_wait_timeout() return value
|
* RETURNS: task_mem_pool_move_wait_timeout() return value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int poolMoveBlockWT
|
int poolMoveBlockWT(struct k_block *block, kmemory_pool_t pool)
|
||||||
(
|
|
||||||
struct k_block *block,
|
|
||||||
kmemory_pool_t pool
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return task_mem_pool_move_wait_timeout(block, pool, TENTH_SECOND);
|
return task_mem_pool_move_wait_timeout(block, pool, TENTH_SECOND);
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,13 +172,12 @@ void LowPriTaskEntry (void)
|
||||||
*
|
*
|
||||||
* testIsrHandler - ISR that gives specified semaphore
|
* testIsrHandler - ISR that gives specified semaphore
|
||||||
*
|
*
|
||||||
|
* \param isrData pointer to semaphore to be given
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void testIsrHandler
|
static void testIsrHandler(void *isrData)
|
||||||
(
|
|
||||||
void *isrData /* pointer to semaphore to be given */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
isr_sem_give (*(ksem_t *)isrData, &CMD_PKT_SET(cmdPktSet));
|
isr_sem_give (*(ksem_t *)isrData, &CMD_PKT_SET(cmdPktSet));
|
||||||
}
|
}
|
||||||
|
@ -187,13 +186,12 @@ static void testIsrHandler
|
||||||
*
|
*
|
||||||
* trigger_isrSemaSignal - generate interrupt that gives specified semaphore
|
* trigger_isrSemaSignal - generate interrupt that gives specified semaphore
|
||||||
*
|
*
|
||||||
|
* \param semaphore semaphore to be given
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void trigger_isrSemaSignal
|
void trigger_isrSemaSignal(ksem_t semaphore)
|
||||||
(
|
|
||||||
ksem_t semaphore /* semaphore to be given */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
testIsrInfo = semaphore;
|
testIsrInfo = semaphore;
|
||||||
_trigger_isrSemaSignal ();
|
_trigger_isrSemaSignal ();
|
||||||
|
|
|
@ -262,13 +262,7 @@ int sprintfDoubleTest (void)
|
||||||
* tvsnprintf - a test wrapper for vsnprintf()
|
* tvsnprintf - a test wrapper for vsnprintf()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int tvsnprintf
|
int tvsnprintf(char *s, size_t len, const char *format, ...)
|
||||||
(
|
|
||||||
char * s,
|
|
||||||
size_t len,
|
|
||||||
const char * format,
|
|
||||||
...
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
va_list vargs;
|
va_list vargs;
|
||||||
int r;
|
int r;
|
||||||
|
@ -362,12 +356,7 @@ int vsnprintfTest (void)
|
||||||
* tvsprintf - a test wrapper for vsprintf()
|
* tvsprintf - a test wrapper for vsprintf()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int tvsprintf
|
int tvsprintf(char *s, const char *format, ...)
|
||||||
(
|
|
||||||
char * s,
|
|
||||||
const char * format,
|
|
||||||
...
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
va_list vargs;
|
va_list vargs;
|
||||||
int r;
|
int r;
|
||||||
|
|
|
@ -77,13 +77,12 @@ void check_input ( const char *name, const char *input );
|
||||||
* This function calls check_input 6 times with the input name and a short
|
* This function calls check_input 6 times with the input name and a short
|
||||||
* string, which is printed properly by check_input.
|
* string, which is printed properly by check_input.
|
||||||
*
|
*
|
||||||
|
* \param name task or fiber identification string
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void printLoop
|
void printLoop(const char *name)
|
||||||
(
|
|
||||||
const char * name /* task or fiber identification string */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
while (count < 6)
|
while (count < 6)
|
||||||
{
|
{
|
||||||
|
@ -109,11 +108,7 @@ void printLoop
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void check_input
|
void check_input(const char *name, const char *input)
|
||||||
(
|
|
||||||
const char *name,
|
|
||||||
const char *input
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
/* Stack will overflow when input is more than 16 characters */
|
/* Stack will overflow when input is more than 16 characters */
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
|
|
@ -123,10 +123,7 @@ void isr_handler (void)
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void exc_divide_error_handler
|
void exc_divide_error_handler(NANO_ESF *pEsf)
|
||||||
(
|
|
||||||
NANO_ESF * pEsf
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
pEsf->eip += 2;
|
pEsf->eip += 2;
|
||||||
excHandlerExecuted = 1; /* provide evidence that the handler executed */
|
excHandlerExecuted = 1; /* provide evidence that the handler executed */
|
||||||
|
@ -203,11 +200,7 @@ int nanoIdtStubTest (void)
|
||||||
#ifdef CONFIG_MICROKERNEL
|
#ifdef CONFIG_MICROKERNEL
|
||||||
void idtSpurTask(void)
|
void idtSpurTask(void)
|
||||||
#else
|
#else
|
||||||
static void idtSpurFiber
|
static void idtSpurFiber(int a1, int a2)
|
||||||
(
|
|
||||||
int a1,
|
|
||||||
int a2
|
|
||||||
)
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_MICROKERNEL
|
#ifndef CONFIG_MICROKERNEL
|
||||||
|
|
|
@ -86,10 +86,7 @@ static volatile int mainTaskNotReady = 0;
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_task_command_handler
|
void isr_task_command_handler(void *data)
|
||||||
(
|
|
||||||
void * data
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_INFO * pInfo = (ISR_INFO *) data;
|
ISR_INFO * pInfo = (ISR_INFO *) data;
|
||||||
int value = -1;
|
int value = -1;
|
||||||
|
@ -115,11 +112,7 @@ void isr_task_command_handler
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int isrAPIsTest
|
int isrAPIsTest(int taskId, int taskPrio)
|
||||||
(
|
|
||||||
int taskId,
|
|
||||||
int taskPrio
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
isrInfo.cmd = CMD_TASKID;
|
isrInfo.cmd = CMD_TASKID;
|
||||||
_trigger_isrTaskCommand ();
|
_trigger_isrTaskCommand ();
|
||||||
|
@ -149,11 +142,7 @@ int isrAPIsTest
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int taskMacrosTest
|
int taskMacrosTest(int taskId, int taskPrio)
|
||||||
(
|
|
||||||
int taskId,
|
|
||||||
int taskPrio
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int value;
|
int value;
|
||||||
|
|
||||||
|
|
|
@ -136,10 +136,7 @@ static void (*_trigger_isrHandler) (void) = (vvfn)sw_isr_trigger_0;
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_handler
|
void isr_handler(void *data)
|
||||||
(
|
|
||||||
void * data
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ARG_UNUSED (data);
|
ARG_UNUSED (data);
|
||||||
|
|
||||||
|
@ -175,10 +172,7 @@ void isr_handler
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void exc_divide_error_handler
|
void exc_divide_error_handler(NANO_ESF *pEsf)
|
||||||
(
|
|
||||||
NANO_ESF * pEsf
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
pEsf->eip += 2;
|
pEsf->eip += 2;
|
||||||
excHandlerExecuted = 1; /* provide evidence that the handler executed */
|
excHandlerExecuted = 1; /* provide evidence that the handler executed */
|
||||||
|
@ -257,10 +251,7 @@ int nano_cpu_idleTest (void)
|
||||||
* RETURNS: irq_lock() return value
|
* RETURNS: irq_lock() return value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int irq_lockWrapper
|
int irq_lockWrapper(int unused)
|
||||||
(
|
|
||||||
int unused
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ARG_UNUSED (unused);
|
ARG_UNUSED (unused);
|
||||||
|
|
||||||
|
@ -274,10 +265,7 @@ int irq_lockWrapper
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void irq_unlockWrapper
|
void irq_unlockWrapper(int imask)
|
||||||
(
|
|
||||||
int imask
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
irq_unlock (imask);
|
irq_unlock (imask);
|
||||||
}
|
}
|
||||||
|
@ -289,10 +277,7 @@ void irq_unlockWrapper
|
||||||
* RETURNS: irq_lock_inline() return value
|
* RETURNS: irq_lock_inline() return value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int irq_lock_inlineWrapper
|
int irq_lock_inlineWrapper(int unused)
|
||||||
(
|
|
||||||
int unused
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ARG_UNUSED (unused);
|
ARG_UNUSED (unused);
|
||||||
|
|
||||||
|
@ -306,10 +291,7 @@ int irq_lock_inlineWrapper
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void irq_unlock_inlineWrapper
|
void irq_unlock_inlineWrapper(int imask)
|
||||||
(
|
|
||||||
int imask
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
irq_unlock_inline (imask);
|
irq_unlock_inline (imask);
|
||||||
}
|
}
|
||||||
|
@ -321,10 +303,7 @@ void irq_unlock_inlineWrapper
|
||||||
* RETURNS: <irq>
|
* RETURNS: <irq>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int irq_disableWrapper
|
int irq_disableWrapper(int irq)
|
||||||
(
|
|
||||||
int irq
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
irq_disable (irq);
|
irq_disable (irq);
|
||||||
return irq;
|
return irq;
|
||||||
|
@ -337,10 +316,7 @@ int irq_disableWrapper
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void irq_enableWrapper
|
void irq_enableWrapper(int irq)
|
||||||
(
|
|
||||||
int irq
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
irq_enable (irq);
|
irq_enable (irq);
|
||||||
}
|
}
|
||||||
|
@ -356,12 +332,8 @@ void irq_enableWrapper
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int nanoCpuDisableInterruptsTest
|
int nanoCpuDisableInterruptsTest(disable_interrupt_func disableRtn,
|
||||||
(
|
enable_interrupt_func enableRtn, int irq)
|
||||||
disable_interrupt_func disableRtn,
|
|
||||||
enable_interrupt_func enableRtn,
|
|
||||||
int irq
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
unsigned long long count = 0;
|
unsigned long long count = 0;
|
||||||
unsigned long long i = 0;
|
unsigned long long i = 0;
|
||||||
|
@ -484,10 +456,7 @@ int nanoCtxTaskTest (void)
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int nanoCtxFiberTest
|
int nanoCtxFiberTest(nano_context_id_t taskCtxId)
|
||||||
(
|
|
||||||
nano_context_id_t taskCtxId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
nano_context_id_t ctxId;
|
nano_context_id_t ctxId;
|
||||||
|
|
||||||
|
@ -536,14 +505,13 @@ int nanoCtxFiberTest
|
||||||
* This routine is the entry point to the fiber's helper fiber. It is used to
|
* This routine is the entry point to the fiber's helper fiber. It is used to
|
||||||
* help test the behaviour of the fiber_yield() routine.
|
* help test the behaviour of the fiber_yield() routine.
|
||||||
*
|
*
|
||||||
|
* \param arg1 unused
|
||||||
|
* \param arg2 unused
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void fiberHelper
|
static void fiberHelper(int arg1, int arg2)
|
||||||
(
|
|
||||||
int arg1, /* unused */
|
|
||||||
int arg2 /* unused */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
nano_context_id_t ctxId;
|
nano_context_id_t ctxId;
|
||||||
|
|
||||||
|
@ -655,14 +623,13 @@ int fiber_yieldTest (void)
|
||||||
*
|
*
|
||||||
* This routine is the entry point to the fiber started by the task.
|
* This routine is the entry point to the fiber started by the task.
|
||||||
*
|
*
|
||||||
|
* \param taskCtxId context ID of the spawning task
|
||||||
|
* \param arg1 unused
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void fiberEntry
|
static void fiberEntry(int taskCtxId, int arg1)
|
||||||
(
|
|
||||||
int taskCtxId, /* context ID of the spawning task */
|
|
||||||
int arg1 /* unused */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
|
|
|
@ -158,13 +158,12 @@ void testTaskFifoGetW(void);
|
||||||
* This routine is the ISR handler for _trigger_nano_isr_fifo_put(). It adds
|
* This routine is the ISR handler for _trigger_nano_isr_fifo_put(). It adds
|
||||||
* an item to the FIFO in the context of an ISR.
|
* an item to the FIFO in the context of an ISR.
|
||||||
*
|
*
|
||||||
|
* \param parameter pointer to ISR handler parameter
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_fifo_put
|
void isr_fifo_put(void *parameter)
|
||||||
(
|
|
||||||
void * parameter /* ptr to ISR handler parameter */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_FIFO_INFO * pInfo = (ISR_FIFO_INFO *) parameter;
|
ISR_FIFO_INFO * pInfo = (ISR_FIFO_INFO *) parameter;
|
||||||
|
|
||||||
|
@ -178,13 +177,12 @@ void isr_fifo_put
|
||||||
* This routine is the ISR handler for _trigger_nano_isr_fifo_get(). It gets
|
* This routine is the ISR handler for _trigger_nano_isr_fifo_get(). It gets
|
||||||
* an item from the FIFO in the context of an ISR.
|
* an item from the FIFO in the context of an ISR.
|
||||||
*
|
*
|
||||||
|
* \param parameter pointer to ISR handler parameter
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_fifo_get
|
void isr_fifo_get(void *parameter)
|
||||||
(
|
|
||||||
void * parameter /* ptr to ISR handler parameter */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_FIFO_INFO * pInfo = (ISR_FIFO_INFO *) parameter;
|
ISR_FIFO_INFO * pInfo = (ISR_FIFO_INFO *) parameter;
|
||||||
|
|
||||||
|
|
|
@ -111,13 +111,12 @@ static void (*_trigger_nano_isr_lifo_get) (void) = (vvfn)sw_isr_trigger_1;
|
||||||
* This routine is the ISR handler for _trigger_nano_isr_lifo_put(). It adds
|
* This routine is the ISR handler for _trigger_nano_isr_lifo_put(). It adds
|
||||||
* an item to the LIFO in the context of an ISR.
|
* an item to the LIFO in the context of an ISR.
|
||||||
*
|
*
|
||||||
|
* \param data pointer to ISR handler parameter
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_lifo_put
|
void isr_lifo_put(void *data)
|
||||||
(
|
|
||||||
void * data /* ptr to ISR handler parameter */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_LIFO_INFO * pInfo = (ISR_LIFO_INFO *) data;
|
ISR_LIFO_INFO * pInfo = (ISR_LIFO_INFO *) data;
|
||||||
|
|
||||||
|
@ -131,13 +130,12 @@ void isr_lifo_put
|
||||||
* This routine is the ISR handler for _trigger_nano_isr_lifo_get(). It gets
|
* This routine is the ISR handler for _trigger_nano_isr_lifo_get(). It gets
|
||||||
* an item from the LIFO in the context of an ISR.
|
* an item from the LIFO in the context of an ISR.
|
||||||
*
|
*
|
||||||
|
* \param data pointer to ISR handler parameter
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_lifo_get
|
void isr_lifo_get(void *data)
|
||||||
(
|
|
||||||
void * data /* ptr to ISR handler parameter */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_LIFO_INFO * pInfo = (ISR_LIFO_INFO *) data;
|
ISR_LIFO_INFO * pInfo = (ISR_LIFO_INFO *) data;
|
||||||
|
|
||||||
|
@ -298,14 +296,13 @@ errorReturn:
|
||||||
* NOTE: The fiber portion of the tests have higher priority than the task
|
* NOTE: The fiber portion of the tests have higher priority than the task
|
||||||
* portion of the tests.
|
* portion of the tests.
|
||||||
*
|
*
|
||||||
|
* \param arg1 unused
|
||||||
|
* \param arg2 unused
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void fiberEntry
|
static void fiberEntry(int arg1, int arg2)
|
||||||
(
|
|
||||||
int arg1, /* unused */
|
|
||||||
int arg2 /* unused */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int rv; /* return value from a test */
|
int rv; /* return value from a test */
|
||||||
|
|
||||||
|
|
|
@ -102,13 +102,12 @@ static void (*_trigger_nano_isr_sem_take) (void) = (vvfn)sw_isr_trigger_1;
|
||||||
* This routine is the ISR handler for _trigger_nano_isr_sem_take(). It takes a
|
* This routine is the ISR handler for _trigger_nano_isr_sem_take(). It takes a
|
||||||
* semaphore within the context of an ISR.
|
* semaphore within the context of an ISR.
|
||||||
*
|
*
|
||||||
|
* \param data pointer to ISR handler parameter
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_sem_take
|
void isr_sem_take(void *data)
|
||||||
(
|
|
||||||
void * data /* ptr to ISR handler parameter */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_SEM_INFO * pInfo = (ISR_SEM_INFO *) data;
|
ISR_SEM_INFO * pInfo = (ISR_SEM_INFO *) data;
|
||||||
|
|
||||||
|
@ -122,13 +121,12 @@ void isr_sem_take
|
||||||
* This routine is the ISR handler for _trigger_nano_isr_sem_take(). It gives a
|
* This routine is the ISR handler for _trigger_nano_isr_sem_take(). It gives a
|
||||||
* semaphore within the context of an ISR.
|
* semaphore within the context of an ISR.
|
||||||
*
|
*
|
||||||
|
* \param data pointer to ISR handler parameter
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_sem_give
|
void isr_sem_give(void *data)
|
||||||
(
|
|
||||||
void * data /* ptr to ISR handler parameter */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_SEM_INFO * pInfo = (ISR_SEM_INFO *) data;
|
ISR_SEM_INFO * pInfo = (ISR_SEM_INFO *) data;
|
||||||
|
|
||||||
|
@ -191,14 +189,13 @@ errorReturn:
|
||||||
* NOTE: The fiber portion of the tests have higher priority than the task
|
* NOTE: The fiber portion of the tests have higher priority than the task
|
||||||
* portion of the tests.
|
* portion of the tests.
|
||||||
*
|
*
|
||||||
|
* \param arg1 unused
|
||||||
|
* \param arg2 unused
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void fiberEntry
|
static void fiberEntry(int arg1, int arg2)
|
||||||
(
|
|
||||||
int arg1, /* unused */
|
|
||||||
int arg2 /* unused */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int rv; /* return value from a test */
|
int rv; /* return value from a test */
|
||||||
|
|
||||||
|
|
|
@ -163,13 +163,12 @@ void initData(void)
|
||||||
* This routine is the ISR handler for _trigger_nano_isr_stack_push(). It adds
|
* This routine is the ISR handler for _trigger_nano_isr_stack_push(). It adds
|
||||||
* an item to the STACK in the context of an ISR.
|
* an item to the STACK in the context of an ISR.
|
||||||
*
|
*
|
||||||
|
* \param parameter pointer to ISR handler parameter
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_stack_push
|
void isr_stack_push(void *parameter)
|
||||||
(
|
|
||||||
void * parameter /* ptr to ISR handler parameter */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_STACK_INFO * pInfo = (ISR_STACK_INFO *) parameter;
|
ISR_STACK_INFO * pInfo = (ISR_STACK_INFO *) parameter;
|
||||||
|
|
||||||
|
@ -185,13 +184,12 @@ void isr_stack_push
|
||||||
* an item from the STACK in the context of an ISR. If the queue is empty,
|
* an item from the STACK in the context of an ISR. If the queue is empty,
|
||||||
* it sets data to INVALID_DATA.
|
* it sets data to INVALID_DATA.
|
||||||
*
|
*
|
||||||
|
* \param parameter pointer to ISR handler parameter
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void isr_stack_pop
|
void isr_stack_pop(void *parameter)
|
||||||
(
|
|
||||||
void * parameter /* ptr to ISR handler parameter */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ISR_STACK_INFO * pInfo = (ISR_STACK_INFO *) parameter;
|
ISR_STACK_INFO * pInfo = (ISR_STACK_INFO *) parameter;
|
||||||
|
|
||||||
|
|
|
@ -117,18 +117,20 @@ void initNanoObjects (void)
|
||||||
*
|
*
|
||||||
* This routine can be considered as testing nano_node_tick_get_32(),
|
* This routine can be considered as testing nano_node_tick_get_32(),
|
||||||
* nanoTimeElapsed() and nanoXXXTimerGetW() successful expiration cases.
|
* nanoTimeElapsed() and nanoXXXTimerGetW() successful expiration cases.
|
||||||
|
*
|
||||||
|
* \param startRtn routine to start the timer
|
||||||
|
* \param waitRtn routine to get and wait for the timer
|
||||||
|
* \param getRtn routine to get the timer (no waiting)
|
||||||
|
* \param pTimer pointer to the timer
|
||||||
|
* \param pTimerData pointer to the expected timer data
|
||||||
|
* \param ticks number of ticks to wait
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int basicTimerWait
|
int basicTimerWait(timer_start_func startRtn, timer_getw_func waitRtn,
|
||||||
(
|
timer_get_func getRtn, struct nano_timer *pTimer,
|
||||||
timer_start_func startRtn, /* routine to start the timer */
|
void *pTimerData, int ticks)
|
||||||
timer_getw_func waitRtn, /* routine to get and wait for the timer */
|
|
||||||
timer_get_func getRtn, /* routine to get the timer (no waiting) */
|
|
||||||
struct nano_timer *pTimer, /* ptr to the timer */
|
|
||||||
void * pTimerData, /* ptr to the expected timer data */
|
|
||||||
int ticks /* number of ticks to wait */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
uint64_t reftime; /* reference time for tick delta */
|
uint64_t reftime; /* reference time for tick delta */
|
||||||
uint32_t tick; /* current tick */
|
uint32_t tick; /* current tick */
|
||||||
|
@ -203,13 +205,12 @@ int basicTimerWait
|
||||||
*
|
*
|
||||||
* Four timers are used so that the various paths can be tested.
|
* Four timers are used so that the various paths can be tested.
|
||||||
*
|
*
|
||||||
|
* \param startRtn routine to start the timers
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void startTimers
|
void startTimers(timer_start_func startRtn)
|
||||||
(
|
|
||||||
timer_start_func startRtn /* routine to start the timers */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int tick; /* current tick */
|
int tick; /* current tick */
|
||||||
|
|
||||||
|
@ -234,13 +235,12 @@ void startTimers
|
||||||
* expire. The timers are expected to expire in the following order:
|
* expire. The timers are expected to expire in the following order:
|
||||||
* <shortTimer>, <timer>, <midTimer>, <longTimer>
|
* <shortTimer>, <timer>, <midTimer>, <longTimer>
|
||||||
*
|
*
|
||||||
|
* \param getRtn timer get routine (fiber or task)
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int busyWaitTimers
|
int busyWaitTimers(timer_get_func getRtn)
|
||||||
(
|
|
||||||
timer_get_func getRtn /* timer get routine (fiber or task) */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int numExpired = 0; /* # of expired timers */
|
int numExpired = 0; /* # of expired timers */
|
||||||
void * result; /* value returned from <getRtn> */
|
void * result; /* value returned from <getRtn> */
|
||||||
|
@ -313,14 +313,13 @@ int busyWaitTimers
|
||||||
* exercise the code that removes timers from important locations in the list;
|
* exercise the code that removes timers from important locations in the list;
|
||||||
* these include the middle, the head, the tail, and the last item.
|
* these include the middle, the head, the tail, and the last item.
|
||||||
*
|
*
|
||||||
|
* \param stopRtn routine to stop timer (fiber or task)
|
||||||
|
* \param getRtn timer get routine (fiber or task)
|
||||||
|
*
|
||||||
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
* RETURNS: TC_PASS on success, TC_FAIL on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int stopTimers
|
int stopTimers(timer_stop_func stopRtn, timer_get_func getRtn)
|
||||||
(
|
|
||||||
timer_stop_func stopRtn, /* routine to stop timer (fiber or task) */
|
|
||||||
timer_get_func getRtn /* timer get routine (fiber or task) */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int startTick; /* tick at which test starts */
|
int startTick; /* tick at which test starts */
|
||||||
int endTick; /* tick by which test should be completed */
|
int endTick; /* tick by which test should be completed */
|
||||||
|
@ -358,14 +357,13 @@ int stopTimers
|
||||||
* The second fiber has a lower priority than the first, but is still given
|
* The second fiber has a lower priority than the first, but is still given
|
||||||
* precedence over the task.
|
* precedence over the task.
|
||||||
*
|
*
|
||||||
|
* \param arg1 unused
|
||||||
|
* \param arg2 unused
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void fiber2Entry
|
static void fiber2Entry(int arg1, int arg2)
|
||||||
(
|
|
||||||
int arg1, /* unused */
|
|
||||||
int arg2 /* unused */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ARG_UNUSED (arg1);
|
ARG_UNUSED (arg1);
|
||||||
ARG_UNUSED (arg2);
|
ARG_UNUSED (arg2);
|
||||||
|
@ -380,14 +378,13 @@ static void fiber2Entry
|
||||||
* NOTE: The fiber portion of the tests have higher priority than the task
|
* NOTE: The fiber portion of the tests have higher priority than the task
|
||||||
* portion of the tests.
|
* portion of the tests.
|
||||||
*
|
*
|
||||||
|
* \param arg1 unused
|
||||||
|
* \param arg2 unused
|
||||||
|
*
|
||||||
* RETURNS: N/A
|
* RETURNS: N/A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void fiberEntry
|
static void fiberEntry(int arg1, int arg2)
|
||||||
(
|
|
||||||
int arg1, /* unused */
|
|
||||||
int arg2 /* unused */
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int rv; /* return value from a test */
|
int rv; /* return value from a test */
|
||||||
void *result; /* return value from timer wait routine */
|
void *result; /* return value from timer wait routine */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue