11 Commits
Author SHA1 Message Date
Frédéric DesbiensandCopilot 3a17b07bf5 Flagged six FileX APIs as deprecated (#95)
Added #pragma message compile-time warnings and updated DESCRIPTION
blocks in:
  - fx_directory_long_name_get      -> use _extended (buffer size)
  - fx_directory_short_name_get     -> use _extended (buffer size)
  - fx_media_volume_get             -> use _extended (buffer size)
  - fx_unicode_length_get           -> use _extended (buffer size)
  - fx_unicode_name_get             -> use _extended (buffer size)
  - fx_unicode_short_name_get       -> use _extended (buffer size)

All six functions omit a destination buffer length parameter and use a
fixed or hardcoded limit, which can cause buffer overruns in the caller.
The corresponding _extended variants accept an explicit buffer size and
must be used instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-28 11:06:42 -04:00
Frédéric Desbiens b3c653c0c5 Merge remote-tracking branch 'origin/master' into dev 2026-07-22 16:06:44 -04:00
Frédéric DesbiensandCodex 9da40d41d7 Updated security policy (#96)
Co-authored-by: Codex <codex@openai.com>
2026-06-30 17:34:09 -04:00
Frédéric DesbiensandCopilot 7cbe022bab Added Win64/VS 2022 port for FileX (#94)
- New port: ports/win64/vs_2022/inc/fx_port.h
  - Based on the Win32 port; updated ALIGN_TYPE to ULONG64 for 64-bit
    pointers, added FX_REGRESSION_TEST hooks from the Linux port, and
    bumped the port name string to Win64/Visual.
- New CMake infrastructure: ports/win64/vs_2022/CMakeLists.txt
  - Exposes only the inc/ directory (port is header-only).
- Updated test/cmake/CMakeLists.txt
  - Added MSVC guards: skip -m32 / GCC coverage flags; locate VS 2022
    toolchain; build ThreadX from source alongside FileX via
    THREADX_SOURCE_DIR.
- Updated test/cmake/regression/CMakeLists.txt
  - Added MSVC-compatible compile options (/W3 /Zi instead of -Wall
    -fprofile-arcs); added win64_compat include path for standalone +
    MSVC builds; added per-test TIMEOUT overrides for the two inherently
    long-running fault-tolerant tests on Windows.
- Updated test/cmake/samples/CMakeLists.txt
  - Added MSVC-compatible flag handling.
- New PowerShell scripts: scripts/build_fx.ps1, scripts/test_fx.ps1,
  scripts/fx_windows_common.ps1
  - Support all 9 build configurations; -Clean, -Config, -Verbose flags;
    modelled on the ThreadX Win64 build/test scripts.
- New Windows compatibility shims for standalone builds:
  test/regression_test/win64_compat/pthread.h
  test/regression_test/win64_compat/unistd.h
  - Minimal pthreads (CreateThread / WaitForSingleObject / TerminateThread)
    and usleep (Sleep) shims so standalone test files compile on MSVC.
- Fixed test/regression_test/fx_ram_driver_test.c and .h
  - RAM driver: added bounds check so out-of-range sector READs use a
    safe scratch buffer instead of segfaulting.
  - MSVC: large test buffers (ram_disk_memory_large, large_data_buffer,
    and standalone-mode ram_disk_memory / ram_disk_memory1) moved from
    BSS to calloc() via a .CRT\ constructor.  This avoids the MSVC
    PE image 2 GB hard limit (LNK1248) and eliminates demand-zero page-
    fault overhead that would otherwise slow the test suite.
- Bulk-fixed 93 fault-tolerant test files
  - [FAULT_TOLERANT_SIZE] -> [FAULT_TOLERANT_SIZE > 0 ? FAULT_TOLERANT_SIZE : 1]
    so that MSVC C2466 (zero-length array) is not triggered when
    FX_ENABLE_FAULT_TOLERANT is not defined.
- Fixed filextestcontrol.c: standalone test runner thread exit
  - The Win64 pthread shim makes pthread_exit() a no-op so that
    test_control_thread_entry() proceeds to exit(failed_tests),
    giving ctest the correct process exit code.
- Fixed common/src/fx_utility_logical_sector_write.c
  - Added missing bounds guard to prevent sector-write past end of
    RAM disk during fault-tolerant interrupt simulation tests.

All 9 build configurations pass 136/136 regression tests on Win64/VS 2022.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-15 13:15:22 -04:00
Frédéric Desbiens b93ac4ae77 Merge pull request #92 from eclipse-threadx/dev
Merging changes for the v.6.5.1.202602 release
2026-06-08 10:10:18 +02:00
Frédéric DesbiensandCopilot 30e1d491a9 Added copyright headers to files missing them
Applied the standard MIT license header to all project-owned C, header,
assembly, shell, and Python files that were missing a copyright notice.
Third-party, toolchain startup, and auto-generated files were excluded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-06 21:48:17 +02:00
Frédéric DesbiensandCopilot c3e1f15536 Release 6.5.1.202602 preparation (#91)
* Updated version number constants

* Updated port version strings

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-04 17:15:54 -04:00
Frédéric DesbiensandCopilot 9940177b74 Added a release preparation script (#90)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-04 17:13:47 -04:00
Frédéric Desbiens 2ca9829ddb Merge pull request #89 from Ralino/fix-add-missing-flush-on-format
Added flush call to fx_media_format
2026-06-03 14:55:36 -04:00
Frédéric DesbiensandCopilot edc2427de6 Fixed flush call in fx_media_format to mirror fx_media_close pattern
- Added blank line after #ifndef FX_MEDIA_STATISTICS_DISABLE for style consistency
- Used local driver variable instead of media_ptr->fx_media_driver_entry
- Removed early return on flush failure so FX_DRIVER_UNINIT is always
  called after FX_DRIVER_INIT, preventing driver resource leaks

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-02 11:42:41 -04:00
Thomas Friedel 339082886f Add flush call to fx_media_format
Adds a call to the I/O driver with FX_DRIVER_FLUSH to fx_media_format()
before uninitializing the driver.

Fixes Issue #88
2026-03-16 15:59:29 +01:00
169 changed files with 3612 additions and 70 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
# Set up the project # Set up the project
project(filex project(filex
LANGUAGES C ASM LANGUAGES C
) )
+30 -11
View File
@@ -1,20 +1,39 @@
# Security Policy # Security Policy
This Eclipse Foundation Project adheres to the [Eclipse Foundation Vulnerability Reporting Policy](https://www.eclipse.org/security/policy/).
## How To Report a Vulnerability
If you think you have found a vulnerability in this repository, please report it to us through coordinated disclosure.
**Please do not report security vulnerabilities through public issues, discussions, or change requests.**
Instead, [report it privately here](https://github.com/eclipse-threadx/filex/security/advisories/new) on GitHub
You can find more information about reporting and disclosure at the [Eclipse Foundation Security page](https://www.eclipse.org/security/).
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
* The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
* Affected version(s)
* Impact of the issue, including how an attacker might exploit the issue
* Step-by-step instructions to reproduce the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Full paths of source file(s) related to the manifestation of the issue
* Configuration required to reproduce the issue
* Log files that are related to this issue (if possible)
* Proof-of-concept or exploit code (if possible)
This information will help us triage your report more quickly.
## Supported Versions ## Supported Versions
| Version | Supported | | Version | Supported |
| ------- | ------------------ | | ------- | ------------------ |
| 6.4.x | :white_check_mark: | | 6.5.x | :white_check_mark: |
## Reporting a Vulnerability Eclipse ThreadX publishes a release every quarter. There are no long-term support branches or backports to older releases.
If you think you have found a vulnerability in <project> you can report it using one of the following ways: Normally, fixes for non-critical vulnerabilities will ship in a regularly scheduled quarterly release. If fixes for an urgent or critical vulnerability must ship quickly, then the project will publish a hotfix release of the affected component(s) without waiting for the next quarterly release.
* Contact the [Eclipse Foundation Security Team](mailto:security@eclipse-foundation.org) You can learn more about the [project's release cadence in this blog post](https://blogs.eclipse.org/post/fr%C3%A9d%C3%A9ric-desbiens/eclipse-threadx-more-predictable-more-open).
* [Report a Vulnerability](https://github.com/eclipse-threadx/filex/security/advisories/new)
You can find more information about reporting and disclosure at the [Eclipse Foundation Security page](https://www.eclipse.org/security/).
## Security Policy
This project follows [Eclipse Foundation Vulnerability Reporting Policy](https://www.eclipse.org/security/policy/).
+2 -2
View File
@@ -86,8 +86,8 @@ extern "C" {
#define AZURE_RTOS_FILEX #define AZURE_RTOS_FILEX
#define FILEX_MAJOR_VERSION 6 #define FILEX_MAJOR_VERSION 6
#define FILEX_MINOR_VERSION 5 #define FILEX_MINOR_VERSION 5
#define FILEX_PATCH_VERSION 0 #define FILEX_PATCH_VERSION 1
#define FILEX_BUILD_VERSION 202601 #define FILEX_BUILD_VERSION 202602
#define FILEX_HOTFIX_VERSION ' ' #define FILEX_HOTFIX_VERSION ' '
/* Define the following symbols for backward compatibility */ /* Define the following symbols for backward compatibility */
+13 -1
View File
@@ -29,6 +29,17 @@
#include "fx_directory.h" #include "fx_directory.h"
/* DEPRECATION NOTICE
* fx_directory_long_name_get() is deprecated. Do not use it in new code.
*
* WHY: Does not accept a destination buffer length; writes up to FX_MAX_LONG_NAME_LEN bytes regardless of the caller's buffer size, risking a buffer overrun.
*
* WHAT TO DO: replace calls with fx_directory_long_name_get_extended(), passing the actual
* destination buffer size as an additional argument.
*/
#pragma message("fx_directory_long_name_get() is deprecated. " \
"Use fx_directory_long_name_get_extended() and pass the actual buffer size.")
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* FUNCTION RELEASE */ /* FUNCTION RELEASE */
@@ -45,7 +56,8 @@
/* name. If there is no long file name, the short file name will be */ /* name. If there is no long file name, the short file name will be */
/* returned. */ /* returned. */
/* */ /* */
/* Note, this API is deprecated as fx_directory_long_name_get_extended */ /* DEPRECATED. Use fx_directory_long_name_get_extended() instead, passing the actual
destination buffer length. Does not accept a destination buffer length; writes up to FX_MAX_LONG_NAME_LEN bytes regardless of the caller's buffer size, risking a buffer overrun.
/* should be used. The maximum written size to long_file_name could be */ /* should be used. The maximum written size to long_file_name could be */
/* FX_MAX_LONG_NAME_LEN. */ /* FX_MAX_LONG_NAME_LEN. */
/* */ /* */
+13 -1
View File
@@ -29,6 +29,17 @@
#include "fx_directory.h" #include "fx_directory.h"
/* DEPRECATION NOTICE
* fx_directory_short_name_get() is deprecated. Do not use it in new code.
*
* WHY: Does not accept a destination buffer length; writes up to FX_MAX_SHORT_NAME_LEN bytes regardless of the caller's buffer size, risking a buffer overrun.
*
* WHAT TO DO: replace calls with fx_directory_short_name_get_extended(), passing the actual
* destination buffer size as an additional argument.
*/
#pragma message("fx_directory_short_name_get() is deprecated. " \
"Use fx_directory_short_name_get_extended() and pass the actual buffer size.")
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* FUNCTION RELEASE */ /* FUNCTION RELEASE */
@@ -45,7 +56,8 @@
/* name. If the long file name is really a short file name, the short */ /* name. If the long file name is really a short file name, the short */
/* file name will be returned. */ /* file name will be returned. */
/* */ /* */
/* Note, this API is deprecated as fx_directory_short_name_get_extended*/ /* DEPRECATED. Use fx_directory_short_name_get_extended() instead, passing the actual
destination buffer length. Does not accept a destination buffer length; writes up to FX_MAX_SHORT_NAME_LEN bytes regardless of the caller's buffer size, risking a buffer overrun.
/* should be used. The maximum written size to short_file_name could */ /* should be used. The maximum written size to short_file_name could */
/* be FX_MAX_SHORT_NAME_LEN. */ /* be FX_MAX_SHORT_NAME_LEN. */
/* */ /* */
+16
View File
@@ -669,6 +669,22 @@ UINT sectors_per_fat, f, s;
} }
} }
#ifndef FX_MEDIA_STATISTICS_DISABLE
/* Increment the number of driver flush requests. */
media_ptr -> fx_media_driver_flush_requests++;
#endif
/* Build the "flush" I/O driver request. */
media_ptr -> fx_media_driver_request = FX_DRIVER_FLUSH;
media_ptr -> fx_media_driver_status = FX_IO_ERROR;
/* If trace is enabled, insert this event into the trace buffer. */
FX_TRACE_IN_LINE_INSERT(FX_TRACE_INTERNAL_IO_DRIVER_FLUSH, media_ptr, 0, 0, 0, FX_TRACE_INTERNAL_EVENTS, 0, 0)
/* Call the specified I/O driver with the flush request. */
(driver)(media_ptr);
/* Build the "uninitialize" I/O driver request. */ /* Build the "uninitialize" I/O driver request. */
media_ptr -> fx_media_driver_request = FX_DRIVER_UNINIT; media_ptr -> fx_media_driver_request = FX_DRIVER_UNINIT;
media_ptr -> fx_media_driver_status = FX_IO_ERROR; media_ptr -> fx_media_driver_status = FX_IO_ERROR;
+13 -1
View File
@@ -32,6 +32,17 @@
#include "fx_utility.h" #include "fx_utility.h"
/* DEPRECATION NOTICE
* fx_media_volume_get() is deprecated. Do not use it in new code.
*
* WHY: Does not accept a volume-name buffer length; writes up to 12 bytes regardless of the caller's buffer size, risking a buffer overrun.
*
* WHAT TO DO: replace calls with fx_media_volume_get_extended(), passing the actual
* destination buffer size as an additional argument.
*/
#pragma message("fx_media_volume_get() is deprecated. " \
"Use fx_media_volume_get_extended() and pass the actual buffer size.")
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* FUNCTION RELEASE */ /* FUNCTION RELEASE */
@@ -47,7 +58,8 @@
/* This function reads the volume name stored in the media's boot */ /* This function reads the volume name stored in the media's boot */
/* record or root directory. */ /* record or root directory. */
/* */ /* */
/* Note, this API is deprecated as fx_media_volume_get_extended should */ /* DEPRECATED. Use fx_media_volume_get_extended() instead, passing the actual
destination buffer length. Does not accept a volume-name buffer length; writes up to 12 bytes regardless of the caller's buffer size, risking a buffer overrun.
/* be used. The maximum written size to volume_name could be 12. */ /* be used. The maximum written size to volume_name could be 12. */
/* */ /* */
/* INPUT */ /* INPUT */
+13 -1
View File
@@ -29,6 +29,17 @@
#include "fx_unicode.h" #include "fx_unicode.h"
/* DEPRECATION NOTICE
* fx_unicode_length_get() is deprecated. Do not use it in new code.
*
* WHY: Does not accept a buffer length; scans up to 256 bytes regardless of the actual buffer size, risking an overread.
*
* WHAT TO DO: replace calls with fx_unicode_length_get_extended(), passing the actual
* destination buffer size as an additional argument.
*/
#pragma message("fx_unicode_length_get() is deprecated. " \
"Use fx_unicode_length_get_extended() and pass the actual buffer size.")
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* FUNCTION RELEASE */ /* FUNCTION RELEASE */
@@ -43,7 +54,8 @@
/* */ /* */
/* This function returns the length of the supplied unicode name. */ /* This function returns the length of the supplied unicode name. */
/* */ /* */
/* Note, this API is deprecated as _fx_unicode_length_get_extended */ /* DEPRECATED. Use fx_unicode_length_get_extended() instead, passing the actual
destination buffer length. Does not accept a buffer length; scans up to 256 bytes regardless of the actual buffer size, risking an overread.
/* should be used. The maximum buffer size of unicode_name is 256. */ /* should be used. The maximum buffer size of unicode_name is 256. */
/* */ /* */
/* INPUT */ /* INPUT */
+13 -1
View File
@@ -29,6 +29,17 @@
#include "fx_unicode.h" #include "fx_unicode.h"
/* DEPRECATION NOTICE
* fx_unicode_name_get() is deprecated. Do not use it in new code.
*
* WHY: Does not accept a destination buffer length; writes up to FX_MAX_LONG_NAME_LEN*2 bytes regardless of the caller's buffer size, risking a buffer overrun.
*
* WHAT TO DO: replace calls with fx_unicode_name_get_extended(), passing the actual
* destination buffer size as an additional argument.
*/
#pragma message("fx_unicode_name_get() is deprecated. " \
"Use fx_unicode_name_get_extended() and pass the actual buffer size.")
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* FUNCTION RELEASE */ /* FUNCTION RELEASE */
@@ -44,7 +55,8 @@
/* This function finds the unicode name associated with the supplied */ /* This function finds the unicode name associated with the supplied */
/* short 8.3 name. */ /* short 8.3 name. */
/* */ /* */
/* Note, this API is deprecated as fx_unicode_name_get_extended should */ /* DEPRECATED. Use fx_unicode_name_get_extended() instead, passing the actual
destination buffer length. Does not accept a destination buffer length; writes up to FX_MAX_LONG_NAME_LEN*2 bytes regardless of the caller's buffer size, risking a buffer overrun.
/* be used. The maximum written size to destination_unicode_name could */ /* be used. The maximum written size to destination_unicode_name could */
/* be FX_MAX_LONG_NAME_LEN * 2. */ /* be FX_MAX_LONG_NAME_LEN * 2. */
/* */ /* */
+13 -1
View File
@@ -29,6 +29,17 @@
#include "fx_unicode.h" #include "fx_unicode.h"
/* DEPRECATION NOTICE
* fx_unicode_short_name_get() is deprecated. Do not use it in new code.
*
* WHY: Does not accept a destination buffer length; writes up to 13 bytes regardless of the caller's buffer size, risking a buffer overrun.
*
* WHAT TO DO: replace calls with fx_unicode_short_name_get_extended(), passing the actual
* destination buffer size as an additional argument.
*/
#pragma message("fx_unicode_short_name_get() is deprecated. " \
"Use fx_unicode_short_name_get_extended() and pass the actual buffer size.")
/**************************************************************************/ /**************************************************************************/
/* */ /* */
/* FUNCTION RELEASE */ /* FUNCTION RELEASE */
@@ -44,7 +55,8 @@
/* This function finds the short name associated with the supplied */ /* This function finds the short name associated with the supplied */
/* unicode name. */ /* unicode name. */
/* */ /* */
/* Note, this API is deprecated as fx_unicode_short_name_get_extended */ /* DEPRECATED. Use fx_unicode_short_name_get_extended() instead, passing the actual
destination buffer length. Does not accept a destination buffer length; writes up to 13 bytes regardless of the caller's buffer size, risking a buffer overrun.
/* should be used. The maximum written size to destination_short_name */ /* should be used. The maximum written size to destination_short_name */
/* could be 13. */ /* could be 13. */
/* */ /* */
@@ -306,8 +306,6 @@ UCHAR cache_found = FX_FALSE;
return(FX_SECTOR_INVALID); return(FX_SECTOR_INVALID);
} }
/* Just write the buffer to the media. */
#ifndef FX_MEDIA_STATISTICS_DISABLE #ifndef FX_MEDIA_STATISTICS_DISABLE
/* Increment the number of driver write sector(s) requests. */ /* Increment the number of driver write sector(s) requests. */
+1 -1
View File
@@ -206,7 +206,7 @@ typedef unsigned long long ULONG64;
#ifdef FX_SYSTEM_INIT #ifdef FX_SYSTEM_INIT
CHAR _fx_version_id[] = CHAR _fx_version_id[] =
"(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * FileX Generic Version 6.5.0.202601 *"; "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * FileX Generic Version 6.5.1.202602 *";
#else #else
extern CHAR _fx_version_id[]; extern CHAR _fx_version_id[];
#endif #endif
+1 -1
View File
@@ -331,7 +331,7 @@ extern VOID fault_tolerant_apply_log_callback(struct FX_MEDIA_STRUCT *media_ptr,
#ifdef FX_SYSTEM_INIT #ifdef FX_SYSTEM_INIT
CHAR _fx_version_id[] = CHAR _fx_version_id[] =
"(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * FileX Linux/GCC Version 6.5.0.202601 *"; "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * FileX Linux/GCC Version 6.5.1.202602 *";
#else #else
extern CHAR _fx_version_id[]; extern CHAR _fx_version_id[];
#endif #endif
+1 -1
View File
@@ -196,7 +196,7 @@ typedef unsigned long long ULONG64;
#ifdef FX_SYSTEM_INIT #ifdef FX_SYSTEM_INIT
CHAR _fx_version_id[] = CHAR _fx_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * FileX Win32/Version 6.4.1 *"; "Copyright (c) 2024 Microsoft Corporation. * FileX Win32/Version 6.5.1.202602 *";
* Copyright (c) 2026-present Eclipse ThreadX contributors * Copyright (c) 2026-present Eclipse ThreadX contributors
#else #else
extern CHAR _fx_version_id[]; extern CHAR _fx_version_id[];
+10
View File
@@ -0,0 +1,10 @@
target_sources(${PROJECT_NAME} PRIVATE
# {{BEGIN_TARGET_SOURCES}}
# {{END_TARGET_SOURCES}}
)
target_include_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
+368
View File
@@ -0,0 +1,368 @@
/***************************************************************************
* Copyright (C) 2026 Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* AI Disclosure: This file was largely AI-generated by Copilot (Claude Sonnet 4.6).
* The AI-generated portions may be considered public domain (CC0-1.0)
* and not subject to the project's licence. The human contributor has
* reviewed and verified that the code is correct.
*
* SPDX-License-Identifier: MIT and CC0-1.0
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** FileX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/* */
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* fx_port.h Win64/Visual */
/* 6.5.1.202602 */
/* */
/* AUTHOR */
/* */
/* Eclipse ThreadX contributors */
/* */
/* DESCRIPTION */
/* */
/* This file contains data type definitions that make the FileX FAT */
/* compatible file system function identically on a variety of */
/* different processor architectures. For example, the byte offset of */
/* various entries in the boot record, and directory entries are */
/* defined in this file. */
/* */
/**************************************************************************/
#ifndef FX_PORT_H
#define FX_PORT_H
/* Determine if the optional FileX user define file should be used. */
#ifdef FX_INCLUDE_USER_DEFINE_FILE
/* Yes, include the user defines in fx_user.h. The defines in this file may
alternately be defined on the command line. */
#include "fx_user.h"
#endif
#include <stdio.h>
/* Include the ThreadX api file. */
#ifndef FX_STANDALONE_ENABLE
#include "tx_api.h"
/* Define ULONG64 typedef, if not already defined. */
#ifndef ULONG64_DEFINED
#define ULONG64_DEFINED
typedef unsigned long long ULONG64;
#endif
#else
/* Define compiler library include files. */
#include <stdint.h>
#include <stdlib.h>
#ifndef VOID
#define VOID void
typedef char CHAR;
typedef char BOOL;
typedef unsigned char UCHAR;
typedef int INT;
typedef unsigned int UINT;
typedef long LONG;
typedef unsigned long ULONG;
typedef short SHORT;
typedef unsigned short USHORT;
#endif
#ifndef ULONG64_DEFINED
#define ULONG64_DEFINED
typedef unsigned long long ULONG64;
#endif
/* Define basic alignment type used in block and byte pool operations. This data type must
be at least 32-bits in size and also be large enough to hold a pointer type.
On Win64, pointers are 64 bits so ULONG (32-bit on Windows LLP64) is insufficient. */
#ifndef ALIGN_TYPE_DEFINED
#define ALIGN_TYPE_DEFINED
#define ALIGN_TYPE ULONG64
#endif
#endif /* FX_STANDALONE_ENABLE */
#ifdef FX_REGRESSION_TEST
/* Define parameters for regression test suite. */
#define FX_MAX_SECTOR_CACHE 256
#define FX_MAX_FAT_CACHE 64
#define FX_FAT_MAP_SIZE 1
/* Define variables and macros used to introduce errors for the regression test suite. */
extern ULONG _fx_ram_driver_io_error_request;
extern ULONG _fx_ram_driver_io_request_count;
extern ULONG _fx_file_open_max_file_size_request;
extern ULONG _fx_directory_entry_read_count;
extern ULONG _fx_directory_entry_read_error_request;
extern ULONG _fx_directory_entry_write_count;
extern ULONG _fx_directory_entry_write_error_request;
extern ULONG _fx_utility_fat_entry_write_count;
extern ULONG _fx_utility_fat_entry_write_error_request;
extern ULONG _fx_utility_fat_entry_read_count;
extern ULONG _fx_utility_fat_entry_read_error_request;
extern ULONG _fx_utility_logical_sector_flush_count;
extern ULONG _fx_utility_logical_sector_flush_error_request;
extern ULONG _fx_utility_logical_sector_write_count;
extern ULONG _fx_utility_logical_sector_write_error_request;
extern ULONG _fx_utility_logical_sector_read_count;
extern ULONG _fx_utility_logical_sector_read_error_request;
extern ULONG _fx_utility_logical_sector_read_1_count;
extern ULONG _fx_utility_logical_sector_read_1_error_request;
#ifdef FX_ENABLE_FAULT_TOLERANT
struct FX_MEDIA_STRUCT;
extern VOID fault_tolerant_enable_callback(struct FX_MEDIA_STRUCT *media_ptr,
UCHAR *fault_tolerant_memory_buffer,
ULONG log_size);
extern VOID fault_tolerant_apply_log_callback(struct FX_MEDIA_STRUCT *media_ptr,
UCHAR *fault_tolerant_memory_buffer,
ULONG log_size);
#endif /* FX_ENABLE_FAULT_TOLERANT */
#define FX_DIRECTORY_ENTRY_READ_EXTENSION _fx_directory_entry_read_count++; \
if (_fx_directory_entry_read_error_request) \
{ \
_fx_directory_entry_read_error_request--; \
if (_fx_directory_entry_read_error_request == 0) \
{ \
return(FX_IO_ERROR); \
} \
}
#define FX_DIRECTORY_ENTRY_WRITE_EXTENSION _fx_directory_entry_write_count++; \
if (_fx_directory_entry_write_error_request) \
{ \
_fx_directory_entry_write_error_request--; \
if (_fx_directory_entry_write_error_request == 0) \
{ \
return(FX_IO_ERROR); \
} \
}
#define FX_UTILITY_FAT_ENTRY_READ_EXTENSION _fx_utility_fat_entry_read_count++; \
if (_fx_utility_fat_entry_read_error_request) \
{ \
_fx_utility_fat_entry_read_error_request--; \
if (_fx_utility_fat_entry_read_error_request == 0) \
{ \
return(FX_IO_ERROR); \
} \
if (_fx_utility_fat_entry_read_error_request == 10000) \
{ \
*entry_ptr = 1; \
_fx_utility_fat_entry_read_error_request = 0; \
return(FX_SUCCESS); \
} \
if (_fx_utility_fat_entry_read_error_request == 20000) \
{ \
*entry_ptr = media_ptr -> fx_media_fat_reserved; \
_fx_utility_fat_entry_read_error_request = 0; \
return(FX_SUCCESS); \
} \
if (_fx_utility_fat_entry_read_error_request == 30000) \
{ \
*entry_ptr = cluster; \
_fx_utility_fat_entry_read_error_request = 0; \
return(FX_SUCCESS); \
} \
if (_fx_utility_fat_entry_read_error_request == 40000) \
{ \
media_ptr -> fx_media_total_clusters = 0; \
_fx_utility_fat_entry_read_error_request = 0; \
return(FX_SUCCESS); \
} \
}
#define FX_UTILITY_FAT_ENTRY_WRITE_EXTENSION _fx_utility_fat_entry_write_count++; \
if (_fx_utility_fat_entry_write_error_request) \
{ \
_fx_utility_fat_entry_write_error_request--; \
if (_fx_utility_fat_entry_write_error_request == 0) \
{ \
return(FX_IO_ERROR); \
} \
}
#define FX_UTILITY_LOGICAL_SECTOR_FLUSH_EXTENSION _fx_utility_logical_sector_flush_count++; \
if (_fx_utility_logical_sector_flush_error_request) \
{ \
_fx_utility_logical_sector_flush_error_request--; \
if (_fx_utility_logical_sector_flush_error_request == 0) \
{ \
return(FX_IO_ERROR); \
} \
}
#define FX_UTILITY_LOGICAL_SECTOR_READ_EXTENSION _fx_utility_logical_sector_read_count++; \
if (_fx_utility_logical_sector_read_error_request) \
{ \
_fx_utility_logical_sector_read_error_request--; \
if (_fx_utility_logical_sector_read_error_request == 0) \
{ \
return(FX_IO_ERROR); \
} \
}
#define FX_UTILITY_LOGICAL_SECTOR_READ_EXTENSION_1 _fx_utility_logical_sector_read_1_count++; \
if (_fx_utility_logical_sector_read_1_error_request) \
{ \
_fx_utility_logical_sector_read_1_error_request--; \
if (_fx_utility_logical_sector_read_1_error_request == 0) \
{ \
cache_entry = FX_NULL; \
} \
}
#define FX_UTILITY_LOGICAL_SECTOR_WRITE_EXTENSION _fx_utility_logical_sector_write_count++; \
if (_fx_utility_logical_sector_write_error_request) \
{ \
_fx_utility_logical_sector_write_error_request--; \
if (_fx_utility_logical_sector_write_error_request == 0) \
{ \
return(FX_IO_ERROR); \
} \
}
#define FX_FAULT_TOLERANT_ENABLE_EXTENSION fault_tolerant_enable_callback(media_ptr, media_ptr -> fx_media_fault_tolerant_memory_buffer, total_size);
#define FX_FAULT_TOLERANT_APPLY_LOGS_EXTENSION fault_tolerant_apply_log_callback(media_ptr, media_ptr -> fx_media_fault_tolerant_memory_buffer, size);
#endif /* FX_REGRESSION_TEST */
/* Define FileX internal protection macros. If FX_SINGLE_THREAD is defined,
these protection macros are effectively disabled. However, for multi-thread
uses, the macros are setup to utilize a ThreadX mutex for multiple thread
access control into an open media. */
/* Reduce the mutex error checking for testing purpose. */
#if defined(FX_SINGLE_THREAD) || defined(FX_STANDALONE_ENABLE)
#define FX_PROTECT
#define FX_UNPROTECT
#else
#define FX_PROTECT tx_mutex_get(&(media_ptr -> fx_media_protect), TX_WAIT_FOREVER);
#define FX_UNPROTECT tx_mutex_put(&(media_ptr -> fx_media_protect));
#endif
/* Define interrupt lockout constructs to protect the system date/time from being updated
while they are being read. */
#ifndef FX_STANDALONE_ENABLE
#define FX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define FX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define FX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
#else
#ifndef FX_LEGACY_INTERRUPT_PROTECTION
#define FX_LEGACY_INTERRUPT_PROTECTION
#endif
#define FX_INT_SAVE_AREA
#define FX_DISABLE_INTS
#define FX_RESTORE_INTS
#endif
/* Define the error checking logic to determine if there is a caller error in the FileX API.
The default definitions assume ThreadX is being used. This code can be completely turned
off by just defining these macros to white space. */
#ifndef FX_STANDALONE_ENABLE
#ifndef TX_TIMER_PROCESS_IN_ISR
#define FX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \
extern TX_THREAD _tx_timer_thread; \
extern volatile ULONG _tx_thread_system_state;
#define FX_CALLER_CHECKING_CODE if ((_tx_thread_system_state) || \
(_tx_thread_current_ptr == TX_NULL) || \
(_tx_thread_current_ptr == &_tx_timer_thread)) \
return(FX_CALLER_ERROR);
#else
#define FX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \
extern volatile ULONG _tx_thread_system_state;
#define FX_CALLER_CHECKING_CODE if ((_tx_thread_system_state) || \
(_tx_thread_current_ptr == TX_NULL)) \
return(FX_CALLER_ERROR);
#endif
#else
#define FX_CALLER_CHECKING_EXTERNS
#define FX_CALLER_CHECKING_CODE
#endif
/* Define the update rate of the system timer. These values may also be defined at the command
line when compiling the fx_system_initialize.c module in the FileX library build. Alternatively,
they can be modified in this file or fx_user.h. Note: the update rate must be an even number of
seconds greater than or equal to 2, which is the minimal update rate for FAT time. */
/* Define the number of seconds the timer parameters are updated in FileX. The default
value is 10 seconds. This value can be overwritten externally. */
#ifndef FX_UPDATE_RATE_IN_SECONDS
#define FX_UPDATE_RATE_IN_SECONDS 10
#endif
/* Defines the number of ThreadX timer ticks required to achieve the update rate specified by
FX_UPDATE_RATE_IN_SECONDS defined previously. By default, the ThreadX timer tick is 10ms,
so the default value for this constant is 1000. If TX_TIMER_TICKS_PER_SECOND is defined,
this value is derived from TX_TIMER_TICKS_PER_SECOND. */
#ifndef FX_UPDATE_RATE_IN_TICKS
#if (defined(TX_TIMER_TICKS_PER_SECOND) && (!defined(FX_STANDALONE_ENABLE)))
#define FX_UPDATE_RATE_IN_TICKS (TX_TIMER_TICKS_PER_SECOND * FX_UPDATE_RATE_IN_SECONDS)
#else
#define FX_UPDATE_RATE_IN_TICKS 1000
#endif
#endif
/* Define the version ID of FileX. This may be utilized by the application. */
#ifdef FX_SYSTEM_INIT
CHAR _fx_version_id[] =
"Copyright (c) 2026 Eclipse ThreadX contributors. * FileX Win64/Visual 6.5.1.202602 *";
#else
extern CHAR _fx_version_id[];
#endif
#endif /* FX_PORT_H */
+11
View File
@@ -1,2 +1,13 @@
#!/bin/bash #!/bin/bash
##############################################################################
# Copyright (c) 2024 Microsoft Corporation
# Copyright (c) 2026 Eclipse ThreadX contributors
#
# This program and the accompanying materials are made available under the
# terms of the MIT License which is available at
# https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: MIT
##############################################################################
$(dirname `realpath $0`)/../test/cmake/run.sh build all $(dirname `realpath $0`)/../test/cmake/run.sh build all
+69
View File
@@ -0,0 +1,69 @@
[CmdletBinding()]
param(
[ValidateSet('win64', 'win32')]
[string]$Arch = 'win64',
[AllowNull()]
[object]$Configuration = 'all',
[int]$Parallel = [Math]::Max(1, [Environment]::ProcessorCount),
[int]$BuildTimeoutSeconds = 120,
[string]$BuildDir,
[string]$ThreadXDir,
[switch]$Clean
)
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot 'fx_windows_common.ps1')
$repoRoot = Split-Path -Parent $PSScriptRoot
$settings = Get-PortSettings -SelectedArch $Arch
if (-not $BuildDir) {
$BuildDir = Join-Path $repoRoot "build\tests\$Arch"
}
if (-not $ThreadXDir) {
$ThreadXDir = Join-Path (Split-Path -Parent $repoRoot) 'threadx-fd-codex'
}
$selectedConfigurations = Resolve-RegressionConfigurations -RequestedConfigurations $Configuration
Write-Host "Selected configurations: $($selectedConfigurations -join ', ')"
Enter-VisualStudioDevShell -VsArch $settings.VsArch
foreach ($currentConfiguration in $selectedConfigurations) {
$currentBuildDirName = Get-RegressionBuildDirectoryName -ConfigurationName $currentConfiguration
$currentBuildDir = Join-Path $BuildDir $currentBuildDirName
if ($Clean) {
Remove-BuildDirectory -Path $currentBuildDir -RepoRoot $repoRoot
}
Remove-NinjaLock -Path $currentBuildDir
Write-Host "Configuring $Arch / $currentConfiguration"
Invoke-NativeCommand -FilePath 'cmake' -Arguments @(
'-S', (Join-Path $repoRoot 'test\cmake'),
'-B', $currentBuildDir,
'-G', 'Ninja',
'-DCMAKE_C_COMPILER_FORCED=TRUE',
'-DCMAKE_C_COMPILER_WORKS=TRUE',
'-DCMAKE_C_ABI_COMPILED=TRUE',
# FileX's root CMakeLists.txt declares LANGUAGES C ASM; suppress the
# ASM compiler probe because the win64 port has no assembly sources.
'-DCMAKE_ASM_COMPILER_FORCED=TRUE',
'-DCMAKE_ASM_COMPILER_WORKS=TRUE',
"-DCMAKE_BUILD_TYPE=$currentConfiguration",
"-DTHREADX_ARCH=$($settings.FileXArch)",
"-DTHREADX_TOOLCHAIN=$($settings.FileXToolchain)",
"-DTHREADX_SOURCE_DIR=$ThreadXDir"
)
Write-Host "Building $Arch / $currentConfiguration"
Invoke-CMakeBuild -BuildDir $currentBuildDir -Parallel $Parallel -TimeoutSeconds $BuildTimeoutSeconds
}
+939
View File
@@ -0,0 +1,939 @@
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
function Invoke-NativeCommand {
param(
[Parameter(Mandatory = $true)]
[string]$FilePath,
[Parameter()]
[string[]]$Arguments = @()
)
& $FilePath @Arguments
if ($LASTEXITCODE -ne 0) {
throw "Command failed with exit code ${LASTEXITCODE}: $FilePath $($Arguments -join ' ')"
}
}
function Get-CommandPathIfAvailable {
param(
[Parameter(Mandatory = $true)]
[string]$CommandName
)
$command = Get-Command $CommandName -ErrorAction SilentlyContinue
if ($null -eq $command) {
return $null
}
return $command.Source
}
function Get-PortSettings {
param(
[Parameter(Mandatory = $true)]
[string]$SelectedArch
)
switch ($SelectedArch) {
'win32' {
return @{
FileXArch = 'win32'
FileXToolchain = 'vs_2019'
VsArch = 'x86'
}
}
'win64' {
return @{
FileXArch = 'win64'
FileXToolchain = 'vs_2022'
VsArch = 'amd64'
}
}
default {
throw "Unsupported architecture: $SelectedArch"
}
}
}
function Get-RegressionConfigurations {
return @(
'default_build_coverage',
'no_cache_build',
'no_cache_standalone_build',
'fault_tolerant_build_coverage',
'no_check_build',
'no_cache_fault_tolerant_build',
'standalone_build_coverage',
'standalone_fault_tolerant_build_coverage',
'standalone_no_cache_fault_tolerant_build'
)
}
function Resolve-RegressionConfigurations {
param(
[Parameter(Mandatory = $false)]
[AllowNull()]
[AllowEmptyCollection()]
[object]$RequestedConfigurations = 'all'
)
$allConfigurations = Get-RegressionConfigurations
$resolvedConfigurations = @()
if ($null -eq $RequestedConfigurations) {
$resolvedConfigurations = @('all')
}
elseif ($RequestedConfigurations -is [System.Array]) {
foreach ($requestedConfiguration in $RequestedConfigurations) {
if ($null -ne $requestedConfiguration) {
$resolvedConfigurations += [string]$requestedConfiguration
}
}
}
else {
$resolvedConfigurations = @([string]$RequestedConfigurations)
}
$normalizedConfigurations = @()
foreach ($requestedConfiguration in $resolvedConfigurations) {
foreach ($configurationPart in ($requestedConfiguration -split ',')) {
$trimmedConfiguration = $configurationPart.Trim()
if ($trimmedConfiguration.Length -gt 0) {
$normalizedConfigurations += $trimmedConfiguration
}
}
}
if (($normalizedConfigurations.Count -eq 0) -or ($normalizedConfigurations -contains 'all')) {
return $allConfigurations
}
foreach ($normalizedConfiguration in $normalizedConfigurations) {
if ($allConfigurations -notcontains $normalizedConfiguration) {
throw "Unsupported configuration: $normalizedConfiguration"
}
}
return $normalizedConfigurations
}
function Get-RegressionBuildDirectoryName {
param(
[Parameter(Mandatory = $true)]
[string]$ConfigurationName
)
switch ($ConfigurationName) {
'default_build_coverage' { return 'dbc' }
'no_cache_build' { return 'nc' }
'no_cache_standalone_build' { return 'ncs' }
'fault_tolerant_build_coverage' { return 'ft' }
'no_check_build' { return 'nck' }
'no_cache_fault_tolerant_build' { return 'ncft' }
'standalone_build_coverage' { return 'sa' }
'standalone_fault_tolerant_build_coverage' { return 'saft' }
'standalone_no_cache_fault_tolerant_build' { return 'sancft' }
default {
throw "Unsupported configuration: $ConfigurationName"
}
}
}
function Enter-VisualStudioDevShell {
param(
[Parameter(Mandatory = $true)]
[string]$VsArch
)
$targetArch = switch ($VsArch) {
'amd64' { 'x64' }
'x86' { 'x86' }
default { $VsArch }
}
if ((Get-Command cl -ErrorAction SilentlyContinue) -and ($env:VSCMD_ARG_TGT_ARCH -eq $targetArch)) {
return
}
$vsWherePath = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
if (-not (Test-Path -LiteralPath $vsWherePath)) {
throw "Unable to locate vswhere.exe at $vsWherePath"
}
$installationPath = & $vsWherePath -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $installationPath) {
throw 'Unable to locate a Visual Studio 2022 installation with MSVC build tools.'
}
$launchScript = Join-Path $installationPath 'Common7\Tools\Launch-VsDevShell.ps1'
if (-not (Test-Path -LiteralPath $launchScript)) {
throw "Unable to locate Launch-VsDevShell.ps1 at $launchScript"
}
$env:VSCMD_SKIP_SENDTELEMETRY = '1'
& $launchScript -VsInstallationPath $installationPath -Arch $VsArch -HostArch amd64 -SkipAutomaticLocation | Out-Null
if (-not (Get-Command cl -ErrorAction SilentlyContinue)) {
throw 'MSVC compiler environment was not activated successfully.'
}
}
function Remove-BuildDirectory {
param(
[Parameter(Mandatory = $true)]
[string]$Path,
[Parameter(Mandatory = $true)]
[string]$RepoRoot
)
$fullRepoRoot = [System.IO.Path]::GetFullPath($RepoRoot)
$fullPath = [System.IO.Path]::GetFullPath($Path)
if (-not $fullPath.StartsWith($fullRepoRoot, [System.StringComparison]::OrdinalIgnoreCase)) {
throw "Refusing to remove a directory outside the repository: $fullPath"
}
if (Test-Path -LiteralPath $fullPath) {
try {
Remove-Item -LiteralPath $fullPath -Recurse -Force -ErrorAction Stop
return
} catch {
Write-Warning "Failed to remove build directory '$fullPath': $($_.Exception.Message)"
}
Get-ChildItem -LiteralPath $fullPath -Force -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
try {
if (($_.Attributes -band [System.IO.FileAttributes]::ReadOnly) -ne 0) {
$_.Attributes = ($_.Attributes -band (-bnot [System.IO.FileAttributes]::ReadOnly))
}
} catch {
}
}
try {
Remove-Item -LiteralPath $fullPath -Recurse -Force -ErrorAction Stop
} catch {
Write-Warning "Proceeding with partially cleaned build directory '$fullPath': $($_.Exception.Message)"
}
}
}
function Remove-CtestTestingDirectory {
param(
[Parameter(Mandatory = $true)]
[string]$Path
)
if (-not (Test-Path -LiteralPath $Path)) {
return
}
try {
Remove-Item -LiteralPath $Path -Recurse -Force -ErrorAction Stop
return
} catch {
Write-Warning "Failed to remove CTest directory '$Path': $($_.Exception.Message)"
}
Get-ChildItem -LiteralPath $Path -Force -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
try {
if (($_.Attributes -band [System.IO.FileAttributes]::ReadOnly) -ne 0) {
$_.Attributes = ($_.Attributes -band (-bnot [System.IO.FileAttributes]::ReadOnly))
}
} catch {
}
}
try {
Remove-Item -LiteralPath $Path -Recurse -Force -ErrorAction Stop
} catch {
Write-Warning "Proceeding with partially cleaned CTest directory '$Path': $($_.Exception.Message)"
}
}
function Remove-NinjaLock {
param(
[Parameter(Mandatory = $true)]
[string]$Path
)
$ninjaLockPath = Join-Path $Path '.ninja_lock'
if (Test-Path -LiteralPath $ninjaLockPath) {
Remove-Item -LiteralPath $ninjaLockPath -Force
}
}
function Get-WindowsDebuggerPath {
$debuggerPath = Get-CommandPathIfAvailable -CommandName 'cdb.exe'
if ($debuggerPath) {
return $debuggerPath
}
$candidatePaths = @(
(Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\10\Debuggers\x64\cdb.exe'),
(Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\10\Debuggers\x86\cdb.exe')
)
foreach ($candidatePath in $candidatePaths) {
if (Test-Path -LiteralPath $candidatePath) {
return $candidatePath
}
}
return $null
}
function Get-SanitizedFileName {
param(
[Parameter(Mandatory = $true)]
[string]$Name
)
$safeName = [regex]::Replace($Name, '[<>:"/\\|?*]', '_')
$safeName = $safeName -replace '\s+', '_'
return $safeName
}
function Initialize-MinidumpSupport {
if ($null -ne ('FileX.WindowsMiniDump' -as [type])) {
return
}
Add-Type -TypeDefinition @'
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace FileX
{
public static class WindowsMiniDump
{
[DllImport("Dbghelp.dll", SetLastError = true)]
private static extern bool MiniDumpWriteDump(
IntPtr hProcess,
uint processId,
IntPtr hFile,
uint dumpType,
IntPtr exceptionParam,
IntPtr userStreamParam,
IntPtr callbackParam);
[DllImport("kernel32.dll", SetLastError = true)]
private static extern IntPtr OpenProcess(uint desiredAccess, bool inheritHandle, int processId);
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool CloseHandle(IntPtr handle);
private const uint ProcessQueryInformation = 0x0400U;
private const uint ProcessVmRead = 0x0010U;
private const uint ProcessDupHandle = 0x0040U;
public static bool WriteDump(int processId, string dumpPath, uint dumpType, out int errorCode)
{
IntPtr processHandle = OpenProcess(ProcessQueryInformation | ProcessVmRead | ProcessDupHandle, false, processId);
if (processHandle == IntPtr.Zero)
{
errorCode = Marshal.GetLastWin32Error();
return false;
}
try
{
using (FileStream dumpStream = new FileStream(dumpPath, FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
{
bool success = MiniDumpWriteDump(
processHandle,
unchecked((uint)processId),
dumpStream.SafeFileHandle.DangerousGetHandle(),
dumpType,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero);
errorCode = success ? 0 : Marshal.GetLastWin32Error();
return success;
}
}
finally
{
CloseHandle(processHandle);
}
}
}
}
'@
}
function Wait-FileReadable {
param(
[Parameter(Mandatory = $true)]
[string]$Path,
[Parameter()]
[int]$TimeoutSeconds = 10
)
$deadline = (Get-Date).AddSeconds($TimeoutSeconds)
while ((Get-Date) -lt $deadline) {
if (-not (Test-Path -LiteralPath $Path)) {
Start-Sleep -Milliseconds 200
continue
}
try {
$fileStream = [System.IO.File]::Open($Path, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite)
$fileStream.Dispose()
return $true
}
catch {
Start-Sleep -Milliseconds 200
}
}
return $false
}
function Get-CtestTestMetadata {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir
)
$ctestOutput = & ctest --test-dir $BuildDir --show-only=json-v1
if ($LASTEXITCODE -ne 0) {
throw "Unable to enumerate ctest metadata in $BuildDir"
}
return (($ctestOutput -join [Environment]::NewLine) | ConvertFrom-Json).tests
}
function Get-CtestFailedTestNames {
param(
[Parameter(Mandatory = $true)]
[string]$TestingTemporaryDir
)
$lastFailedPath = Join-Path $TestingTemporaryDir 'LastTestsFailed.log'
if (-not (Test-Path -LiteralPath $lastFailedPath)) {
return @()
}
$failedTestNames = @()
foreach ($logLine in (Get-Content -LiteralPath $lastFailedPath)) {
if ([string]::IsNullOrWhiteSpace($logLine)) {
continue
}
if ($logLine -match '^\s*\d+:(?<name>.+)\s*$') {
$failedTestNames += $Matches['name'].Trim()
}
else {
$failedTestNames += $logLine.Trim()
}
}
return $failedTestNames
}
function Invoke-ProcessDumpCapture {
param(
[Parameter(Mandatory = $true)]
[int]$ProcessId,
[Parameter(Mandatory = $true)]
[string]$DumpPath,
[Parameter()]
[int]$TimeoutSeconds = 15
)
$outputDirectory = Split-Path -Parent $DumpPath
if (-not (Test-Path -LiteralPath $outputDirectory)) {
New-Item -ItemType Directory -Path $outputDirectory | Out-Null
}
Remove-Item -LiteralPath $DumpPath -Force -ErrorAction SilentlyContinue
Initialize-MinidumpSupport
$dumpType = [uint32]0x00001006
$errorCode = 0
$dumpCaptured = [FileX.WindowsMiniDump]::WriteDump($ProcessId, $DumpPath, $dumpType, [ref]$errorCode)
if (-not $dumpCaptured) {
Write-Warning "MiniDumpWriteDump failed for PID ${ProcessId} with Win32 error $errorCode"
return $false
}
return (Test-Path -LiteralPath $DumpPath)
}
function Invoke-DumpStackAnalysis {
param(
[Parameter(Mandatory = $true)]
[string]$DumpPath,
[Parameter(Mandatory = $true)]
[string]$OutputBasePath,
[Parameter()]
[string]$SymbolPath,
[Parameter()]
[int]$TimeoutSeconds = 15
)
if (-not (Test-Path -LiteralPath $DumpPath)) {
Write-Warning "Skipping dump analysis because the dump file was not created: $DumpPath"
return $false
}
if (-not (Wait-FileReadable -Path $DumpPath)) {
Write-Warning "Skipping dump analysis because the dump file is not readable yet: $DumpPath"
return $false
}
$debuggerPath = Get-WindowsDebuggerPath
if (-not $debuggerPath) {
Write-Warning 'Skipping dump analysis because cdb.exe is not available.'
return $false
}
$outputDirectory = Split-Path -Parent $OutputBasePath
if (-not (Test-Path -LiteralPath $outputDirectory)) {
New-Item -ItemType Directory -Path $outputDirectory | Out-Null
}
$stdoutPath = "${OutputBasePath}.stdout.txt"
$stderrPath = "${OutputBasePath}.stderr.txt"
$commandFilePath = "${OutputBasePath}.commands.txt"
Set-Content -LiteralPath $commandFilePath -Value @(
'!runaway 7'
'~* kb 200'
'q'
) -Encoding Ascii
$cdbArguments = @(
'-lines',
'-z', $DumpPath
)
if ($SymbolPath) {
$cdbArguments += @('-y', $SymbolPath)
}
$cdbArguments += @('-cf', $commandFilePath)
$cdbProcess = Start-Process -FilePath $debuggerPath -ArgumentList $cdbArguments -PassThru -NoNewWindow `
-RedirectStandardOutput $stdoutPath -RedirectStandardError $stderrPath
try {
$cdbProcess | Wait-Process -Timeout $TimeoutSeconds -ErrorAction Stop
}
catch {
if (-not $cdbProcess.HasExited) {
$null = Start-Process -FilePath 'taskkill.exe' -ArgumentList @('/PID', $cdbProcess.Id.ToString(), '/T', '/F') `
-WindowStyle Hidden -Wait -PassThru
}
}
return $true
}
function Invoke-ProcessWithTimeout {
param(
[Parameter(Mandatory = $true)]
[string]$FilePath,
[Parameter()]
[string[]]$Arguments = @(),
[Parameter()]
[int]$TimeoutSeconds = 0,
[Parameter()]
[string]$WorkingDirectory,
[Parameter()]
[string]$RedirectStandardOutputPath,
[Parameter()]
[string]$RedirectStandardErrorPath,
[Parameter()]
[scriptblock]$OnTimeout,
[Parameter()]
[scriptblock]$PostTimeout
)
$argumentList = @()
foreach ($argument in $Arguments) {
if ($argument -match '\s|"') {
$argumentList += '"' + ($argument -replace '"', '\"') + '"'
}
else {
$argumentList += $argument
}
}
$startProcessParameters = @{
FilePath = $FilePath
NoNewWindow = $true
PassThru = $true
}
if ($argumentList.Count -gt 0) {
$startProcessParameters['ArgumentList'] = $argumentList
}
if ($WorkingDirectory) {
$startProcessParameters['WorkingDirectory'] = $WorkingDirectory
}
if ($RedirectStandardOutputPath) {
$startProcessParameters['RedirectStandardOutput'] = $RedirectStandardOutputPath
}
if ($RedirectStandardErrorPath) {
$startProcessParameters['RedirectStandardError'] = $RedirectStandardErrorPath
}
$process = Start-Process @startProcessParameters
if ($TimeoutSeconds -le 0) {
$process | Wait-Process
$completed = $true
}
else {
try {
$process | Wait-Process -Timeout $TimeoutSeconds -ErrorAction Stop
$completed = $true
}
catch {
$completed = $false
}
}
if (-not $completed) {
if ($null -ne $OnTimeout) {
& $OnTimeout $process
}
$null = Start-Process -FilePath 'taskkill.exe' -ArgumentList @('/PID', $process.Id.ToString(), '/T', '/F') -WindowStyle Hidden -Wait -PassThru
if ($null -ne $PostTimeout) {
& $PostTimeout $process
}
return @{
Completed = $false
ExitCode = $null
ProcessId = $process.Id
}
}
$process.Refresh()
return @{
Completed = $true
ExitCode = $process.ExitCode
ProcessId = $process.Id
}
}
function Invoke-CtestFailureDiagnostics {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir,
[Parameter(Mandatory = $true)]
[string]$TestingTemporaryDir,
[Parameter(Mandatory = $true)]
[int]$TimeoutSeconds
)
$failedTestNames = Get-CtestFailedTestNames -TestingTemporaryDir $TestingTemporaryDir
if ($failedTestNames.Count -eq 0) {
Write-Warning "No failed tests were recorded in $TestingTemporaryDir"
return
}
$testMetadataList = Get-CtestTestMetadata -BuildDir $BuildDir
$testMetadataMap = @{}
foreach ($testMetadata in $testMetadataList) {
$testMetadataMap[$testMetadata.name] = $testMetadata
}
$diagnosticsRoot = Join-Path $TestingTemporaryDir 'FailureDiagnostics'
if (-not (Test-Path -LiteralPath $diagnosticsRoot)) {
New-Item -ItemType Directory -Path $diagnosticsRoot | Out-Null
}
foreach ($failedTestName in $failedTestNames) {
if (-not $testMetadataMap.ContainsKey($failedTestName)) {
Write-Warning "Unable to locate ctest metadata for failed test: $failedTestName"
continue
}
$testMetadata = $testMetadataMap[$failedTestName]
if (($null -eq $testMetadata.command) -or ($testMetadata.command.Count -eq 0)) {
Write-Warning "No executable command was recorded for failed test: $failedTestName"
continue
}
$testArguments = @()
if ($testMetadata.command.Count -gt 1) {
$testArguments = @($testMetadata.command[1..($testMetadata.command.Count - 1)])
}
$safeTestName = Get-SanitizedFileName -Name $failedTestName
$stdoutPath = Join-Path $diagnosticsRoot "${safeTestName}.stdout.txt"
$stderrPath = Join-Path $diagnosticsRoot "${safeTestName}.stderr.txt"
$debugOutputBasePath = Join-Path $diagnosticsRoot "${safeTestName}.cdb"
$workingDirectory = $null
$symbolDirectory = Split-Path -Parent $testMetadata.command[0]
if ($null -ne $testMetadata.properties) {
foreach ($testProperty in $testMetadata.properties) {
if ($testProperty.name -eq 'WORKING_DIRECTORY') {
$workingDirectory = $testProperty.value
break
}
}
}
Write-Warning "Collecting failure diagnostics for $failedTestName"
$dumpPath = '{0}.{1}.dmp' -f $debugOutputBasePath, ([DateTime]::UtcNow.ToString('yyyyMMddHHmmssfff'))
$testResult = Invoke-ProcessWithTimeout -FilePath $testMetadata.command[0] -Arguments $testArguments `
-TimeoutSeconds $TimeoutSeconds -WorkingDirectory $workingDirectory -RedirectStandardOutputPath $stdoutPath `
-RedirectStandardErrorPath $stderrPath -OnTimeout {
param($timedOutProcess)
Invoke-ProcessDumpCapture -ProcessId $timedOutProcess.Id -DumpPath $dumpPath | Out-Null
} -PostTimeout {
param($timedOutProcess)
if (Test-Path -LiteralPath $dumpPath) {
Invoke-DumpStackAnalysis -DumpPath $dumpPath -OutputBasePath $debugOutputBasePath -SymbolPath $symbolDirectory | Out-Null
}
}
if (-not $testResult.Completed) {
Write-Warning "Timeout diagnostics were captured for $failedTestName under $diagnosticsRoot"
continue
}
Write-Warning "Replay finished for $failedTestName with exit code $($testResult.ExitCode). Output was saved under $diagnosticsRoot"
}
}
function Test-IsNinjaBuildDirectory {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir
)
return (Test-Path -LiteralPath (Join-Path $BuildDir 'build.ninja'))
}
function Get-NinjaBuildStatements {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir
)
$buildNinjaPath = Join-Path $BuildDir 'build.ninja'
if (-not (Test-Path -LiteralPath $buildNinjaPath)) {
throw "Unable to locate build.ninja in $BuildDir"
}
return Get-Content -LiteralPath $buildNinjaPath
}
function New-NinjaRspFile {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir,
[Parameter(Mandatory = $true)]
[string]$RspRelativePath
)
$buildStatements = Get-NinjaBuildStatements -BuildDir $BuildDir
$rspLine = ' RSP_FILE = ' + $RspRelativePath
$rspIndex = -1
for ($index = 0; $index -lt $buildStatements.Count; $index++) {
if ($buildStatements[$index] -eq $rspLine) {
$rspIndex = $index
break
}
}
if ($rspIndex -lt 0) {
throw "Unable to locate RSP_FILE entry for $RspRelativePath in build.ninja."
}
$buildIndex = -1
for ($index = $rspIndex; $index -ge 0; $index--) {
if ($buildStatements[$index].StartsWith('build ')) {
$buildIndex = $index
break
}
}
if ($buildIndex -lt 0) {
throw "Unable to locate the build statement that owns $RspRelativePath."
}
$buildLine = $buildStatements[$buildIndex]
if ($buildLine -notmatch '^build\s+\S+:\s+\S+\s+(.+)$') {
throw "Unable to parse build statement for $RspRelativePath."
}
$rspContents = ($Matches[1] -split '\s+') -join [Environment]::NewLine
$rspPath = Join-Path $BuildDir $RspRelativePath
$rspParent = Split-Path -Parent $rspPath
if (-not (Test-Path -LiteralPath $rspParent)) {
New-Item -ItemType Directory -Path $rspParent | Out-Null
}
Set-Content -LiteralPath $rspPath -Value $rspContents
}
function Ensure-NinjaRspFiles {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir,
[Parameter(Mandatory = $true)]
[string]$CommandLine
)
$rspMatches = [regex]::Matches($CommandLine, '@(?<path>[^\s"]+\.rsp)')
foreach ($rspMatch in $rspMatches) {
$rspRelativePath = $rspMatch.Groups['path'].Value
$rspPath = Join-Path $BuildDir $rspRelativePath
if (-not (Test-Path -LiteralPath $rspPath)) {
New-NinjaRspFile -BuildDir $BuildDir -RspRelativePath $rspRelativePath
}
}
}
function Get-PendingNinjaCommands {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir
)
$commandLines = & ninja -C $BuildDir -t commands
if ($LASTEXITCODE -ne 0) {
throw "Unable to enumerate pending Ninja commands in $BuildDir"
}
return $commandLines | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }
}
function Invoke-NinjaFallbackBuild {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir
)
$pendingCommands = Get-PendingNinjaCommands -BuildDir $BuildDir
if ($pendingCommands.Count -eq 0) {
return
}
Push-Location $BuildDir
try {
foreach ($pendingCommand in $pendingCommands) {
Ensure-NinjaRspFiles -BuildDir $BuildDir -CommandLine $pendingCommand
$commandToRun = $pendingCommand -replace '\s/showIncludes(?=\s|$)', ''
if ($commandToRun -match '^[^ ]*cmd(?:\.exe)?\s+/C\s+"(?<inner>.*)"\s*$') {
& cmd.exe /C $Matches['inner']
}
else {
& cmd.exe /C $commandToRun
}
if ($LASTEXITCODE -ne 0) {
throw "Fallback Ninja command failed with exit code ${LASTEXITCODE}: $pendingCommand"
}
}
}
finally {
Pop-Location
}
}
function Invoke-CMakeBuild {
param(
[Parameter(Mandatory = $true)]
[string]$BuildDir,
[Parameter(Mandatory = $true)]
[int]$Parallel,
[Parameter()]
[int]$TimeoutSeconds = 0
)
Remove-NinjaLock -Path $BuildDir
$isNinjaBuild = Test-IsNinjaBuildDirectory -BuildDir $BuildDir
if ($TimeoutSeconds -le 0) {
if ($isNinjaBuild) {
Invoke-NativeCommand -FilePath 'ninja' -Arguments @(
'-C', $BuildDir,
'-j', $Parallel.ToString()
)
}
else {
Invoke-NativeCommand -FilePath 'cmake' -Arguments @(
'--build', $BuildDir,
'--parallel', $Parallel.ToString()
)
}
return
}
if ($isNinjaBuild) {
$buildToolName = 'Ninja'
$buildResult = Invoke-ProcessWithTimeout -FilePath 'ninja' -Arguments @(
'-C', $BuildDir,
'-j', $Parallel.ToString()
) -TimeoutSeconds $TimeoutSeconds
}
else {
$buildToolName = 'CMake'
$buildResult = Invoke-ProcessWithTimeout -FilePath 'cmake' -Arguments @(
'--build', $BuildDir,
'--parallel', $Parallel.ToString()
) -TimeoutSeconds $TimeoutSeconds
}
if ($buildResult.Completed -and ($buildResult.ExitCode -eq 0)) {
return
}
if (-not $isNinjaBuild) {
if (-not $buildResult.Completed) {
throw "$buildToolName build timed out after $TimeoutSeconds seconds in $BuildDir"
}
throw "$buildToolName build failed with exit code $($buildResult.ExitCode) in $BuildDir"
}
if ($buildResult.Completed) {
throw "$buildToolName build failed with exit code $($buildResult.ExitCode) in $BuildDir"
}
Write-Warning "$buildToolName build timed out after $TimeoutSeconds seconds in $BuildDir. Replaying pending Ninja commands from PowerShell."
Remove-NinjaLock -Path $BuildDir
Invoke-NinjaFallbackBuild -BuildDir $BuildDir
}
+11
View File
@@ -1,4 +1,15 @@
#!/bin/bash #!/bin/bash
##############################################################################
# Copyright (c) 2024 Microsoft Corporation
# Copyright (c) 2026 Eclipse ThreadX contributors
#
# This program and the accompanying materials are made available under the
# terms of the MIT License which is available at
# https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: MIT
##############################################################################
# #
# Remove large folder # Remove large folder
+172
View File
@@ -0,0 +1,172 @@
#!/usr/bin/env bash
# prepare_release.sh
# Prepares a FileX release by updating version constants and port version strings.
#
# Usage: prepare_release.sh <version>
# Example: prepare_release.sh 6.5.1.202602
# Hotfix: prepare_release.sh 6.5.1.202602a
#
# This script:
# 1. Creates branch release-<version>-preparation from dev
# 2. Updates version constants in common/inc/fx_api.h
# (commit: "Updated version number constants")
# 3. Updates port version strings in all fx_port.h files
# (commit: "Updated port version strings")
#
# Copyright (C) 2026 Eclipse ThreadX contributors
# SPDX-License-Identifier: MIT
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
API_HEADER="${REPO_ROOT}/common/inc/fx_api.h"
PORT_HEADER_NAME="fx_port.h"
PORT_DIRS="ports"
# --------------------------------------------------------------------------
# Argument validation
# --------------------------------------------------------------------------
if [ "$#" -ne 1 ]; then
printf "Usage: %s <version>\n" "$(basename "$0")" >&2
printf "Example: %s 6.5.1.202602\n" "$(basename "$0")" >&2
exit 1
fi
VERSION="$1"
if ! printf "%s" "${VERSION}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[a-z]?$'; then
printf "Error: Invalid version format '%s'.\n" "${VERSION}" >&2
printf "Expected: MAJOR.MINOR.PATCH.BUILD[hotfix_letter]\n" >&2
exit 1
fi
# --------------------------------------------------------------------------
# Parse version components
# --------------------------------------------------------------------------
MAJOR=$(printf "%s" "${VERSION}" | cut -d. -f1)
MINOR=$(printf "%s" "${VERSION}" | cut -d. -f2)
PATCH=$(printf "%s" "${VERSION}" | cut -d. -f3)
BUILD_AND_HOTFIX=$(printf "%s" "${VERSION}" | cut -d. -f4)
BUILD=$(printf "%s" "${BUILD_AND_HOTFIX}" | sed -E 's/[a-z]+$//')
HOTFIX=$(printf "%s" "${BUILD_AND_HOTFIX}" | sed -E 's/^[0-9]+//')
if [ -z "${HOTFIX}" ]; then
HOTFIX_DEFINE="' '"
else
HOTFIX_DEFINE="'${HOTFIX}'"
fi
# --------------------------------------------------------------------------
# Read and display current version
# --------------------------------------------------------------------------
CURR_MAJOR=$(grep -E "^#define FILEX_MAJOR_VERSION" "${API_HEADER}" | awk '{print $NF}')
CURR_MINOR=$(grep -E "^#define FILEX_MINOR_VERSION" "${API_HEADER}" | awk '{print $NF}')
CURR_PATCH=$(grep -E "^#define FILEX_PATCH_VERSION" "${API_HEADER}" | awk '{print $NF}')
CURR_BUILD=$(grep -E "^#define FILEX_BUILD_VERSION" "${API_HEADER}" | awk '{print $NF}')
CURR_HOTFIX=$(grep -E "^#define FILEX_HOTFIX_VERSION" "${API_HEADER}" | \
sed -E "s/.*'([^']*)'.*/\1/" | tr -d ' ')
if [ -z "${CURR_HOTFIX}" ]; then
CURR_VER="${CURR_MAJOR}.${CURR_MINOR}.${CURR_PATCH}.${CURR_BUILD}"
else
CURR_VER="${CURR_MAJOR}.${CURR_MINOR}.${CURR_PATCH}.${CURR_BUILD}${CURR_HOTFIX}"
fi
printf "\nFileX release preparation\n"
printf " Repository : %s\n" "${REPO_ROOT}"
printf " Current version : %s\n" "${CURR_VER}"
printf " Target version : %s\n\n" "${VERSION}"
printf "Proceed with update? [y/N] "
read -r CONFIRM
case "${CONFIRM}" in
y|Y) ;;
*)
printf "Aborted.\n"
exit 0
;;
esac
# --------------------------------------------------------------------------
# Pre-flight checks
# --------------------------------------------------------------------------
if ! git -C "${REPO_ROOT}" diff --quiet HEAD 2>/dev/null; then
printf "Error: Working tree has uncommitted changes. Commit or stash first.\n" >&2
exit 1
fi
# --------------------------------------------------------------------------
# Create feature branch from dev
# --------------------------------------------------------------------------
BRANCH_NAME="release-${VERSION}-preparation"
printf "\nChecking out dev and pulling latest changes...\n"
git -C "${REPO_ROOT}" checkout dev
git -C "${REPO_ROOT}" pull origin dev
printf "Creating branch '%s'...\n" "${BRANCH_NAME}"
git -C "${REPO_ROOT}" checkout -b "${BRANCH_NAME}"
# --------------------------------------------------------------------------
# Update version constants
# --------------------------------------------------------------------------
printf "\nUpdating version constants in %s...\n" "${API_HEADER}"
sed -i -E "s|(#define FILEX_MAJOR_VERSION[[:space:]]+)[0-9]+|\1${MAJOR}|" "${API_HEADER}"
sed -i -E "s|(#define FILEX_MINOR_VERSION[[:space:]]+)[0-9]+|\1${MINOR}|" "${API_HEADER}"
sed -i -E "s|(#define FILEX_PATCH_VERSION[[:space:]]+)[0-9]+|\1${PATCH}|" "${API_HEADER}"
sed -i -E "s|(#define FILEX_BUILD_VERSION[[:space:]]+)[0-9]+|\1${BUILD}|" "${API_HEADER}"
sed -i -E "s|(#define FILEX_HOTFIX_VERSION[[:space:]]+)'[^']*'|\1${HOTFIX_DEFINE}|" "${API_HEADER}"
git -C "${REPO_ROOT}" add "${API_HEADER}"
git -C "${REPO_ROOT}" commit -F - <<'COMMIT_EOF'
Updated version number constants
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
COMMIT_EOF
printf "Committed version constant updates.\n"
# --------------------------------------------------------------------------
# Update port version strings
# --------------------------------------------------------------------------
printf "\nUpdating port version strings...\n"
PORT_FILES=""
for dir in ${PORT_DIRS}; do
if [ -d "${REPO_ROOT}/${dir}" ]; then
found=$(find "${REPO_ROOT}/${dir}" -name "${PORT_HEADER_NAME}" 2>/dev/null | sort)
if [ -n "${found}" ]; then
PORT_FILES="${PORT_FILES}${found}
"
fi
fi
done
PORT_FILES=$(printf "%s" "${PORT_FILES}" | grep -v '^[[:space:]]*$' || true)
if [ -z "${PORT_FILES}" ]; then
printf "Warning: No port header files found. Skipping port version string commit.\n"
else
while IFS= read -r port_file; do
if [ -n "${port_file}" ] && grep -qE "Version [0-9]" "${port_file}" 2>/dev/null; then
sed -i -E "s/Version [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[a-z]*/Version ${VERSION}/g" "${port_file}"
printf " Updated: %s\n" "${port_file#${REPO_ROOT}/}"
fi
done <<EOF
${PORT_FILES}
EOF
git -C "${REPO_ROOT}" add -u
if git -C "${REPO_ROOT}" diff --cached --quiet; then
printf "No port version string changes staged. Skipping commit.\n"
else
git -C "${REPO_ROOT}" commit -F - <<'COMMIT_EOF'
Updated port version strings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
COMMIT_EOF
printf "Committed port version string updates.\n"
fi
fi
printf "\nRelease preparation complete.\n"
printf "Branch '%s' is ready for review.\n" "${BRANCH_NAME}"
+11
View File
@@ -1,2 +1,13 @@
#!/bin/bash #!/bin/bash
##############################################################################
# Copyright (c) 2024 Microsoft Corporation
# Copyright (c) 2026 Eclipse ThreadX contributors
#
# This program and the accompanying materials are made available under the
# terms of the MIT License which is available at
# https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: MIT
##############################################################################
$(dirname `realpath $0`)/../test/cmake/run.sh test all $(dirname `realpath $0`)/../test/cmake/run.sh test all
+121
View File
@@ -0,0 +1,121 @@
[CmdletBinding()]
param(
[ValidateSet('win64', 'win32')]
[string]$Arch = 'win64',
[AllowNull()]
[object]$Configuration = 'all',
[int]$Parallel = [Math]::Max(1, [Environment]::ProcessorCount),
[int]$RepeatFailCount = 1,
[int]$TestTimeoutSeconds = 60,
[switch]$CollectFailureDiagnostics = $true,
[string]$TestRegex,
[switch]$RerunFailedOnly,
[string]$BuildDir,
[switch]$Clean
)
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot 'fx_windows_common.ps1')
$repoRoot = Split-Path -Parent $PSScriptRoot
$settings = Get-PortSettings -SelectedArch $Arch
if (-not $BuildDir) {
$BuildDir = Join-Path $repoRoot "build\tests\$Arch"
}
$selectedConfigurations = Resolve-RegressionConfigurations -RequestedConfigurations $Configuration
Write-Host "Selected configurations: $($selectedConfigurations -join ', ')"
Enter-VisualStudioDevShell -VsArch $settings.VsArch
if (($settings.FileXArch -eq 'win32') -or ($settings.FileXArch -eq 'win64')) {
if ($Parallel -ne 1) {
Write-Warning "Windows simulator regression tests are timing-sensitive under concurrent ctest execution. Forcing -Parallel 1."
$Parallel = 1
}
}
$failedConfigurations = @()
foreach ($currentConfiguration in $selectedConfigurations) {
$currentBuildDirName = Get-RegressionBuildDirectoryName -ConfigurationName $currentConfiguration
$currentBuildDir = Join-Path $BuildDir $currentBuildDirName
$currentTestingTemporaryDir = Join-Path $currentBuildDir 'Testing\Temporary'
try {
if ($Clean) {
$currentTestingDir = Join-Path $currentBuildDir 'Testing'
Remove-CtestTestingDirectory -Path $currentTestingDir
}
if (-not (Test-Path -LiteralPath $currentBuildDir)) {
throw "Build directory does not exist for $Arch / ${currentConfiguration}: $currentBuildDir"
}
Remove-NinjaLock -Path $currentBuildDir
if (Test-Path -LiteralPath $currentTestingTemporaryDir) {
Remove-Item -LiteralPath (Join-Path $currentTestingTemporaryDir 'LastTest.log') -Force -ErrorAction SilentlyContinue
Remove-Item -LiteralPath (Join-Path $currentTestingTemporaryDir 'LastTestsFailed.log') -Force -ErrorAction SilentlyContinue
}
Write-Host "Testing $Arch / $currentConfiguration"
$ctestArguments = @(
'--test-dir', $currentBuildDir,
'--output-on-failure',
'--timeout', $TestTimeoutSeconds.ToString(),
'-j', $Parallel.ToString()
)
if ($RepeatFailCount -gt 1) {
$ctestArguments += @('--repeat', "until-pass:$RepeatFailCount")
}
if ($TestRegex) {
$ctestArguments += @('-R', $TestRegex)
}
if ($RerunFailedOnly) {
$ctestArguments += '--rerun-failed'
}
Invoke-NativeCommand -FilePath 'ctest' -Arguments $ctestArguments
}
catch {
if ($CollectFailureDiagnostics -and (Test-Path -LiteralPath $currentBuildDir)) {
try {
Invoke-CtestFailureDiagnostics -BuildDir $currentBuildDir -TestingTemporaryDir $currentTestingTemporaryDir `
-TimeoutSeconds $TestTimeoutSeconds
}
catch {
Write-Warning "Failure diagnostics collection failed for ${currentConfiguration}: $($_.Exception.Message)"
}
}
$failedConfigurations += @{
Configuration = $currentConfiguration
Message = $_.Exception.Message
}
Write-Warning "Configuration failed: $currentConfiguration"
}
}
if ($failedConfigurations.Count -gt 0) {
Write-Host ''
Write-Host 'Configuration failure summary:'
foreach ($failedConfiguration in $failedConfigurations) {
Write-Host "- $($failedConfiguration.Configuration): $($failedConfiguration.Message)"
}
throw "One or more configurations failed: $($failedConfigurations.Configuration -join ', ')"
}
+72 -39
View File
@@ -2,13 +2,23 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0057 NEW) cmake_policy(SET CMP0057 NEW)
project(threadx_test LANGUAGES C) # Suppress try_compile link step when MSVC cannot produce a runnable executable
# (e.g. when the VS environment is not fully initialised for a given target arch).
if((DEFINED THREADX_ARCH) AND ((THREADX_ARCH STREQUAL "win32") OR (THREADX_ARCH STREQUAL "win64")))
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
endif()
project(filex_test LANGUAGES C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
# Set build configurations # Set build configurations
set(BUILD_CONFIGURATIONS set(BUILD_CONFIGURATIONS
default_build_coverage no_cache_build no_cache_standalone_build default_build_coverage no_cache_build no_cache_standalone_build
fault_tolerant_build_coverage no_check_build no_cache_fault_tolerant_build fault_tolerant_build_coverage no_check_build no_cache_fault_tolerant_build
standalone_build_coverage standalone_fault_tolerant_build_coverage standalone_build_coverage standalone_fault_tolerant_build_coverage
standalone_no_cache_fault_tolerant_build) standalone_no_cache_fault_tolerant_build)
set(CMAKE_CONFIGURATION_TYPES set(CMAKE_CONFIGURATION_TYPES
${BUILD_CONFIGURATIONS} ${BUILD_CONFIGURATIONS}
@@ -31,25 +41,32 @@ set(FX_FAULT_TOLERANT_DEFINITIONS
set(default_build_coverage "") set(default_build_coverage "")
set(no_cache_build -DFX_DISABLE_CACHE -DFX_DISABLE_FAT_ENTRY_REFRESH) set(no_cache_build -DFX_DISABLE_CACHE -DFX_DISABLE_FAT_ENTRY_REFRESH)
set(fault_tolerant_build_coverage ${FX_FAULT_TOLERANT_DEFINITIONS}) set(fault_tolerant_build_coverage ${FX_FAULT_TOLERANT_DEFINITIONS})
set(standalone_build_coverage -DFX_STANDALONE_ENABLE) set(standalone_build_coverage -DFX_STANDALONE_ENABLE)
set(standalone_fault_tolerant_build_coverage ${FX_FAULT_TOLERANT_DEFINITIONS} set(standalone_fault_tolerant_build_coverage ${FX_FAULT_TOLERANT_DEFINITIONS}
-DFX_STANDALONE_ENABLE) -DFX_STANDALONE_ENABLE)
set(no_cache_standalone_build -DFX_DISABLE_CACHE -DFX_STANDALONE_ENABLE) set(no_cache_standalone_build -DFX_DISABLE_CACHE -DFX_STANDALONE_ENABLE)
set(no_check_build ${FX_COMPILE_DEFINITIONS} -DFX_DISABLE_ERROR_CHECKING) set(no_check_build -DFX_DISABLE_ERROR_CHECKING)
set(no_cache_fault_tolerant_build ${no_cache_build} ${FX_FAULT_TOLERANT_DEFINITIONS}) set(no_cache_fault_tolerant_build ${no_cache_build} ${FX_FAULT_TOLERANT_DEFINITIONS})
set(standalone_no_cache_fault_tolerant_build ${no_cache_build} ${FX_FAULT_TOLERANT_DEFINITIONS} -DFX_STANDALONE_ENABLE) set(standalone_no_cache_fault_tolerant_build ${no_cache_build} ${FX_FAULT_TOLERANT_DEFINITIONS} -DFX_STANDALONE_ENABLE)
add_compile_options( if(MSVC)
-m32 add_compile_options(/W3 /Zi)
-std=c99 add_link_options(/DEBUG /INCREMENTAL:NO)
-ggdb # Both cl.exe and gcc accept -DFOO; use it to keep the per-configuration
-g3 # definitions consistent with the Linux path.
-gdwarf-2 add_compile_options(-DFX_REGRESSION_TEST ${${CMAKE_BUILD_TYPE}})
-fdiagnostics-color else()
-Werror add_compile_options(
-DFX_REGRESSION_TEST -m32
${${CMAKE_BUILD_TYPE}}) -ggdb
add_link_options(-m32) -g3
-gdwarf-2
-fdiagnostics-color
-Werror
-DFX_REGRESSION_TEST
${${CMAKE_BUILD_TYPE}})
add_link_options(-m32)
endif()
if(CMAKE_BUILD_TYPE MATCHES ".*standalone.*") if(CMAKE_BUILD_TYPE MATCHES ".*standalone.*")
set(FX_STANDALONE_ENABLE set(FX_STANDALONE_ENABLE
@@ -59,18 +76,30 @@ endif()
enable_testing() enable_testing()
# ThreadX dependency: on Windows build from source; on Linux use run.sh.
if(MSVC)
if(NOT FX_STANDALONE_ENABLE)
if(NOT DEFINED THREADX_SOURCE_DIR)
message(FATAL_ERROR
"THREADX_SOURCE_DIR must point to a ThreadX source tree for non-standalone Windows builds. "
"Pass -DTHREADX_SOURCE_DIR=<path> to cmake, or use build_fx.ps1 which sets it automatically.")
endif()
add_subdirectory(${THREADX_SOURCE_DIR} threadx_build)
endif()
endif()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../.. filex) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../.. filex)
add_subdirectory(regression) add_subdirectory(regression)
add_subdirectory(samples) add_subdirectory(samples)
# Coverage # Coverage instrumentation (GCC/Clang only — not supported by MSVC)
if(CMAKE_BUILD_TYPE MATCHES ".*_coverage") if(NOT MSVC AND CMAKE_BUILD_TYPE MATCHES ".*_coverage")
target_compile_options(filex PRIVATE -fprofile-arcs -ftest-coverage) target_compile_options(filex PRIVATE -fprofile-arcs -ftest-coverage)
target_link_options(filex PRIVATE -fprofile-arcs -ftest-coverage) target_link_options(filex PRIVATE -fprofile-arcs -ftest-coverage)
endif() endif()
# Build ThreadX library once # Build ThreadX shared library for Linux
if(NOT FX_STANDALONE_ENABLE) if(NOT MSVC AND NOT FX_STANDALONE_ENABLE)
execute_process(COMMAND ${CMAKE_CURRENT_LIST_DIR}/run.sh build_libs) execute_process(COMMAND ${CMAKE_CURRENT_LIST_DIR}/run.sh build_libs)
add_custom_target(build_libs ALL COMMAND ${CMAKE_CURRENT_LIST_DIR}/run.sh add_custom_target(build_libs ALL COMMAND ${CMAKE_CURRENT_LIST_DIR}/run.sh
build_libs) build_libs)
@@ -83,23 +112,27 @@ if(NOT FX_STANDALONE_ENABLE)
${CMAKE_BINARY_DIR}/../libs/threadx/libthreadx.so) ${CMAKE_BINARY_DIR}/../libs/threadx/libthreadx.so)
endif() endif()
target_compile_options( if(MSVC)
filex target_compile_options(filex PRIVATE /W3)
PRIVATE -Werror else()
-Wall target_compile_options(
-Wextra filex
-pedantic PRIVATE -Werror
-fmessage-length=0 -Wall
-fsigned-char -Wextra
-ffunction-sections -pedantic
-fdata-sections -fmessage-length=0
-Wunused -fsigned-char
-Wuninitialized -ffunction-sections
-Wmissing-declarations -fdata-sections
-Wconversion -Wunused
-Wpointer-arith -Wuninitialized
-Wshadow -Wmissing-declarations
-Wlogical-op -Wconversion
-Waggregate-return -Wpointer-arith
-Wfloat-equal) -Wshadow
-Wlogical-op
-Waggregate-return
-Wfloat-equal)
endif()
+11
View File
@@ -1,4 +1,15 @@
#!/bin/bash #!/bin/bash
##############################################################################
# Copyright (c) 2024 Microsoft Corporation
# Copyright (c) 2026 Eclipse ThreadX contributors
#
# This program and the accompanying materials are made available under the
# terms of the MIT License which is available at
# https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: MIT
##############################################################################
set -e set -e
+14
View File
@@ -147,6 +147,9 @@ add_library(test_utility ${SOURCE_DIR}/fx_ram_driver_test.c
${SOURCE_DIR}/filextestcontrol.c) ${SOURCE_DIR}/filextestcontrol.c)
target_link_libraries(test_utility PUBLIC azrtos::filex) target_link_libraries(test_utility PUBLIC azrtos::filex)
target_compile_definitions(test_utility PUBLIC BATCH_TEST CTEST) target_compile_definitions(test_utility PUBLIC BATCH_TEST CTEST)
if(MSVC AND FX_STANDALONE_ENABLE)
target_include_directories(test_utility PUBLIC ${SOURCE_DIR}/win64_compat)
endif()
foreach(test_case ${regression_test_cases}) foreach(test_case ${regression_test_cases})
get_filename_component(test_name ${test_case} NAME_WE) get_filename_component(test_name ${test_case} NAME_WE)
@@ -154,3 +157,14 @@ foreach(test_case ${regression_test_cases})
target_link_libraries(${test_name} PRIVATE test_utility) target_link_libraries(${test_name} PRIVATE test_utility)
add_test(${CMAKE_BUILD_TYPE}::${test_name} ${test_name}) add_test(${CMAKE_BUILD_TYPE}::${test_name} ${test_name})
endforeach() endforeach()
# These two tests write or corrupt large amounts of data on a 900 MB RAM disk and are
# inherently slow (≈95 s and ≈330 s on Windows). Override the default 60-second ctest
# timeout so that they are not mis-reported as failures.
if(MSVC)
set_tests_properties(
${CMAKE_BUILD_TYPE}::filex_fault_tolerant_file_corruption_test
${CMAKE_BUILD_TYPE}::filex_fault_tolerant_media_full_test
PROPERTIES TIMEOUT 600
)
endif()
+11
View File
@@ -1,4 +1,15 @@
#!/bin/bash #!/bin/bash
##############################################################################
# Copyright (c) 2024 Microsoft Corporation
# Copyright (c) 2026 Eclipse ThreadX contributors
#
# This program and the accompanying materials are made available under the
# terms of the MIT License which is available at
# https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: MIT
##############################################################################
cd $(dirname $0) cd $(dirname $0)
+1 -1
View File
@@ -12,6 +12,6 @@ foreach(sample_file ${sample_files})
get_filename_component(sample_file_name ${sample_file} NAME_WE) get_filename_component(sample_file_name ${sample_file} NAME_WE)
add_executable(${sample_file_name} ${sample_file} add_executable(${sample_file_name} ${sample_file}
${CMAKE_CURRENT_LIST_DIR}/../../regression_test/fx_ram_driver_test.c) ${CMAKE_CURRENT_LIST_DIR}/../../regression_test/fx_ram_driver_test.c)
target_compile_options(${sample_file_name} PRIVATE -DSAMPLE_BUILD) target_compile_definitions(${sample_file_name} PRIVATE SAMPLE_BUILD)
target_link_libraries(${sample_file_name} PRIVATE azrtos::filex) target_link_libraries(${sample_file_name} PRIVATE azrtos::filex)
endforeach() endforeach()
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the file attributes read/set operation. */ /* This FileX test concentrates on the file attributes read/set operation. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the basic directory create/delete operations. */ /* This FileX test concentrates on the basic directory create/delete operations. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the basic directory default path get/set operations. */ /* This FileX test concentrates on the basic directory default path get/set operations. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on recovery operation when there are duplicate entries. */ /* This FileX test concentrates on recovery operation when there are duplicate entries. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the basic first/next entry find operations. */ /* This FileX test concentrates on the basic first/next entry find operations. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the local path operations. */ /* This FileX test concentrates on the local path operations. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the directory long/short name get operations. */ /* This FileX test concentrates on the directory long/short name get operations. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the basic directory naming operations. */ /* This FileX test concentrates on the basic directory naming operations. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the directory rename operations. */ /* This FileX test concentrates on the directory rename operations. */
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on validating the buffer overflow when Fault-Tolerant is enabled. */ /* This FileX test concentrates on validating the buffer overflow when Fault-Tolerant is enabled. */
#if 0 #if 0
*Description* *Description*
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant delete large data test. */ /* This FileX test concentrates on the Fault-Tolerant delete large data test. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo_log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo_log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* In this test point: */ /* In this test point: */
/* Send null pointer to generate an error in fxe_fault_tolerant_enable */ /* Send null pointer to generate an error in fxe_fault_tolerant_enable */
/* Register an invalid cluster number for fault_tolerant log file and enable the Fault-tolerant feature. */ /* Register an invalid cluster number for fault_tolerant log file and enable the Fault-tolerant feature. */
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
#include "tx_api.h" #include "tx_api.h"
#include "tx_thread.h" #include "tx_thread.h"
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
#include "tx_api.h" #include "tx_api.h"
#include "tx_thread.h" #include "tx_thread.h"
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
#ifndef FX_STANDALONE_ENABLE #ifndef FX_STANDALONE_ENABLE
#include "tx_api.h" #include "tx_api.h"
#else #else
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant enable feature. */ /* This FileX test concentrates on the Fault-Tolerant enable feature. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant direcotry write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant direcotry write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the bug as per /* This FileX test concentrates on the bug as per
* JIRA: https://expresslogic.atlassian.net/browse/FIL-4. * JIRA: https://expresslogic.atlassian.net/browse/FIL-4.
* In fx_fault_tolerant_cleanup_FAT_chain.c, a group of the FAT entries are updated in the cache * In fx_fault_tolerant_cleanup_FAT_chain.c, a group of the FAT entries are updated in the cache
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo LOG write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo LOG write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant the file allocate related API test. /* This FileX test concentrates on the Fault-Tolerant the file allocate related API test.
* The offset of file is not changed after file allocate operation. */ * The offset of file is not changed after file allocate operation. */
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant undo LOG write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant undo LOG write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo Log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo Log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant undo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant undo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the bug as per /* This FileX test concentrates on the bug as per
* JIRA: https://expresslogic.atlassian.net/browse/FIL-4. * JIRA: https://expresslogic.atlassian.net/browse/FIL-4.
* In fx_fault_tolerant_cleanup_FAT_chain.c, a group of the FAT entries are updated in the cache * In fx_fault_tolerant_cleanup_FAT_chain.c, a group of the FAT entries are updated in the cache
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This test case is design to reproduce file corruption bug. /* This test case is design to reproduce file corruption bug.
* https://expresslogic.zendesk.com/agent/tickets/1252 */ * https://expresslogic.zendesk.com/agent/tickets/1252 */
#include <stdio.h> #include <stdio.h>
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo LOG write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo LOG write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */
/* /*
For FAT 12, one cluster size is 1024 bytes; For FAT 12, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo LOG write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo LOG write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test is determined to cover filex_fault_tolerant_file_delete */ /* This FileX test is determined to cover filex_fault_tolerant_file_delete */
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant undo LOG write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant undo LOG write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant file random seek operation. */ /* This FileX test concentrates on the Fault-Tolerant file random seek operation. */
/* /*
1. Format and open the media; 1. Format and open the media;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo LOG write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo LOG write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant file seek operation. */ /* This FileX test concentrates on the Fault-Tolerant file seek operation. */
/* /*
1. Format and open the media; 1. Format and open the media;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant truncate release operation. */ /* This FileX test concentrates on the Fault-Tolerant truncate release operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant FAT write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant undo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant undo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. /* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation.
* The available bytes before/after file write should be decreased write_buffer_size only. */ * The available bytes before/after file write should be decreased write_buffer_size only. */
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant data write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant data write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the bug as per /* This FileX test concentrates on the bug as per
* JIRA: https://expresslogic.atlassian.net/browse/FIL-4. * JIRA: https://expresslogic.atlassian.net/browse/FIL-4.
* In fx_fault_tolerant_cleanup_FAT_chain.c, a group of the FAT entries are updated in the cache * In fx_fault_tolerant_cleanup_FAT_chain.c, a group of the FAT entries are updated in the cache
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the bug as per /* This FileX test concentrates on the bug as per
* JIRA: https://expresslogic.atlassian.net/browse/FIL-4. * JIRA: https://expresslogic.atlassian.net/browse/FIL-4.
* In fx_fault_tolerant_cleanup_FAT_chain.c, a group of the FAT entries are updated in the cache * In fx_fault_tolerant_cleanup_FAT_chain.c, a group of the FAT entries are updated in the cache
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant fat write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant fat write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant undo log write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant undo log write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation. /* This FileX test concentrates on the Fault-Tolerant redo log write interrupt operation.
* The available bytes before/after file write should be decreased write_buffer_size only. */ * The available bytes before/after file write should be decreased write_buffer_size only. */
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant log recover directory operation. */ /* This FileX test concentrates on the Fault-Tolerant log recover directory operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant log recover operation. */ /* This FileX test concentrates on the Fault-Tolerant log recover operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 1024 bytes; For FAT 12, 16, 32, one cluster size is 1024 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 3072 bytes; For FAT 12, 16, 32, one cluster size is 3072 bytes;
@@ -1,3 +1,14 @@
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */ /* This FileX test concentrates on the Fault-Tolerant directory write interrupt operation. */
/* /*
For FAT 12, 16, 32, one cluster size is 3072 bytes; For FAT 12, 16, 32, one cluster size is 3072 bytes;

Some files were not shown because too many files have changed in this diff Show More