diff --git a/common/inc/fx_api.h b/common/inc/fx_api.h index ae36f6b..efb8664 100644 --- a/common/inc/fx_api.h +++ b/common/inc/fx_api.h @@ -26,7 +26,7 @@ /* APPLICATION INTERFACE DEFINITION RELEASE */ /* */ /* fx_api.h PORTABLE C */ -/* 6.1.11 */ +/* 6.1.12 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -74,6 +74,9 @@ /* 04-25-2022 William E. Lamie Modified comment(s), and */ /* updated product constants, */ /* resulting in version 6.1.11 */ +/* 07-29-2022 William E. Lamie Modified comment(s), and */ +/* updated product constants, */ +/* resulting in version 6.1.12 */ /* */ /**************************************************************************/ @@ -123,7 +126,7 @@ extern "C" { #define AZURE_RTOS_FILEX #define FILEX_MAJOR_VERSION 6 #define FILEX_MINOR_VERSION 1 -#define FILEX_PATCH_VERSION 11 +#define FILEX_PATCH_VERSION 12 /* Define the following symbols for backward compatibility */ #define EL_PRODUCT_FILEX diff --git a/common/src/fx_directory_free_search.c b/common/src/fx_directory_free_search.c index 32833fa..934ef88 100644 --- a/common/src/fx_directory_free_search.c +++ b/common/src/fx_directory_free_search.c @@ -39,7 +39,7 @@ /* FUNCTION RELEASE */ /* */ /* _fx_directory_free_search PORTABLE C */ -/* 6.1 */ +/* 6.1.12 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -82,6 +82,10 @@ /* 05-19-2020 William E. Lamie Initial Version 6.0 */ /* 09-30-2020 William E. Lamie Modified comment(s), */ /* resulting in version 6.1 */ +/* 07-29-2022 Bhupendra Naphade Modified comment(s), */ +/* updated available cluster */ +/* check for sub directory, */ +/* resulting in version 6.1.12 */ /* */ /**************************************************************************/ UINT _fx_directory_free_search(FX_MEDIA *media_ptr, FX_DIR_ENTRY *directory_ptr, FX_DIR_ENTRY *entry_ptr) @@ -434,7 +438,7 @@ FX_INT_SAVE_AREA /* Not enough empty entries were found. If the specified directory is a sub-directory, attempt to allocate another cluster to it. */ - if (((search_dir_ptr) || (media_ptr -> fx_media_32_bit_FAT)) && (media_ptr -> fx_media_available_clusters > clusters_needed)) + if (((search_dir_ptr) || (media_ptr -> fx_media_32_bit_FAT)) && (media_ptr -> fx_media_available_clusters >= clusters_needed)) { /* Search for the additional clusters we need. */ diff --git a/ports/cortex_m0/gnu/inc/fx_port.h b/ports/cortex_m0/gnu/inc/fx_port.h index 9822ffe..ad09054 100644 --- a/ports/cortex_m0/gnu/inc/fx_port.h +++ b/ports/cortex_m0/gnu/inc/fx_port.h @@ -20,206 +20,6 @@ /**************************************************************************/ /**************************************************************************/ - -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* fx_port.h Cortex-M0/GNU */ -/* 6.1.8 */ -/* */ -/* AUTHOR */ -/* */ -/* William E. Lamie, Microsoft Corporation */ -/* */ -/* 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. */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1 */ -/* 03-02-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.5 */ -/* 08-02-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.8 */ -/* */ -/**************************************************************************/ - -#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 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 -#include - -#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; - -#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. */ - -#ifndef ALIGN_TYPE_DEFINED -#define ALIGN_TYPE_DEFINED -#define ALIGN_TYPE ULONG -#endif - -#endif - -/* 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. */ - -#if defined(FX_SINGLE_THREAD) || defined(FX_STANDALONE_ENABLE) -#define FX_PROTECT -#define FX_UNPROTECT -#else -#define FX_PROTECT if (media_ptr -> fx_media_id != FX_MEDIA_ID) return(FX_MEDIA_NOT_OPEN); \ - else if (tx_mutex_get(&(media_ptr -> fx_media_protect), TX_WAIT_FOREVER) != TX_SUCCESS) return(FX_MEDIA_NOT_OPEN); -#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 -#ifndef FX_INT_SAVE_AREA -#define FX_INT_SAVE_AREA unsigned int old_interrupt_posture; -#endif - -#ifndef FX_DISABLE_INTS -#define FX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); -#endif - -#ifndef FX_RESTORE_INTS -#define FX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); -#endif -#else -/* Disable use of ThreadX protection in standalone mode for FileX */ -#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_GET_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_GET_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) Microsoft Corporation. All rights reserved. * FileX Cortex-M0/GNU Version 6.1.11 *"; -#else -extern CHAR _fx_version_id[]; -#endif - -#endif +/* Include the generic version of fx_port.h. */ +#include "../../../generic/inc/fx_port.h" diff --git a/ports/cortex_m3/gnu/inc/fx_port.h b/ports/cortex_m3/gnu/inc/fx_port.h index 904c58e..ad09054 100644 --- a/ports/cortex_m3/gnu/inc/fx_port.h +++ b/ports/cortex_m3/gnu/inc/fx_port.h @@ -20,206 +20,6 @@ /**************************************************************************/ /**************************************************************************/ - -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* fx_port.h Cortex-M3/GNU */ -/* 6.1.8 */ -/* */ -/* AUTHOR */ -/* */ -/* William E. Lamie, Microsoft Corporation */ -/* */ -/* 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. */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1 */ -/* 03-02-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.5 */ -/* 08-02-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.8 */ -/* */ -/**************************************************************************/ - -#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 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 -#include - -#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; - -#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. */ - -#ifndef ALIGN_TYPE_DEFINED -#define ALIGN_TYPE_DEFINED -#define ALIGN_TYPE ULONG -#endif - -#endif - -/* 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. */ - -#if defined(FX_SINGLE_THREAD) || defined(FX_STANDALONE_ENABLE) -#define FX_PROTECT -#define FX_UNPROTECT -#else -#define FX_PROTECT if (media_ptr -> fx_media_id != FX_MEDIA_ID) return(FX_MEDIA_NOT_OPEN); \ - else if (tx_mutex_get(&(media_ptr -> fx_media_protect), TX_WAIT_FOREVER) != TX_SUCCESS) return(FX_MEDIA_NOT_OPEN); -#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 -#ifndef FX_INT_SAVE_AREA -#define FX_INT_SAVE_AREA unsigned int old_interrupt_posture; -#endif - -#ifndef FX_DISABLE_INTS -#define FX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); -#endif - -#ifndef FX_RESTORE_INTS -#define FX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); -#endif -#else -/* Disable use of ThreadX protection in standalone mode for FileX */ -#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_GET_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_GET_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) Microsoft Corporation. All rights reserved. * FileX Cortex-M3/GNU Version 6.1.11 *"; -#else -extern CHAR _fx_version_id[]; -#endif - -#endif +/* Include the generic version of fx_port.h. */ +#include "../../../generic/inc/fx_port.h" diff --git a/ports/cortex_m4/gnu/inc/fx_port.h b/ports/cortex_m4/gnu/inc/fx_port.h index b478526..ad09054 100644 --- a/ports/cortex_m4/gnu/inc/fx_port.h +++ b/ports/cortex_m4/gnu/inc/fx_port.h @@ -20,206 +20,6 @@ /**************************************************************************/ /**************************************************************************/ - -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* fx_port.h Cortex-M4/GNU */ -/* 6.1.8 */ -/* */ -/* AUTHOR */ -/* */ -/* William E. Lamie, Microsoft Corporation */ -/* */ -/* 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. */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1 */ -/* 03-02-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.5 */ -/* 08-02-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.8 */ -/* */ -/**************************************************************************/ - -#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 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 -#include - -#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; - -#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. */ - -#ifndef ALIGN_TYPE_DEFINED -#define ALIGN_TYPE_DEFINED -#define ALIGN_TYPE ULONG -#endif - -#endif - -/* 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. */ - -#if defined(FX_SINGLE_THREAD) || defined(FX_STANDALONE_ENABLE) -#define FX_PROTECT -#define FX_UNPROTECT -#else -#define FX_PROTECT if (media_ptr -> fx_media_id != FX_MEDIA_ID) return(FX_MEDIA_NOT_OPEN); \ - else if (tx_mutex_get(&(media_ptr -> fx_media_protect), TX_WAIT_FOREVER) != TX_SUCCESS) return(FX_MEDIA_NOT_OPEN); -#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 -#ifndef FX_INT_SAVE_AREA -#define FX_INT_SAVE_AREA unsigned int old_interrupt_posture; -#endif - -#ifndef FX_DISABLE_INTS -#define FX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); -#endif - -#ifndef FX_RESTORE_INTS -#define FX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); -#endif -#else -/* Disable use of ThreadX protection in standalone mode for FileX */ -#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_GET_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_GET_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) Microsoft Corporation. All rights reserved. * FileX Cortex-M4/GNU Version 6.1.11 *"; -#else -extern CHAR _fx_version_id[]; -#endif - -#endif +/* Include the generic version of fx_port.h. */ +#include "../../../generic/inc/fx_port.h" diff --git a/ports/cortex_m7/gnu/inc/fx_port.h b/ports/cortex_m7/gnu/inc/fx_port.h index c3ebc75..ad09054 100644 --- a/ports/cortex_m7/gnu/inc/fx_port.h +++ b/ports/cortex_m7/gnu/inc/fx_port.h @@ -20,206 +20,6 @@ /**************************************************************************/ /**************************************************************************/ - -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* fx_port.h Cortex-M7/GNU */ -/* 6.1.8 */ -/* */ -/* AUTHOR */ -/* */ -/* William E. Lamie, Microsoft Corporation */ -/* */ -/* 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. */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1 */ -/* 03-02-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.5 */ -/* 08-02-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.8 */ -/* */ -/**************************************************************************/ - -#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 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 -#include - -#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; - -#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. */ - -#ifndef ALIGN_TYPE_DEFINED -#define ALIGN_TYPE_DEFINED -#define ALIGN_TYPE ULONG -#endif - -#endif - -/* 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. */ - -#if defined(FX_SINGLE_THREAD) || defined(FX_STANDALONE_ENABLE) -#define FX_PROTECT -#define FX_UNPROTECT -#else -#define FX_PROTECT if (media_ptr -> fx_media_id != FX_MEDIA_ID) return(FX_MEDIA_NOT_OPEN); \ - else if (tx_mutex_get(&(media_ptr -> fx_media_protect), TX_WAIT_FOREVER) != TX_SUCCESS) return(FX_MEDIA_NOT_OPEN); -#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 -#ifndef FX_INT_SAVE_AREA -#define FX_INT_SAVE_AREA unsigned int old_interrupt_posture; -#endif - -#ifndef FX_DISABLE_INTS -#define FX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); -#endif - -#ifndef FX_RESTORE_INTS -#define FX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); -#endif -#else -/* Disable use of ThreadX protection in standalone mode for FileX */ -#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_GET_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_GET_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) Microsoft Corporation. All rights reserved. * FileX Cortex-M7/GNU Version 6.1.11 *"; -#else -extern CHAR _fx_version_id[]; -#endif - -#endif +/* Include the generic version of fx_port.h. */ +#include "../../../generic/inc/fx_port.h" diff --git a/ports/generic/inc/fx_port.h b/ports/generic/inc/fx_port.h index 3c8c9e0..a515155 100644 --- a/ports/generic/inc/fx_port.h +++ b/ports/generic/inc/fx_port.h @@ -213,7 +213,7 @@ typedef unsigned long long ULONG64; #ifdef FX_SYSTEM_INIT CHAR _fx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * FileX Generic Version 6.1.11 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * FileX Generic Version 6.1.12 *"; #else extern CHAR _fx_version_id[]; #endif diff --git a/ports/linux/gnu/inc/fx_port.h b/ports/linux/gnu/inc/fx_port.h index 61c71f4..b21c756 100644 --- a/ports/linux/gnu/inc/fx_port.h +++ b/ports/linux/gnu/inc/fx_port.h @@ -340,7 +340,7 @@ extern VOID fault_tolerant_apply_log_callback(struct FX_MEDIA_STRUCT *media_ptr, #ifdef FX_SYSTEM_INIT CHAR _fx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * FileX Linux/GCC Version 6.1.11 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * FileX Linux/GCC Version 6.1.12 *"; #else extern CHAR _fx_version_id[]; #endif diff --git a/ports/win32/vs_2019/inc/fx_port.h b/ports/win32/vs_2019/inc/fx_port.h index 3122852..3f94105 100644 --- a/ports/win32/vs_2019/inc/fx_port.h +++ b/ports/win32/vs_2019/inc/fx_port.h @@ -204,7 +204,7 @@ typedef unsigned long long ULONG64; #ifdef FX_SYSTEM_INIT CHAR _fx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * FileX Win32/Version 6.1.11 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * FileX Win32/Version 6.1.12 *"; #else extern CHAR _fx_version_id[]; #endif