mirror of
https://github.com/eclipse-threadx/filex.git
synced 2026-09-14 12:36:59 +08:00
Updated copyright headers and removed revision history
* Updated version number constants * Updated copyright headers and removed revision history
This commit is contained in:
@@ -54,13 +54,13 @@ void filex_media_cache_invalidate_application_define(void *first_unused_memor
|
||||
#ifndef FX_STANDALONE_ENABLE
|
||||
UCHAR *pointer;
|
||||
|
||||
|
||||
|
||||
/* Setup the working pointer. */
|
||||
pointer = (UCHAR *) first_unused_memory;
|
||||
|
||||
/* Create the main thread. */
|
||||
tx_thread_create(&ftest_0, "thread 0", ftest_0_entry, 0,
|
||||
pointer, DEMO_STACK_SIZE,
|
||||
tx_thread_create(&ftest_0, "thread 0", ftest_0_entry, 0,
|
||||
pointer, DEMO_STACK_SIZE,
|
||||
4, 4, TX_NO_TIME_SLICE, TX_AUTO_START);
|
||||
|
||||
pointer = pointer + DEMO_STACK_SIZE;
|
||||
@@ -99,20 +99,20 @@ ULONG i;
|
||||
printf("FileX Test: Media cache invalidate test............................");
|
||||
|
||||
/* Format the media. This needs to be done before opening it! */
|
||||
status = fx_media_format(&ram_disk,
|
||||
status = fx_media_format(&ram_disk,
|
||||
_fx_ram_driver, // Driver entry
|
||||
ram_disk_memory, // RAM disk memory pointer
|
||||
cache_buffer, // Media buffer pointer
|
||||
CACHE_SIZE, // Media buffer size
|
||||
CACHE_SIZE, // Media buffer size
|
||||
"MY_RAM_DISK", // Volume Name
|
||||
1, // Number of FATs
|
||||
32, // Directory Entries
|
||||
0, // Hidden sectors
|
||||
256, // Total sectors
|
||||
128, // Sector size
|
||||
256, // Total sectors
|
||||
128, // Sector size
|
||||
1, // Sectors per cluster
|
||||
1, // Heads
|
||||
1); // Sectors per track
|
||||
1); // Sectors per track
|
||||
|
||||
/* Determine if the format had an error. */
|
||||
if (status)
|
||||
@@ -133,9 +133,9 @@ ULONG i;
|
||||
printf("ERROR!\n");
|
||||
test_control_return(21);
|
||||
}
|
||||
|
||||
|
||||
#ifndef FX_DISABLE_ERROR_CHECKING
|
||||
|
||||
|
||||
/* send a null pointer to generate an error */
|
||||
status = fx_media_cache_invalidate(FX_NULL);
|
||||
if (status != FX_PTR_ERROR)
|
||||
@@ -169,7 +169,7 @@ ULONG i;
|
||||
|
||||
/* Pickup the available bytes in the media. */
|
||||
status = fx_media_space_available(&ram_disk, &available_bytes);
|
||||
|
||||
|
||||
/* Check for available bytes error. */
|
||||
if ((status != FX_SUCCESS) || (available_bytes < sizeof(ULONG)))
|
||||
{
|
||||
@@ -183,7 +183,7 @@ ULONG i;
|
||||
write_value = 0;
|
||||
while (i < available_bytes)
|
||||
{
|
||||
|
||||
|
||||
/* Write 4 bytes to the file. */
|
||||
status = fx_file_write(&my_file, (void *) &write_value, sizeof(ULONG));
|
||||
|
||||
@@ -194,17 +194,17 @@ ULONG i;
|
||||
printf("ERROR!\n");
|
||||
test_control_return(6);
|
||||
}
|
||||
|
||||
|
||||
/* Increment byte count. */
|
||||
i = i + sizeof(ULONG);
|
||||
|
||||
|
||||
/* Increment write value. */
|
||||
write_value++;
|
||||
}
|
||||
|
||||
|
||||
/* Pickup the available bytes in the media again. */
|
||||
status = fx_media_space_available(&ram_disk, &i);
|
||||
|
||||
|
||||
/* Check for available bytes error. */
|
||||
if ((status != FX_SUCCESS) || (i != 0))
|
||||
{
|
||||
@@ -212,11 +212,11 @@ ULONG i;
|
||||
printf("ERROR!\n");
|
||||
test_control_return(7);
|
||||
}
|
||||
|
||||
/* At this point, we should invalidate the (which also flushes the cache) media to ensure that all
|
||||
|
||||
/* At this point, we should invalidate the (which also flushes the cache) media to ensure that all
|
||||
dirty sectors are written. */
|
||||
status = fx_media_cache_invalidate(&ram_disk);
|
||||
|
||||
|
||||
/* Check for flush errors. */
|
||||
if ((status != FX_SUCCESS) || (ram_disk.fx_media_sector_cache_dirty_count))
|
||||
{
|
||||
@@ -224,20 +224,20 @@ ULONG i;
|
||||
printf("ERROR!\n");
|
||||
test_control_return(8);
|
||||
}
|
||||
|
||||
|
||||
/* See if any sectors are still valid in the cache. */
|
||||
for (i = 0; i < FX_MAX_SECTOR_CACHE; i++)
|
||||
{
|
||||
|
||||
|
||||
/* Determine if this cache entry is still valid. */
|
||||
if (ram_disk.fx_media_sector_cache[i].fx_cached_sector_valid)
|
||||
{
|
||||
|
||||
|
||||
printf("ERROR!\n");
|
||||
test_control_return(81);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Seek to the beginning of the test file. */
|
||||
status = fx_file_seek(&my_file, 0);
|
||||
|
||||
@@ -254,7 +254,7 @@ ULONG i;
|
||||
read_value = 0;
|
||||
while (i < available_bytes)
|
||||
{
|
||||
|
||||
|
||||
/* Read 4 bytes from the file. */
|
||||
status = fx_file_read(&my_file, (void *) &read_value, sizeof(ULONG), &actual);
|
||||
|
||||
@@ -293,20 +293,20 @@ ULONG i;
|
||||
}
|
||||
|
||||
/* Reformat the media. This needs to be done before opening it! */
|
||||
status = fx_media_format(&ram_disk,
|
||||
status = fx_media_format(&ram_disk,
|
||||
_fx_ram_driver, // Driver entry
|
||||
ram_disk_memory, // RAM disk memory pointer
|
||||
cache_buffer, // Media buffer pointer
|
||||
CACHE_SIZE, // Media buffer size
|
||||
CACHE_SIZE, // Media buffer size
|
||||
"MY_RAM_DISK", // Volume Name
|
||||
1, // Number of FATs
|
||||
32, // Directory Entries
|
||||
0, // Hidden sectors
|
||||
256, // Total sectors
|
||||
128, // Sector size
|
||||
256, // Total sectors
|
||||
128, // Sector size
|
||||
1, // Sectors per cluster
|
||||
1, // Heads
|
||||
1); // Sectors per track
|
||||
1); // Sectors per track
|
||||
|
||||
/* Determine if the format had an error. */
|
||||
if (status)
|
||||
@@ -352,7 +352,7 @@ ULONG i;
|
||||
|
||||
/* Pickup the available bytes in the media. */
|
||||
status = fx_media_space_available(&ram_disk, &available_bytes);
|
||||
|
||||
|
||||
/* Check for available bytes error. */
|
||||
if ((status != FX_SUCCESS) || (available_bytes < sizeof(ULONG)))
|
||||
{
|
||||
@@ -366,7 +366,7 @@ ULONG i;
|
||||
write_value = 0;
|
||||
while (i < available_bytes)
|
||||
{
|
||||
|
||||
|
||||
/* Write 4 bytes to the file. */
|
||||
status = fx_file_write(&my_file, (void *) &write_value, sizeof(ULONG));
|
||||
|
||||
@@ -377,17 +377,17 @@ ULONG i;
|
||||
printf("ERROR!\n");
|
||||
test_control_return(18);
|
||||
}
|
||||
|
||||
|
||||
/* Increment byte count. */
|
||||
i = i + sizeof(ULONG);
|
||||
|
||||
|
||||
/* Increment write value. */
|
||||
write_value++;
|
||||
}
|
||||
|
||||
|
||||
/* Pickup the available bytes in the media again. */
|
||||
status = fx_media_space_available(&ram_disk, &i);
|
||||
|
||||
|
||||
/* Check for available bytes error. */
|
||||
if ((status != FX_SUCCESS) || (i != 0))
|
||||
{
|
||||
@@ -395,11 +395,11 @@ ULONG i;
|
||||
printf("ERROR!\n");
|
||||
test_control_return(19);
|
||||
}
|
||||
|
||||
/* At this point, we should invalidate the media to ensure that all
|
||||
|
||||
/* At this point, we should invalidate the media to ensure that all
|
||||
dirty sectors are written. */
|
||||
status = fx_media_cache_invalidate(&ram_disk);
|
||||
|
||||
|
||||
/* Check for flush errors. */
|
||||
if ((status != FX_SUCCESS) || (ram_disk.fx_media_sector_cache_dirty_count))
|
||||
{
|
||||
@@ -411,16 +411,16 @@ ULONG i;
|
||||
/* See if any sectors are still valid in the cache. */
|
||||
for (i = 0; i < ram_disk.fx_media_sector_cache_size; i++)
|
||||
{
|
||||
|
||||
|
||||
/* Determine if this cache entry is still valid. */
|
||||
if (ram_disk.fx_media_sector_cache[i].fx_cached_sector_valid)
|
||||
{
|
||||
|
||||
|
||||
printf("ERROR!\n");
|
||||
test_control_return(81);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Seek to the beginning of the test file. */
|
||||
status = fx_file_seek(&my_file, 0);
|
||||
|
||||
@@ -437,7 +437,7 @@ ULONG i;
|
||||
read_value = 0;
|
||||
while (i < available_bytes)
|
||||
{
|
||||
|
||||
|
||||
/* Read 4 bytes from the file. */
|
||||
status = fx_file_read(&my_file, (void *) &read_value, sizeof(ULONG), &actual);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user