forked from Imagelibrary/rtems
testsuite: Fix printk format warnings.
This commit is contained in:
@@ -1,19 +1,19 @@
|
|||||||
/*! @file
|
/*! @file
|
||||||
* @brief Check the behaviour of rtems_bdbuf_read() function
|
* @brief Check the behaviour of rtems_bdbuf_read() function
|
||||||
* with different reports from disk device driver.
|
* with different reports from disk device driver.
|
||||||
*
|
*
|
||||||
* Test sequence:
|
* Test sequence:
|
||||||
* -# Call rtems_bdbuf_read() function and return 0 from disk device
|
* -# Call rtems_bdbuf_read() function and return 0 from disk device
|
||||||
* driver ioctl() function, and the result of asynchronous read
|
* driver ioctl() function, and the result of asynchronous read
|
||||||
* complete notification is successful.
|
* complete notification is successful.
|
||||||
* -# Check that rtems_bdbuf_read() returns RTEMS_SUCCESSFUL and
|
* -# Check that rtems_bdbuf_read() returns RTEMS_SUCCESSFUL and
|
||||||
* provides buffer descriptor.
|
* provides buffer descriptor.
|
||||||
* -# Call rtems_bdbuf_read() function and return -1 from disk device
|
* -# Call rtems_bdbuf_read() function and return -1 from disk device
|
||||||
* driver ioctl() function (there will be no asynchronous read
|
* driver ioctl() function (there will be no asynchronous read
|
||||||
* complete notification).
|
* complete notification).
|
||||||
* -# Check that rtems_bdbuf_read() returns RTEMS_IO_ERROR.
|
* -# Check that rtems_bdbuf_read() returns RTEMS_IO_ERROR.
|
||||||
* -# Call rtems_bdbuf_read() function and return 0 from disk device
|
* -# Call rtems_bdbuf_read() function and return 0 from disk device
|
||||||
* driver ioctl() function, but the result of asynchronous read
|
* driver ioctl() function, but the result of asynchronous read
|
||||||
* complete notification is faulty (with some erroneous status).
|
* complete notification is faulty (with some erroneous status).
|
||||||
* -# Check that rtems_bdbuf_read() returns that status and does not
|
* -# Check that rtems_bdbuf_read() returns that status and does not
|
||||||
* return buffer descriptor.
|
* return buffer descriptor.
|
||||||
@@ -47,7 +47,7 @@ bdbuf_test1_1_main()
|
|||||||
* Create working thread that will call rtems_bdbuf_read() function.
|
* Create working thread that will call rtems_bdbuf_read() function.
|
||||||
*/
|
*/
|
||||||
START_THREAD(1, bdbuf_test1_1_thread1);
|
START_THREAD(1, bdbuf_test1_1_thread1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 1:
|
* Step 1:
|
||||||
* Check that rtems_bdbuf_read() returns RTEMS_SUCCESSFUL
|
* Check that rtems_bdbuf_read() returns RTEMS_SUCCESSFUL
|
||||||
@@ -91,7 +91,7 @@ bdbuf_test1_1_main()
|
|||||||
|
|
||||||
CONTINUE_THREAD(1);
|
CONTINUE_THREAD(1);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -147,4 +147,3 @@ bdbuf_test1_1_thread1(rtems_task_argument arg)
|
|||||||
|
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* driver reports failure in read complete notification.
|
* driver reports failure in read complete notification.
|
||||||
*
|
*
|
||||||
* Test sequence:
|
* Test sequence:
|
||||||
* -# Call rtems_bdbuf_read() function in thread #1 and block on
|
* -# Call rtems_bdbuf_read() function in thread #1 and block on
|
||||||
* waiting for read complete notification.
|
* waiting for read complete notification.
|
||||||
* -# Call rtems_bdbuf_read() function in thread #2 for the same
|
* -# Call rtems_bdbuf_read() function in thread #2 for the same
|
||||||
* block number. As the result it blocks on this read as well
|
* block number. As the result it blocks on this read as well
|
||||||
@@ -58,7 +58,7 @@ bdbuf_test1_2_main()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 2:
|
* Step 2:
|
||||||
* Thread #2 calls rtems_bdbuf_read() for the same
|
* Thread #2 calls rtems_bdbuf_read() for the same
|
||||||
* block number, as the result it shall block waiting
|
* block number, as the result it shall block waiting
|
||||||
* on buffer state change.
|
* on buffer state change.
|
||||||
*/
|
*/
|
||||||
@@ -86,7 +86,7 @@ bdbuf_test1_2_main()
|
|||||||
* As the result we will get read call to device driver.
|
* As the result we will get read call to device driver.
|
||||||
*/
|
*/
|
||||||
WAIT_DRV_MSG(&msg);
|
WAIT_DRV_MSG(&msg);
|
||||||
|
|
||||||
/* Check that thread #2 is still blocked */
|
/* Check that thread #2 is still blocked */
|
||||||
CHECK_THREAD_BLOCKED(2);
|
CHECK_THREAD_BLOCKED(2);
|
||||||
/*
|
/*
|
||||||
@@ -102,7 +102,7 @@ bdbuf_test1_2_main()
|
|||||||
CONTINUE_THREAD(2);
|
CONTINUE_THREAD(2);
|
||||||
TEST_CHECK_RESULT("5");
|
TEST_CHECK_RESULT("5");
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -160,4 +160,3 @@ bdbuf_test1_2_thread2(rtems_task_argument arg)
|
|||||||
|
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*! @file
|
/*! @file
|
||||||
* @brief Check how rtems_bdbuf_read() handles two readers waiting
|
* @brief Check how rtems_bdbuf_read() handles two readers waiting
|
||||||
* for a buffer with the same block number in cases when disk device
|
* for a buffer with the same block number in cases when disk device
|
||||||
* driver reports failure in read complete notification.
|
* driver reports failure in read complete notification.
|
||||||
*
|
*
|
||||||
* Test sequence:
|
* Test sequence:
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
* again so disk device ioctl() function is called again for this
|
* again so disk device ioctl() function is called again for this
|
||||||
* block number.
|
* block number.
|
||||||
* -# This time disk device reports success in read complete notification.
|
* -# This time disk device reports success in read complete notification.
|
||||||
* As the result rtems_bdbuf_read() in thread #2 shall return
|
* As the result rtems_bdbuf_read() in thread #2 shall return
|
||||||
* RTEMS_SUCCESSFUL and provide buffer descriptor.
|
* RTEMS_SUCCESSFUL and provide buffer descriptor.
|
||||||
* -# Call rtems_bdbuf_release() function in thread #2.
|
* -# Call rtems_bdbuf_release() function in thread #2.
|
||||||
* .
|
* .
|
||||||
@@ -59,7 +59,7 @@ bdbuf_test1_3_main()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 2:
|
* Step 2:
|
||||||
* Thread #2 calls rtems_bdbuf_read() for the same
|
* Thread #2 calls rtems_bdbuf_read() for the same
|
||||||
* block number, as the result it shall block waiting
|
* block number, as the result it shall block waiting
|
||||||
* on buffer state change.
|
* on buffer state change.
|
||||||
*/
|
*/
|
||||||
@@ -111,7 +111,7 @@ bdbuf_test1_3_main()
|
|||||||
*/
|
*/
|
||||||
CONTINUE_THREAD(2);
|
CONTINUE_THREAD(2);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -176,4 +176,3 @@ bdbuf_test1_3_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*! @file
|
/*! @file
|
||||||
* @brief Check how rtems_bdbuf_read() handles two readers waiting
|
* @brief Check how rtems_bdbuf_read() handles two readers waiting
|
||||||
* for a buffer with the same block number in cases when disk device
|
* for a buffer with the same block number in cases when disk device
|
||||||
* driver reports success in read complete notification.
|
* driver reports success in read complete notification.
|
||||||
*
|
*
|
||||||
* Test sequence:
|
* Test sequence:
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
* As the result rtems_bdbuf_read() function returns RTEMS_SUCCESSFUL
|
* As the result rtems_bdbuf_read() function returns RTEMS_SUCCESSFUL
|
||||||
* in thread #1.
|
* in thread #1.
|
||||||
* -# Thread #1 releases buffer with rtems_bdbuf_release() function.
|
* -# Thread #1 releases buffer with rtems_bdbuf_release() function.
|
||||||
* -# rtems_bdbuf_read() function in thread #2 unlocks and
|
* -# rtems_bdbuf_read() function in thread #2 unlocks and
|
||||||
* returns RTEMS_SUCCESSFUL.
|
* returns RTEMS_SUCCESSFUL.
|
||||||
* -# Call rtems_bdbuf_release() function in thread #2.
|
* -# Call rtems_bdbuf_release() function in thread #2.
|
||||||
* .
|
* .
|
||||||
@@ -57,7 +57,7 @@ bdbuf_test1_4_main()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 2:
|
* Step 2:
|
||||||
* Thread #2 calls rtems_bdbuf_read() for the same
|
* Thread #2 calls rtems_bdbuf_read() for the same
|
||||||
* block number, as the result it shall block waiting
|
* block number, as the result it shall block waiting
|
||||||
* on buffer state change (waiting on TRANSFER state).
|
* on buffer state change (waiting on TRANSFER state).
|
||||||
*/
|
*/
|
||||||
@@ -79,7 +79,7 @@ bdbuf_test1_4_main()
|
|||||||
WAIT_THREAD_SYNC(1);
|
WAIT_THREAD_SYNC(1);
|
||||||
TEST_CHECK_RESULT("3");
|
TEST_CHECK_RESULT("3");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check that thread #2 is still blocked.
|
* Check that thread #2 is still blocked.
|
||||||
*/
|
*/
|
||||||
CHECK_THREAD_BLOCKED(2);
|
CHECK_THREAD_BLOCKED(2);
|
||||||
@@ -104,7 +104,7 @@ bdbuf_test1_4_main()
|
|||||||
*/
|
*/
|
||||||
CONTINUE_THREAD(2);
|
CONTINUE_THREAD(2);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -119,8 +119,8 @@ bdbuf_test1_4_thread1(rtems_task_argument arg)
|
|||||||
* We will block on this read and meanwhile
|
* We will block on this read and meanwhile
|
||||||
* thread #2 will try to read the same block.
|
* thread #2 will try to read the same block.
|
||||||
* After blocking on read in thread #2, device
|
* After blocking on read in thread #2, device
|
||||||
* driver will notify successful completion of
|
* driver will notify successful completion of
|
||||||
* date transfer, and as the result this call
|
* date transfer, and as the result this call
|
||||||
* will return valid buffer.
|
* will return valid buffer.
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
||||||
@@ -156,8 +156,8 @@ bdbuf_test1_4_thread2(rtems_task_argument arg)
|
|||||||
* on data transfer operation, so we will block here as well.
|
* on data transfer operation, so we will block here as well.
|
||||||
*
|
*
|
||||||
* Step 5:
|
* Step 5:
|
||||||
* On step 4 thread #1 releases buffer and as the result
|
* On step 4 thread #1 releases buffer and as the result
|
||||||
* our read operation should finish with success.
|
* our read operation should finish with success.
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
||||||
if (rc != RTEMS_SUCCESSFUL)
|
if (rc != RTEMS_SUCCESSFUL)
|
||||||
@@ -177,5 +177,3 @@ bdbuf_test1_4_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* for a buffer that is owned by an application.
|
* for a buffer that is owned by an application.
|
||||||
*
|
*
|
||||||
* Test sequence:
|
* Test sequence:
|
||||||
* -# Call rtems_bdbuf_read() function in thread #1 and
|
* -# Call rtems_bdbuf_read() function in thread #1 and
|
||||||
* provide successful read complete notification for this operation.
|
* provide successful read complete notification for this operation.
|
||||||
* As the result rtems_bdbuf_read() returns RTEMS_SUCCESSFUL
|
* As the result rtems_bdbuf_read() returns RTEMS_SUCCESSFUL
|
||||||
* in thread #1.
|
* in thread #1.
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
* -# Call rtems_bdbuf_release() function in thread #1 in order to give
|
* -# Call rtems_bdbuf_release() function in thread #1 in order to give
|
||||||
* it back under control of bdbuf library.
|
* it back under control of bdbuf library.
|
||||||
* -# Buffer now is ready to be returned for another application and
|
* -# Buffer now is ready to be returned for another application and
|
||||||
* as the result rtems_bdbuf_read() unblocks and returns
|
* as the result rtems_bdbuf_read() unblocks and returns
|
||||||
* RTEMS_SUCCESSFUL in thread #2.
|
* RTEMS_SUCCESSFUL in thread #2.
|
||||||
* -# Call rtems_bdbuf_release() function in thread #2.
|
* -# Call rtems_bdbuf_release() function in thread #2.
|
||||||
*
|
*
|
||||||
@@ -56,7 +56,7 @@ bdbuf_test1_5_main()
|
|||||||
|
|
||||||
WAIT_THREAD_SYNC(1);
|
WAIT_THREAD_SYNC(1);
|
||||||
TEST_CHECK_RESULT("1");
|
TEST_CHECK_RESULT("1");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 2:
|
* Step 2:
|
||||||
* Thread #2 calls rtems_bdbuf_read() and blocks
|
* Thread #2 calls rtems_bdbuf_read() and blocks
|
||||||
@@ -85,8 +85,8 @@ bdbuf_test1_5_main()
|
|||||||
* Thread #2 release buffer.
|
* Thread #2 release buffer.
|
||||||
*/
|
*/
|
||||||
CONTINUE_THREAD(2);
|
CONTINUE_THREAD(2);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -145,4 +145,3 @@ bdbuf_test1_5_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ bdbuf_test2_1_main()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 2:
|
* Step 2:
|
||||||
* Thread #2 calls rtems_bdbuf_read() for the same
|
* Thread #2 calls rtems_bdbuf_read() for the same
|
||||||
* block number, as the result it shall block waiting
|
* block number, as the result it shall block waiting
|
||||||
* on buffer state change (waiting on TRANSFER state).
|
* on buffer state change (waiting on TRANSFER state).
|
||||||
*/
|
*/
|
||||||
@@ -121,7 +121,7 @@ bdbuf_test2_1_main()
|
|||||||
WAIT_DRV_MSG_WR(&msg);
|
WAIT_DRV_MSG_WR(&msg);
|
||||||
SEND_DRV_MSG(0, 0, RTEMS_SUCCESSFUL, 0);
|
SEND_DRV_MSG(0, 0, RTEMS_SUCCESSFUL, 0);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -136,8 +136,8 @@ bdbuf_test2_1_thread1(rtems_task_argument arg)
|
|||||||
* We will block on this read and meanwhile
|
* We will block on this read and meanwhile
|
||||||
* thread #2 will try to read the same block.
|
* thread #2 will try to read the same block.
|
||||||
* After blocking on read in thread #2, device
|
* After blocking on read in thread #2, device
|
||||||
* driver will notify successful completion of
|
* driver will notify successful completion of
|
||||||
* date transfer, and as the result this call
|
* date transfer, and as the result this call
|
||||||
* will return valid buffer.
|
* will return valid buffer.
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
||||||
@@ -173,8 +173,8 @@ bdbuf_test2_1_thread2(rtems_task_argument arg)
|
|||||||
* on data transfer operation, so we will block here as well.
|
* on data transfer operation, so we will block here as well.
|
||||||
*
|
*
|
||||||
* Step 5:
|
* Step 5:
|
||||||
* On step 4 thread #1 releases buffer and as the result
|
* On step 4 thread #1 releases buffer and as the result
|
||||||
* our read operation should finish with success.
|
* our read operation should finish with success.
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
||||||
if (rc != RTEMS_SUCCESSFUL)
|
if (rc != RTEMS_SUCCESSFUL)
|
||||||
@@ -194,4 +194,3 @@ bdbuf_test2_1_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Test sequence:
|
* Test sequence:
|
||||||
* -# Call rtems_bdbuf_read() function in thread #1 and block on
|
* -# Call rtems_bdbuf_read() function in thread #1 and block on
|
||||||
* waiting for read complete notification.
|
* waiting for read complete notification.
|
||||||
* -# Call rtems_bdbuf_read() function in thread #2 for
|
* -# Call rtems_bdbuf_read() function in thread #2 for
|
||||||
* the same block number. As the result it blocks on this read
|
* the same block number. As the result it blocks on this read
|
||||||
* as well (but it will block on transfer semaphore).
|
* as well (but it will block on transfer semaphore).
|
||||||
* -# Disk device reports success in read complete notification.
|
* -# Disk device reports success in read complete notification.
|
||||||
@@ -62,7 +62,7 @@ bdbuf_test2_2_main()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 2:
|
* Step 2:
|
||||||
* Thread #2 calls rtems_bdbuf_read() for the same
|
* Thread #2 calls rtems_bdbuf_read() for the same
|
||||||
* block number, as the result it shall block waiting
|
* block number, as the result it shall block waiting
|
||||||
* on buffer state change (waiting on TRANSFER state).
|
* on buffer state change (waiting on TRANSFER state).
|
||||||
*/
|
*/
|
||||||
@@ -121,7 +121,7 @@ bdbuf_test2_2_main()
|
|||||||
WAIT_DRV_MSG_WR(&msg);
|
WAIT_DRV_MSG_WR(&msg);
|
||||||
SEND_DRV_MSG(0, 0, RTEMS_SUCCESSFUL, 0);
|
SEND_DRV_MSG(0, 0, RTEMS_SUCCESSFUL, 0);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -136,8 +136,8 @@ bdbuf_test2_2_thread1(rtems_task_argument arg)
|
|||||||
* We will block on this read and meanwhile
|
* We will block on this read and meanwhile
|
||||||
* thread #2 will try to read the same block.
|
* thread #2 will try to read the same block.
|
||||||
* After blocking on read in thread #2, device
|
* After blocking on read in thread #2, device
|
||||||
* driver will notify successful completion of
|
* driver will notify successful completion of
|
||||||
* date transfer, and as the result this call
|
* date transfer, and as the result this call
|
||||||
* will return valid buffer.
|
* will return valid buffer.
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
||||||
@@ -173,8 +173,8 @@ bdbuf_test2_2_thread2(rtems_task_argument arg)
|
|||||||
* on data transfer operation, so we will block here as well.
|
* on data transfer operation, so we will block here as well.
|
||||||
*
|
*
|
||||||
* Step 5:
|
* Step 5:
|
||||||
* On step 4 thread #1 releases buffer and as the result
|
* On step 4 thread #1 releases buffer and as the result
|
||||||
* our read operation should finish with success.
|
* our read operation should finish with success.
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
rc = rtems_bdbuf_read(test_dd, TEST_BLK_NUM, &bd);
|
||||||
if (rc != RTEMS_SUCCESSFUL)
|
if (rc != RTEMS_SUCCESSFUL)
|
||||||
@@ -194,5 +194,3 @@ bdbuf_test2_2_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Test sequence:
|
* Test sequence:
|
||||||
* -# In thread #1 call rtems_bdbuf_get(#N) to get an empty block #N.
|
* -# In thread #1 call rtems_bdbuf_get(#N) to get an empty block #N.
|
||||||
* -# In thread #1 call rtems_bdbuf_release_modified() for previously
|
* -# In thread #1 call rtems_bdbuf_release_modified() for previously
|
||||||
* got buffer.
|
* got buffer.
|
||||||
* -# In thread #1 call rtems_bdbuf_read(#N) to get the same buffer
|
* -# In thread #1 call rtems_bdbuf_read(#N) to get the same buffer
|
||||||
* (after this call a buffer is in AVL tree with ACCESS_MODIFIED state).
|
* (after this call a buffer is in AVL tree with ACCESS_MODIFIED state).
|
||||||
@@ -79,7 +79,7 @@ bdbuf_test3_1_main()
|
|||||||
WAIT_THREAD_SYNC(2);
|
WAIT_THREAD_SYNC(2);
|
||||||
TEST_CHECK_RESULT("5");
|
TEST_CHECK_RESULT("5");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Release buffer in thread #2
|
* Release buffer in thread #2
|
||||||
*/
|
*/
|
||||||
CONTINUE_THREAD(2);
|
CONTINUE_THREAD(2);
|
||||||
@@ -91,7 +91,7 @@ bdbuf_test3_1_main()
|
|||||||
WAIT_DRV_MSG_WR(&msg);
|
WAIT_DRV_MSG_WR(&msg);
|
||||||
SEND_DRV_MSG(0, 0, RTEMS_SUCCESSFUL, 0);
|
SEND_DRV_MSG(0, 0, RTEMS_SUCCESSFUL, 0);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -107,11 +107,11 @@ bdbuf_test3_1_thread1(rtems_task_argument arg)
|
|||||||
* it in AVL tree with ACCESS state.
|
* it in AVL tree with ACCESS state.
|
||||||
* Step 2:
|
* Step 2:
|
||||||
* Call release_modified(bd);
|
* Call release_modified(bd);
|
||||||
* [Now we have one entry in modified list and it is still
|
* [Now we have one entry in modified list and it is still
|
||||||
* in AVL tree with MODIFIED state]
|
* in AVL tree with MODIFIED state]
|
||||||
* Step 3:
|
* Step 3:
|
||||||
* Call read(#N) to get the same buffer.
|
* Call read(#N) to get the same buffer.
|
||||||
* [An entry is found in AVL tree, removed from modified list and
|
* [An entry is found in AVL tree, removed from modified list and
|
||||||
* returned with state ACCESS_MODIFIED]
|
* returned with state ACCESS_MODIFIED]
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_get(test_dd, TEST_BLK_NUM_N, &bd);
|
rc = rtems_bdbuf_get(test_dd, TEST_BLK_NUM_N, &bd);
|
||||||
@@ -119,7 +119,7 @@ bdbuf_test3_1_thread1(rtems_task_argument arg)
|
|||||||
{
|
{
|
||||||
TEST_FAILED();
|
TEST_FAILED();
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = rtems_bdbuf_release_modified(bd);
|
rc = rtems_bdbuf_release_modified(bd);
|
||||||
if (rc != RTEMS_SUCCESSFUL)
|
if (rc != RTEMS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
@@ -136,7 +136,7 @@ bdbuf_test3_1_thread1(rtems_task_argument arg)
|
|||||||
|
|
||||||
/* Step 5:
|
/* Step 5:
|
||||||
* Call rtems_bdbuf_release(#N).
|
* Call rtems_bdbuf_release(#N).
|
||||||
* As the result buffer will be used by bdbuf to get
|
* As the result buffer will be used by bdbuf to get
|
||||||
* buffer #M for thread #2.
|
* buffer #M for thread #2.
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_release(bd);
|
rc = rtems_bdbuf_release(bd);
|
||||||
@@ -161,7 +161,7 @@ bdbuf_test3_1_thread2(rtems_task_argument arg)
|
|||||||
* In thread #2 call read/get(#M)
|
* In thread #2 call read/get(#M)
|
||||||
* [We ask for block number #M - there is no such entry in AVL,
|
* [We ask for block number #M - there is no such entry in AVL,
|
||||||
* and all the lists are empty (ready, lru, modified), as a result
|
* and all the lists are empty (ready, lru, modified), as a result
|
||||||
* this thread blocks on
|
* this thread blocks on
|
||||||
* rtems_bdbuf_wait(pool, &pool->waiting, &pool->wait_waiters)]
|
* rtems_bdbuf_wait(pool, &pool->waiting, &pool->wait_waiters)]
|
||||||
*/
|
*/
|
||||||
rc = rtems_bdbuf_get(test_dd, TEST_BLK_NUM_M, &bd);
|
rc = rtems_bdbuf_get(test_dd, TEST_BLK_NUM_M, &bd);
|
||||||
@@ -182,5 +182,3 @@ bdbuf_test3_1_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ bdbuf_test3_2_main()
|
|||||||
WAIT_DRV_MSG_WR(&msg);
|
WAIT_DRV_MSG_WR(&msg);
|
||||||
SEND_DRV_MSG(0, 0, RTEMS_SUCCESSFUL, 0);
|
SEND_DRV_MSG(0, 0, RTEMS_SUCCESSFUL, 0);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -187,7 +187,7 @@ bdbuf_test3_2_thread3(rtems_task_argument arg)
|
|||||||
printk("Thread #3 DEBLOCK\n");
|
printk("Thread #3 DEBLOCK\n");
|
||||||
|
|
||||||
CONTINUE_MAIN(3);
|
CONTINUE_MAIN(3);
|
||||||
|
|
||||||
rc = rtems_bdbuf_release_modified(bd);
|
rc = rtems_bdbuf_release_modified(bd);
|
||||||
if (rc != RTEMS_SUCCESSFUL)
|
if (rc != RTEMS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
@@ -196,4 +196,3 @@ bdbuf_test3_2_thread3(rtems_task_argument arg)
|
|||||||
|
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*! @file
|
/*! @file
|
||||||
* @brief Check how read/release work in case of only one buffer in ready list.
|
* @brief Check how read/release work in case of only one buffer in ready list.
|
||||||
*
|
*
|
||||||
* The same as Test 3.2, but instead of calling rtems_bdbuf_get() in
|
* The same as Test 3.2, but instead of calling rtems_bdbuf_get() in
|
||||||
* threads #1 and #2, it calls rtems_bdbuf_read().
|
* threads #1 and #2, it calls rtems_bdbuf_read().
|
||||||
*
|
*
|
||||||
* Test sequence:
|
* Test sequence:
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
* -# Call rtems_bdbuf_release(#N1) in thread #1.
|
* -# Call rtems_bdbuf_release(#N1) in thread #1.
|
||||||
* -# Check that only one thread (thread #2 or thread #3) got a buffer.
|
* -# Check that only one thread (thread #2 or thread #3) got a buffer.
|
||||||
* Another thread shall still be blocked.
|
* Another thread shall still be blocked.
|
||||||
* -# Call rtems_bdbuf_release(#N2) in thread #2 and check that
|
* -# Call rtems_bdbuf_release(#N2) in thread #2 and check that
|
||||||
* thread #3 got a buffer as the result.
|
* thread #3 got a buffer as the result.
|
||||||
* .
|
* .
|
||||||
*
|
*
|
||||||
@@ -113,7 +113,7 @@ bdbuf_test3_3_main()
|
|||||||
|
|
||||||
CHECK_NO_DRV_MSG();
|
CHECK_NO_DRV_MSG();
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -198,7 +198,7 @@ bdbuf_test3_3_thread3(rtems_task_argument arg)
|
|||||||
printk("Thread #3 DEBLOCK\n");
|
printk("Thread #3 DEBLOCK\n");
|
||||||
|
|
||||||
CONTINUE_MAIN(3);
|
CONTINUE_MAIN(3);
|
||||||
|
|
||||||
rc = rtems_bdbuf_release(bd);
|
rc = rtems_bdbuf_release(bd);
|
||||||
if (rc != RTEMS_SUCCESSFUL)
|
if (rc != RTEMS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
@@ -207,4 +207,3 @@ bdbuf_test3_3_thread3(rtems_task_argument arg)
|
|||||||
|
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ bdbuf_test4_1_main()
|
|||||||
* Call rtems_bdbuf_read(#N) in thread #2.
|
* Call rtems_bdbuf_read(#N) in thread #2.
|
||||||
*/
|
*/
|
||||||
CONTINUE_THREAD(2);
|
CONTINUE_THREAD(2);
|
||||||
|
|
||||||
/* Make sure that thread #2 blocks */
|
/* Make sure that thread #2 blocks */
|
||||||
CHECK_THREAD_BLOCKED(2);
|
CHECK_THREAD_BLOCKED(2);
|
||||||
TEST_CHECK_RESULT("2");
|
TEST_CHECK_RESULT("2");
|
||||||
@@ -70,7 +70,7 @@ bdbuf_test4_1_main()
|
|||||||
*/
|
*/
|
||||||
CONTINUE_THREAD(1);
|
CONTINUE_THREAD(1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setp 4:
|
* Setp 4:
|
||||||
* Wait for Write request to device driver.
|
* Wait for Write request to device driver.
|
||||||
*/
|
*/
|
||||||
@@ -107,7 +107,7 @@ bdbuf_test4_1_main()
|
|||||||
*/
|
*/
|
||||||
CONTINUE_THREAD(1);
|
CONTINUE_THREAD(1);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -127,7 +127,7 @@ bdbuf_test4_1_thread1(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CONTINUE_MAIN(1);
|
CONTINUE_MAIN(1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 3:
|
* Step 3:
|
||||||
* Call rtems_bdbuf_sync(#N)
|
* Call rtems_bdbuf_sync(#N)
|
||||||
@@ -174,5 +174,3 @@ bdbuf_test4_1_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ bdbuf_test4_2_main()
|
|||||||
/* Exit from thread #1 */
|
/* Exit from thread #1 */
|
||||||
CONTINUE_THREAD(1);
|
CONTINUE_THREAD(1);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -159,5 +159,3 @@ bdbuf_test4_2_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ bdbuf_test4_3_main()
|
|||||||
*/
|
*/
|
||||||
CONTINUE_THREAD(1);
|
CONTINUE_THREAD(1);
|
||||||
|
|
||||||
TEST_END();
|
TEST_STOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
static rtems_task
|
static rtems_task
|
||||||
@@ -153,5 +153,3 @@ bdbuf_test4_3_thread2(rtems_task_argument arg)
|
|||||||
}
|
}
|
||||||
THREAD_END();
|
THREAD_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#ifndef BDBUF_TESTS_H
|
#ifndef BDBUF_TESTS_H
|
||||||
#define BDBUF_TESTS_H
|
#define BDBUF_TESTS_H
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -74,8 +75,8 @@ enum bdbuf_test_msg_type {
|
|||||||
* Message used in communication between test disk driver
|
* Message used in communication between test disk driver
|
||||||
* and main test task.
|
* and main test task.
|
||||||
* All R/W requests obtained by driver (from bdbuf library)
|
* All R/W requests obtained by driver (from bdbuf library)
|
||||||
* are directed to main test task. Then main test task
|
* are directed to main test task. Then main test task
|
||||||
* sends a reply after which test disk driver notifies
|
* sends a reply after which test disk driver notifies
|
||||||
* bdbuf library about operation complete event.
|
* bdbuf library about operation complete event.
|
||||||
*/
|
*/
|
||||||
typedef struct bdbuf_test_msg {
|
typedef struct bdbuf_test_msg {
|
||||||
@@ -111,7 +112,7 @@ typedef struct test_ctx {
|
|||||||
* disk device driver.
|
* disk device driver.
|
||||||
*/
|
*/
|
||||||
Objects_Id test_qid;
|
Objects_Id test_qid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object ID for disk driver queue.
|
* Object ID for disk driver queue.
|
||||||
* Test task will send messages to this queue in reply
|
* Test task will send messages to this queue in reply
|
||||||
@@ -122,7 +123,7 @@ typedef struct test_ctx {
|
|||||||
/** Test name */
|
/** Test name */
|
||||||
const char *test_name;
|
const char *test_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Semaphore used for synchronization between test thread
|
* Semaphore used for synchronization between test thread
|
||||||
* and main test task.
|
* and main test task.
|
||||||
* Main test task blocks on one of these semaphores and an auxiliary thread
|
* Main test task blocks on one of these semaphores and an auxiliary thread
|
||||||
@@ -210,7 +211,7 @@ extern bool good_test_result;
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start thread number @p t_num_ with @p func_ function
|
* Start thread number @p t_num_ with @p func_ function
|
||||||
* as an entry point of the thread.
|
* as an entry point of the thread.
|
||||||
*
|
*
|
||||||
* @param t_num_ thread number.
|
* @param t_num_ thread number.
|
||||||
@@ -255,20 +256,20 @@ extern bool good_test_result;
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define WAIT_DRV_MSG_WR(msg_) \
|
#define WAIT_DRV_MSG_WR(msg_) \
|
||||||
do { \
|
do { \
|
||||||
WAIT_DRV_MSG(msg_); \
|
WAIT_DRV_MSG(msg_); \
|
||||||
if ((msg_)->val.driver_req.req != RTEMS_BLKIO_REQUEST || \
|
if ((msg_)->val.driver_req.req != RTEMS_BLKIO_REQUEST || \
|
||||||
(msg_)->val.driver_req.dd != test_dd || \
|
(msg_)->val.driver_req.dd != test_dd || \
|
||||||
((rtems_blkdev_request *) \
|
((rtems_blkdev_request *) \
|
||||||
((msg_)->val.driver_req.argp))->req != \
|
((msg_)->val.driver_req.argp))->req != \
|
||||||
RTEMS_BLKDEV_REQ_WRITE) \
|
RTEMS_BLKDEV_REQ_WRITE) \
|
||||||
{ \
|
{ \
|
||||||
printk("Unexpected message received by disk driver: " \
|
printk("Unexpected message received by disk driver: " \
|
||||||
"req - 0x%x (0x%x), dev - %d (%d)\n", \
|
"req - 0x%" PRIx32 " (0x%" PRIx32 "), dev - %p (%p)\n", \
|
||||||
(msg_)->val.driver_req.req, RTEMS_BLKIO_REQUEST, \
|
(msg_)->val.driver_req.req, RTEMS_BLKIO_REQUEST, \
|
||||||
(msg_)->val.driver_req.dd, test_dd); \
|
(msg_)->val.driver_req.dd, test_dd); \
|
||||||
return; \
|
return; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define CHECK_NO_DRV_MSG() \
|
#define CHECK_NO_DRV_MSG() \
|
||||||
@@ -298,7 +299,7 @@ extern bdbuf_test_msg test_drv_msg;
|
|||||||
* ioctl() function.
|
* ioctl() function.
|
||||||
* @param ret_errno_ errno value to set to errno variable.
|
* @param ret_errno_ errno value to set to errno variable.
|
||||||
* @param res_status_ In case return value from the ioctl()
|
* @param res_status_ In case return value from the ioctl()
|
||||||
* function is equal to 0, this value
|
* function is equal to 0, this value
|
||||||
* is used as status code in asynchronous
|
* is used as status code in asynchronous
|
||||||
* notification.
|
* notification.
|
||||||
* @param res_errno_ In case return value from the ioctl()
|
* @param res_errno_ In case return value from the ioctl()
|
||||||
@@ -333,7 +334,7 @@ extern bdbuf_test_msg test_drv_msg;
|
|||||||
* Block main test task until a thread passes back control
|
* Block main test task until a thread passes back control
|
||||||
* with CONTINUE_MAIN().
|
* with CONTINUE_MAIN().
|
||||||
*
|
*
|
||||||
* @param t_num_ thread number from which the main thread
|
* @param t_num_ thread number from which the main thread
|
||||||
* is waiting for a sync.
|
* is waiting for a sync.
|
||||||
*/
|
*/
|
||||||
#define WAIT_THREAD_SYNC(t_num_) \
|
#define WAIT_THREAD_SYNC(t_num_) \
|
||||||
@@ -457,7 +458,7 @@ extern bdbuf_test_msg test_drv_msg;
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define TEST_END() \
|
#define TEST_STOP() \
|
||||||
do { \
|
do { \
|
||||||
bdbuf_test_end(); \
|
bdbuf_test_end(); \
|
||||||
\
|
\
|
||||||
@@ -500,4 +501,3 @@ bdbuf_test_start_aux_task(rtems_name name,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* BDBUF_TESTS_H */
|
#endif /* BDBUF_TESTS_H */
|
||||||
|
|
||||||
|
|||||||
@@ -51,14 +51,14 @@ test_disk_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
|
|||||||
r->req == RTEMS_BLKDEV_REQ_WRITE ? "W" : "?");
|
r->req == RTEMS_BLKDEV_REQ_WRITE ? "W" : "?");
|
||||||
for (i = 0, sg = r->bufs; i < r->bufnum; i++, sg++)
|
for (i = 0, sg = r->bufs; i < r->bufnum; i++, sg++)
|
||||||
{
|
{
|
||||||
printk("[%d] ", sg->block);
|
printk("[%" PRIu32 "] ", sg->block);
|
||||||
}
|
}
|
||||||
printk("\n");
|
printk("\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printk("%s() Unexpected request comes %u\n",
|
printk("%s() Unexpected request comes %" PRIu32 "\n",
|
||||||
__FUNCTION__, req);
|
__FUNCTION__, req);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -151,4 +151,3 @@ test_disk_initialize(
|
|||||||
printk("TEST DISK - OK\n");
|
printk("TEST DISK - OK\n");
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ void Put_Error( uint32_t source, uint32_t error )
|
|||||||
}
|
}
|
||||||
else if (source == INTERNAL_ERROR_RTEMS_API ){
|
else if (source == INTERNAL_ERROR_RTEMS_API ){
|
||||||
if (error > RTEMS_NOT_IMPLEMENTED )
|
if (error > RTEMS_NOT_IMPLEMENTED )
|
||||||
printk("Unknown Internal Rtems Error (0x%08x)", error);
|
printk("Unknown Internal Rtems Error (0x%08" PRIx32 ")", error);
|
||||||
else
|
else
|
||||||
printk( "%s", rtems_status_text( error ) );
|
printk( "%s", rtems_status_text( error ) );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,12 +13,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TESTS_USE_PRINTK
|
|
||||||
#include <tmacros.h>
|
|
||||||
#include <rtems/print.h>
|
|
||||||
|
|
||||||
const char rtems_test_name[] = "SPPRINTK";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Undefined the RTEMS_PRINTF_ATTRIBUTE and make it nothing. The test code
|
* Undefined the RTEMS_PRINTF_ATTRIBUTE and make it nothing. The test code
|
||||||
* contained in the file is suppose to be wrong.
|
* contained in the file is suppose to be wrong.
|
||||||
@@ -26,6 +20,12 @@ const char rtems_test_name[] = "SPPRINTK";
|
|||||||
#undef RTEMS_PRINTF_ATTRIBUTE
|
#undef RTEMS_PRINTF_ATTRIBUTE
|
||||||
#define RTEMS_PRINTF_ATTRIBUTE(_a, _b)
|
#define RTEMS_PRINTF_ATTRIBUTE(_a, _b)
|
||||||
|
|
||||||
|
#define TESTS_USE_PRINTK
|
||||||
|
#include <tmacros.h>
|
||||||
|
#include <rtems/print.h>
|
||||||
|
|
||||||
|
const char rtems_test_name[] = "SPPRINTK";
|
||||||
|
|
||||||
/* forward declarations to avoid warnings */
|
/* forward declarations to avoid warnings */
|
||||||
rtems_task Init(rtems_task_argument argument);
|
rtems_task Init(rtems_task_argument argument);
|
||||||
int test_getchar(void);
|
int test_getchar(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user