mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-22 14:31:59 -04:00
Update Reliance Edge fail safe file system to the latest version.
This commit is contained in:
parent
8d041c8e21
commit
67def3c14b
|
@ -1,5 +1,7 @@
|
|||
/* THIS FILE WAS GENERATED BY THE DATALIGHT RELIANCE EDGE CONFIGURATION
|
||||
UTILITY. DO NOT MODIFY.
|
||||
|
||||
Generated by configuration utility version 2.0
|
||||
*/
|
||||
/** @file
|
||||
*/
|
||||
|
@ -11,5 +13,5 @@
|
|||
|
||||
const VOLCONF gaRedVolConf[REDCONF_VOLUME_COUNT] =
|
||||
{
|
||||
{ 512U, 65536U, false, 256U, 0, "" }
|
||||
{ 512U, 65536U, false, 256U, 0U, "" }
|
||||
};
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* THIS FILE WAS GENERATED BY THE DATALIGHT RELIANCE EDGE CONFIGURATION
|
||||
UTILITY. DO NOT MODIFY.
|
||||
|
||||
Generated by configuration utility version 2.0
|
||||
*/
|
||||
/** @file
|
||||
*/
|
||||
|
@ -97,8 +99,14 @@
|
|||
|
||||
#define REDCONF_IMAP_EXTERNAL 1
|
||||
|
||||
#define REDCONF_DISCARDS 0
|
||||
|
||||
#define REDCONF_IMAGE_BUILDER 0
|
||||
|
||||
#define REDCONF_CHECKER 0
|
||||
|
||||
#define RED_CONFIG_UTILITY_VERSION 0x2000000U
|
||||
|
||||
#define RED_CONFIG_MINCOMPAT_VER 0x1000200U
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1563,5 +1563,5 @@ const char *pcAttrib;
|
|||
|
||||
/* Create a string that includes the file name, the file size and the
|
||||
attributes string. */
|
||||
sprintf( pcBuffer, "%s [%s] [size=%d]", pxDirent->d_name, pcAttrib, pxDirent->d_stat.st_size );
|
||||
sprintf( pcBuffer, "%s [%s] [size=%lld]", pxDirent->d_name, pcAttrib, pxDirent->d_stat.st_size );
|
||||
}
|
||||
|
|
|
@ -45,9 +45,6 @@
|
|||
/* If Win32 port */
|
||||
#ifdef WIN32
|
||||
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0600
|
||||
|
||||
/* Standard includes. */
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
|
|
|
@ -222,7 +222,7 @@ static void vInitStartMarkers()
|
|||
volatile int recorder_busy = 0;
|
||||
|
||||
/* Gives the last error message of the recorder. NULL if no error message. */
|
||||
char* traceErrorMessage = NULL;
|
||||
const char* traceErrorMessage = NULL;
|
||||
|
||||
void* xTraceNextFreeEventBufferSlot(void)
|
||||
{
|
||||
|
@ -468,7 +468,7 @@ void vTraceError(const char* msg)
|
|||
|
||||
if (traceErrorMessage == NULL)
|
||||
{
|
||||
traceErrorMessage = (char*)msg;
|
||||
traceErrorMessage = msg;
|
||||
(void)strncpy(RecorderDataPtr->systemInfo, traceErrorMessage, 80);
|
||||
RecorderDataPtr->internalErrorOccured = 1;
|
||||
}
|
||||
|
|
|
@ -14,5 +14,8 @@ missing if the contributor does not use GitHub.
|
|||
Credits
|
||||
-------
|
||||
|
||||
None yet! ;)
|
||||
Jean-Christophe Dubois (jcdubois)
|
||||
Created a user-space Linux port of Reliance Edge, ported the open-source host
|
||||
tools (including the formatter and image builder) to Linux, and created a FUSE
|
||||
(File System in User Space) implementation for Reliance Edge.
|
||||
|
||||
|
|
|
@ -7,6 +7,14 @@ in your application; or an alternate minimalist API if your application has
|
|||
simple storage needs. Reliance Edge is highly configurable and can be tuned to
|
||||
the precise needs of your application.
|
||||
|
||||
## Getting Help
|
||||
|
||||
You will find this section later in our readme as well - but we wanted to tell
|
||||
you up front: DATALIGHT WANTS TO HEAR FROM YOU! Whether it's just to make
|
||||
comments about the product, to suggest new features, or to tell us what you
|
||||
don't like - reach out! All comments and inquiries can be directed to
|
||||
<RelianceEdgeSupport@datalight.com>.
|
||||
|
||||
## Documentation
|
||||
|
||||
The complete documentation for Reliance Edge is distributed separately. It
|
||||
|
@ -17,10 +25,10 @@ from here:
|
|||
|
||||
<http://www.datalight.com/reliance-edge>
|
||||
|
||||
In addition this README, see [doc/release_notes.md](doc/release_notes.md) for a
|
||||
list of updates to Reliance Edge and a list of known issues. There is also a
|
||||
quick-start guide in the doc/ directory that describes step-by-step how to
|
||||
compile and run Reliance Edge in a simulated Windows environment.
|
||||
In addition this README, see doc/release_notes.md for a list of updates
|
||||
to Reliance Edge and a list of known issues. There is also a quick-start
|
||||
guide in the doc/ directory that describes step-by-step how to compile
|
||||
and run Reliance Edge in a simulated Windows environment.
|
||||
|
||||
## Why Use Reliance Edge?
|
||||
|
||||
|
|
|
@ -12,6 +12,15 @@ highly configurable and can be tuned to the precise needs of your
|
|||
application.
|
||||
|
||||
|
||||
Getting Help
|
||||
|
||||
You will find this section later in our readme as well - but we wanted
|
||||
to tell you up front: DATALIGHT WANTS TO HEAR FROM YOU! Whether it's
|
||||
just to make comments about the product, to suggest new features, or to
|
||||
tell us what you don't like - reach out! All comments and inquiries can
|
||||
be directed to RelianceEdgeSupport@datalight.com.
|
||||
|
||||
|
||||
Documentation
|
||||
|
||||
The complete documentation for Reliance Edge is distributed separately.
|
||||
|
|
|
@ -65,7 +65,7 @@ VOLUME * CONST_IF_ONE_VOLUME gpRedVolume = &gaRedVolume[0U];
|
|||
COREVOLUME * CONST_IF_ONE_VOLUME gpRedCoreVol = &gaCoreVol[0U];
|
||||
METAROOT *gpRedMR = &gaCoreVol[0U].aMR[0U];
|
||||
|
||||
CONST_IF_ONE_VOLUME uint8_t gbRedVolNum;
|
||||
CONST_IF_ONE_VOLUME uint8_t gbRedVolNum = 0;
|
||||
|
||||
|
||||
/** @brief Initialize the Reliance Edge file system driver.
|
||||
|
@ -1235,7 +1235,7 @@ REDSTATUS RedCoreLookup(
|
|||
@param pszSrcName The name of the file or directory to rename.
|
||||
@param ulDstPInode The new parent directory inode number of the file or
|
||||
directory after the rename.
|
||||
@param pszNewPath The new name of the file or directory after the rename.
|
||||
@param pszDstName The new name of the file or directory after the rename.
|
||||
|
||||
@return A negated ::REDSTATUS code indicating the operation result.
|
||||
|
||||
|
@ -1314,7 +1314,7 @@ REDSTATUS RedCoreRename(
|
|||
@param pszSrcName The name of the file or directory to rename.
|
||||
@param ulDstPInode The new parent directory inode number of the file or
|
||||
directory after the rename.
|
||||
@param pszNewPath The new name of the file or directory after the rename.
|
||||
@param pszDstName The new name of the file or directory after the rename.
|
||||
|
||||
@return A negated ::REDSTATUS code indicating the operation result.
|
||||
|
||||
|
|
|
@ -199,21 +199,23 @@ REDSTATUS RedDirEntryDelete(
|
|||
}
|
||||
else if((DirEntryIndexToOffset(ulDeleteIdx) + DIRENT_SIZE) == pPInode->pInodeBuf->ullSize)
|
||||
{
|
||||
uint32_t ulTruncIdx = ulDeleteIdx;
|
||||
/* Start searching one behind the index to be deleted.
|
||||
*/
|
||||
uint32_t ulTruncIdx = ulDeleteIdx - 1U;
|
||||
bool fDone = false;
|
||||
|
||||
/* We are deleting the last dirent in the directory, so search
|
||||
backwards to find the last populated dirent, allowing us to truncate
|
||||
the directory to that point.
|
||||
*/
|
||||
while((ret == 0) && (ulTruncIdx > 0U) && !fDone)
|
||||
while((ret == 0) && (ulTruncIdx != UINT32_MAX) && !fDone)
|
||||
{
|
||||
ret = RedInodeDataSeekAndRead(pPInode, ulTruncIdx / DIRENTS_PER_BLOCK);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
const DIRENT *pDirents = CAST_CONST_DIRENT_PTR(pPInode->pbData);
|
||||
uint32_t ulBlockIdx = (ulTruncIdx - 1U) % DIRENTS_PER_BLOCK;
|
||||
uint32_t ulBlockIdx = ulTruncIdx % DIRENTS_PER_BLOCK;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -242,6 +244,12 @@ REDSTATUS RedDirEntryDelete(
|
|||
}
|
||||
}
|
||||
|
||||
/* Currently ulTruncIdx represents the last valid dirent index, or
|
||||
UINT32_MAX if the directory is now empty. Increment it so that it
|
||||
represents the first invalid entry, which will be truncated.
|
||||
*/
|
||||
ulTruncIdx++;
|
||||
|
||||
/* Truncate the directory, deleting the requested entry and any empty
|
||||
dirents at the end of the directory.
|
||||
*/
|
||||
|
@ -449,7 +457,7 @@ REDSTATUS RedDirEntryLookup(
|
|||
#if (REDCONF_API_POSIX_READDIR == 1) || (REDCONF_CHECKER == 1)
|
||||
/** @brief Read the next entry from a directory, given a starting index.
|
||||
|
||||
@param pInode A pointer to the cached inode structure of the directory to
|
||||
@param pPInode A pointer to the cached inode structure of the directory to
|
||||
read from.
|
||||
@param pulIdx On entry, the directory index to start reading from. On
|
||||
successful return, populated with the directory index to use
|
||||
|
|
|
@ -158,6 +158,7 @@ REDSTATUS RedImapBlockSet(
|
|||
}
|
||||
|
||||
/* Adjust the free/almost free block count if the block was allocable.
|
||||
Discard the block if required.
|
||||
*/
|
||||
if((ret == 0) && (ulBlock >= gpRedCoreVol->ulFirstAllocableBN))
|
||||
{
|
||||
|
|
|
@ -63,6 +63,10 @@ REDSTATUS RedVolMount(void)
|
|||
|
||||
if(ret != 0)
|
||||
{
|
||||
/* If we fail to mount, invalidate the buffers to prevent any
|
||||
confusion that could be caused by stale or corrupt metadata.
|
||||
*/
|
||||
(void)RedBufferDiscardRange(0U, gpRedVolume->ulBlockCount);
|
||||
(void)RedOsBDevClose(gbRedVolNum);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,39 @@ recent releases and a list of known issues.
|
|||
|
||||
## Release History and Changes
|
||||
|
||||
### Reliance Edge v2.0, January 2017
|
||||
|
||||
- Added support for Linux as a host environment
|
||||
- All "host" projects may now be built in either Windows or Linux using the
|
||||
`make` command. The formatter and image builder are built, and the checker
|
||||
and image copier are also built in the commercial kit.
|
||||
- An additional host tool has been added for Linux only: `redfuse`. It is a
|
||||
File System in User Space (FUSE) implementation, allowing a Reliance Edge
|
||||
volume to be mounted directly on Linux for easy access. It is built from
|
||||
the host project folder using the command `make redfuse`.
|
||||
- The OS-specific API test (commercial kit only) is now ported to run on Linux
|
||||
for the purpose of verifying the FUSE implementation.
|
||||
- Fixed a bug that could leave a directory in an invalid state after removing
|
||||
files. For example, an affected directory might report a non-zero length even
|
||||
after all files had been deleted.
|
||||
- Fixed a bug that would leave the driver in a bad state if a mount operation
|
||||
failed due to missing or corrupt metaroot blocks.
|
||||
|
||||
### Reliance Edge v1.1 (Beta), November 2016
|
||||
|
||||
- Added support for a discard (trim) interface in the commercial kit. While
|
||||
discards are not integral to the behavior of the filesystem, they allow
|
||||
certain types of Flash drivers and media to perform at optimal speed and
|
||||
efficiency. The commercial version of Reliance Edge now allows the user to
|
||||
implement this interface for compatible storage media.
|
||||
- This change added new fields to the configuration files redconf.h and
|
||||
redconf.c. The configuration utility has been updated to version 1.1 and
|
||||
existing configuration files must be updated using the updated utility.
|
||||
- The configuration utility now has keyboard shortcuts for opening and saving
|
||||
the configuration.
|
||||
- The configuration utility now adds version macros to easily identify when an
|
||||
outdated configuration file is used with Reliance Edge or vice versa.
|
||||
|
||||
### Reliance Edge v1.0.4, July 2016
|
||||
|
||||
- Added ARM mbed and ARM mbed OS support in the commercial kit, with an example
|
||||
|
@ -23,7 +56,7 @@ recent releases and a list of known issues.
|
|||
number of times to retry a block device read, write or flush operation before
|
||||
returning a failure. The configuration tool has been updated to version 1.0.2
|
||||
with this change.
|
||||
- This added a new field to the volume configuration in to redconf.c: existing
|
||||
- This added a new field to the volume configuration in redconf.c: existing
|
||||
redconf.c files from v1.0.1 and earlier must be updated to work with v1.0.2.
|
||||
Open redconf.h and redconf.c with the configuration tool, enable
|
||||
"Retry block device I/O on failure" for any volumes if desired, and save the
|
||||
|
|
|
@ -9,6 +9,44 @@ course of recent releases and a list of known issues.
|
|||
|
||||
Release History and Changes
|
||||
|
||||
Reliance Edge v2.0, January 2017
|
||||
|
||||
- Added support for Linux as a host environment
|
||||
- All "host" projects may now be built in either Windows or Linux
|
||||
using the make command. The formatter and image builder are built,
|
||||
and the checker and image copier are also built in the
|
||||
commercial kit.
|
||||
- An additional host tool has been added for Linux only: redfuse. It
|
||||
is a File System in User Space (FUSE) implementation, allowing a
|
||||
Reliance Edge volume to be mounted directly on Linux for
|
||||
easy access. It is built from the host project folder using the
|
||||
command make redfuse.
|
||||
- The OS-specific API test (commercial kit only) is now ported to run
|
||||
on Linux for the purpose of verifying the FUSE implementation.
|
||||
- Fixed a bug that could leave a directory in an invalid state after
|
||||
removing files. For example, an affected directory might report a
|
||||
non-zero length even after all files had been deleted.
|
||||
- Fixed a bug that would leave the driver in a bad state if a mount
|
||||
operation failed due to missing or corrupt metaroot blocks.
|
||||
|
||||
Reliance Edge v1.1 (Beta), November 2016
|
||||
|
||||
- Added support for a discard (trim) interface in the commercial kit.
|
||||
While discards are not integral to the behavior of the filesystem,
|
||||
they allow certain types of Flash drivers and media to perform at
|
||||
optimal speed and efficiency. The commercial version of Reliance
|
||||
Edge now allows the user to implement this interface for compatible
|
||||
storage media.
|
||||
- This change added new fields to the configuration files redconf.h
|
||||
and redconf.c. The configuration utility has been updated to version
|
||||
1.1 and existing configuration files must be updated using the
|
||||
updated utility.
|
||||
- The configuration utility now has keyboard shortcuts for opening and
|
||||
saving the configuration.
|
||||
- The configuration utility now adds version macros to easily identify
|
||||
when an outdated configuration file is used with Reliance Edge or
|
||||
vice versa.
|
||||
|
||||
Reliance Edge v1.0.4, July 2016
|
||||
|
||||
- Added ARM mbed and ARM mbed OS support in the commercial kit, with
|
||||
|
@ -29,7 +67,7 @@ Common Code Changes
|
|||
specify a number of times to retry a block device read, write or
|
||||
flush operation before returning a failure. The configuration tool
|
||||
has been updated to version 1.0.2 with this change.
|
||||
- This added a new field to the volume configuration in to redconf.c:
|
||||
- This added a new field to the volume configuration in redconf.c:
|
||||
existing redconf.c files from v1.0.1 and earlier must be updated to
|
||||
work with v1.0.2. Open redconf.h and redconf.c with the
|
||||
configuration tool, enable "Retry block device I/O on failure" for
|
||||
|
|
|
@ -28,6 +28,19 @@
|
|||
#ifndef REDCONFIGCHK_H
|
||||
#define REDCONFIGCHK_H
|
||||
|
||||
#ifdef RED_CONFIG_MINCOMPAT_VER
|
||||
#if (RED_VERSION_VAL & 0xFFFFFF00U) < (RED_CONFIG_MINCOMPAT_VER & 0xFFFFFF00U)
|
||||
/* This indicates that your configuration files were generated by a
|
||||
version of the Reliance Edge Configuration Utility that is designed
|
||||
for a more recent version of Reliance Edge and is no longer compatible
|
||||
with this version. You can update to the most recent version of
|
||||
Reliance Edge or contact RelianceEdgeSupport@datalight.com to obtain
|
||||
the correct legacy version of the Configuration Utility.
|
||||
*/
|
||||
#error "Your configuration is not compatible with this version of Reliance Edge. Please download the latest version of Reliance Edge or recreate your configuration with an older version of the Configuration Utility."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef REDCONF_READ_ONLY
|
||||
#error "Configuration error: REDCONF_READ_ONLY must be defined."
|
||||
#endif
|
||||
|
@ -142,6 +155,16 @@
|
|||
#ifndef REDCONF_VOLUME_COUNT
|
||||
#error "Configuration error: REDCONF_VOLUME_COUNT must be defined."
|
||||
#endif
|
||||
#ifndef REDCONF_DISCARDS
|
||||
/* Reliance Edge 1.0.5 and below did not have REDCONF_DISCARDS. You can
|
||||
fix this error by downloading the latest version of the Configuration
|
||||
Utility (assuming you are using the latest version of Reliance Edge)
|
||||
from http://www.datalight.com/reliance-edge, loading your redconf.c
|
||||
and redconf.h files, and saving them again, replacing the original
|
||||
files.
|
||||
*/
|
||||
#error "Configuration error: your redconf.h is not compatible. Update your redconf files with a compatible version of the configuration utility."
|
||||
#endif
|
||||
#ifndef REDCONF_IMAGE_BUILDER
|
||||
#error "Configuration error: REDCONF_IMAGE_BUILDER must be defined."
|
||||
#endif
|
||||
|
@ -297,6 +320,10 @@
|
|||
#error "REDCONF_VOLUME_COUNT must be an integer between 1 and 255"
|
||||
#endif
|
||||
|
||||
#if (REDCONF_DISCARDS != 0) && (REDCONF_DISCARDS != 1)
|
||||
#error "Configuration error: REDCONF_DISCARDS must be either 0 or 1."
|
||||
#endif
|
||||
|
||||
/* REDCONF_BUFFER_COUNT lower limit checked in buffer.c
|
||||
*/
|
||||
#if REDCONF_BUFFER_COUNT > 255U
|
||||
|
@ -312,6 +339,11 @@
|
|||
#endif
|
||||
|
||||
|
||||
#if (REDCONF_DISCARDS == 1) && (RED_KIT == RED_KIT_GPL)
|
||||
#error "REDCONF_DISCARDS not supported in Reliance Edge under GPL. Contact sales@datalight.com to upgrade."
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -49,6 +49,5 @@
|
|||
|| ((REDCONF_API_FSE == 1) && (REDCONF_API_FSE_FORMAT == 1)) \
|
||||
|| (REDCONF_IMAGE_BUILDER == 1)))
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
|
||||
#include <redconf.h>
|
||||
#include "redver.h"
|
||||
#include "redconfigchk.h"
|
||||
#include <redtypes.h>
|
||||
#include "rederrno.h"
|
||||
|
@ -38,7 +39,6 @@
|
|||
#include "redutils.h"
|
||||
#include "redosserv.h"
|
||||
#include "redmisc.h"
|
||||
#include "redver.h"
|
||||
#include "redexclude.h"
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
#define STOCH_POSIX_TEST_SUPPORTED \
|
||||
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
|
||||
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX == 1) \
|
||||
&& (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX_FORMAT == 1) && (REDCONF_API_POSIX_READDIR == 1) \
|
||||
&& (REDCONF_API_POSIX_FORMAT == 1) && (REDCONF_API_POSIX_READDIR == 1) \
|
||||
&& (REDCONF_API_POSIX_MKDIR == 1) && (REDCONF_API_POSIX_RMDIR == 1) && (REDCONF_API_POSIX_UNLINK == 1) \
|
||||
&& (REDCONF_API_POSIX_RENAME == 1))
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
|
||||
uint8_t RedFindVolumeNumber(const char *pszVolume);
|
||||
bool RedConfirmOperation(const char *pszMessage);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
183
FreeRTOS-Plus/Source/Reliance-Edge/include/redtools.h
Normal file
183
FreeRTOS-Plus/Source/Reliance-Edge/include/redtools.h
Normal file
|
@ -0,0 +1,183 @@
|
|||
/* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
|
||||
|
||||
Copyright (c) 2014-2015 Datalight, Inc.
|
||||
All Rights Reserved Worldwide.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; use version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
/* Businesses and individuals that for commercial or other reasons cannot
|
||||
comply with the terms of the GPLv2 license may obtain a commercial license
|
||||
before incorporating Reliance Edge into proprietary software for
|
||||
distribution in any form. Visit http://www.datalight.com/reliance-edge for
|
||||
more information.
|
||||
*/
|
||||
#ifndef REDTOOLS_H
|
||||
#define REDTOOLS_H
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#define HOST_PATH_MAX MAX_PATH
|
||||
#else
|
||||
#include <linux/limits.h>
|
||||
#define HOST_PATH_MAX PATH_MAX
|
||||
#endif
|
||||
|
||||
|
||||
#if REDCONF_IMAGE_BUILDER == 1
|
||||
|
||||
#define MACRO_NAME_MAX_LEN 32
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t bVolNumber;
|
||||
const char *pszInputDir;
|
||||
const char *pszOutputFile;
|
||||
#if REDCONF_API_POSIX == 1
|
||||
const char *pszVolName;
|
||||
#else
|
||||
const char *pszMapFile;
|
||||
const char *pszDefineFile;
|
||||
bool fNowarn;
|
||||
#endif
|
||||
} IMGBLDPARAM;
|
||||
|
||||
|
||||
void ImgbldParseParams(int argc, char *argv [], IMGBLDPARAM *pParam);
|
||||
int ImgbldStart(IMGBLDPARAM *pParam);
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#if REDCONF_API_POSIX == 1
|
||||
char asOutFilePath[HOST_PATH_MAX];
|
||||
#else
|
||||
uint32_t ulOutFileIndex;
|
||||
#endif
|
||||
char asInFilePath[HOST_PATH_MAX];
|
||||
} FILEMAPPING;
|
||||
|
||||
|
||||
extern void *gpCopyBuffer;
|
||||
extern uint32_t gulCopyBufferSize;
|
||||
|
||||
|
||||
/* Implemented in ibposix.c
|
||||
*/
|
||||
#if REDCONF_API_POSIX == 1
|
||||
REDSTATUS IbPosixCopyDir(const char *pszVolName, const char *pszInDir);
|
||||
int IbPosixCreateDir(const char *pszVolName, const char *pszFullPath, const char *pszBasePath);
|
||||
int IbConvertPath(const char *pszVolName, const char *pszFullPath, const char *pszBasePath, char *szOutPath);
|
||||
#endif
|
||||
|
||||
|
||||
/* Implemented in ibfse.c
|
||||
*/
|
||||
#if REDCONF_API_FSE == 1
|
||||
typedef struct sFILELISTENTRY FILELISTENTRY;
|
||||
struct sFILELISTENTRY
|
||||
{
|
||||
FILEMAPPING fileMapping;
|
||||
FILELISTENTRY *pNext;
|
||||
};
|
||||
|
||||
|
||||
void FreeFileList(FILELISTENTRY **ppsFileList);
|
||||
|
||||
int IbFseGetFileList(const char *pszPath, const char *pszIndirPath, FILELISTENTRY **ppFileListHead);
|
||||
int IbFseOutputDefines(FILELISTENTRY *pFileList, const IMGBLDPARAM *pOptions);
|
||||
int IbFseCopyFiles(int volNum, const FILELISTENTRY *pFileList);
|
||||
#endif
|
||||
|
||||
|
||||
/* Implemented in os-specific space (ibwin.c and iblinux.c)
|
||||
*/
|
||||
#if REDCONF_API_POSIX == 1
|
||||
int IbPosixCopyDirRecursive(const char *pszVolName, const char *pszInDir);
|
||||
#endif
|
||||
#if REDCONF_API_FSE == 1
|
||||
int IbFseBuildFileList(const char *pszDirPath, FILELISTENTRY **ppFileListHead);
|
||||
#endif
|
||||
#if REDCONF_API_FSE == 1
|
||||
int IbSetRelativePath(char *pszPath, const char *pszParentPath);
|
||||
#endif
|
||||
bool IsRegularFile(const char *pszPath);
|
||||
|
||||
|
||||
/* Implemented in ibcommon.c
|
||||
*/
|
||||
int IbCopyFile(int volNum, const FILEMAPPING *pFileMapping);
|
||||
int IbCheckFileExists(const char *pszPath, bool *pfExists);
|
||||
|
||||
|
||||
/* Implemented separately in ibfse.c and ibposix.c
|
||||
*/
|
||||
int IbApiInit(void);
|
||||
int IbApiUninit(void);
|
||||
int IbWriteFile(int volNum, const FILEMAPPING *pFileMapping, uint64_t ullOffset, void *pData, uint32_t ulDataLen);
|
||||
|
||||
#endif /* IMAGE_BUILDER */
|
||||
|
||||
/* For image copier tool
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#define HOST_PSEP '\\'
|
||||
#if !__STDC__
|
||||
#define snprintf _snprintf
|
||||
#define stat _stat
|
||||
#define S_IFDIR _S_IFDIR
|
||||
#define rmdir _rmdir
|
||||
#endif
|
||||
#else
|
||||
#define HOST_PSEP '/'
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t bVolNumber;
|
||||
const char *pszOutputDir;
|
||||
const char *pszBDevSpec;
|
||||
#if REDCONF_API_POSIX == 1
|
||||
const char *pszVolName;
|
||||
#endif
|
||||
bool fNoWarn;
|
||||
} IMGCOPYPARAM;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#if REDCONF_API_POSIX == 1
|
||||
const char *pszVolume; /* Volume path prefix. */
|
||||
uint32_t ulVolPrefixLen; /* strlen(COPIER::pszVolume) */
|
||||
#else
|
||||
uint8_t bVolNum; /* Volume number. */
|
||||
#endif
|
||||
const char *pszOutputDir; /* Output directory path. */
|
||||
bool fNoWarn; /* If true, no warning to overwrite. */
|
||||
uint8_t *pbCopyBuffer; /* Buffer for copying file data. */
|
||||
} COPIER;
|
||||
|
||||
|
||||
void ImgcopyParseParams(int argc, char *argv [], IMGCOPYPARAM *pParam);
|
||||
int ImgcopyStart(IMGCOPYPARAM *pParam);
|
||||
|
||||
/* Implemented separately in imgcopywin.c and imgcopylinux.c. These functions
|
||||
print an error message and abort on failure.
|
||||
*/
|
||||
void ImgcopyMkdir(const char *pszDir);
|
||||
void ImgcopyRecursiveRmdir(const char *pszDir);
|
||||
|
||||
|
||||
#endif /* REDTOOLS_H */
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
<!-- This macro is updated automatically: do not edit! -->
|
||||
*/
|
||||
#define RED_BUILD_NUMBER "677"
|
||||
#define RED_BUILD_NUMBER "700"
|
||||
|
||||
#define RED_KIT_GPL 0U /* Open source GPL kit. */
|
||||
#define RED_KIT_COMMERCIAL 1U /* Commercially-licensed kit. */
|
||||
|
@ -48,8 +48,13 @@
|
|||
|
||||
/** @brief Version number to display in output.
|
||||
*/
|
||||
#define RED_VERSION "v1.0.4"
|
||||
#define RED_VERSION "v2.0"
|
||||
|
||||
/** @brief Version number in hex.
|
||||
|
||||
The most significant byte is the major version number, etc.
|
||||
*/
|
||||
#define RED_VERSION_VAL 0x02000000U
|
||||
|
||||
/** @brief On-disk version number.
|
||||
|
||||
|
@ -67,7 +72,7 @@
|
|||
/* Specifies whether the product is in alpha stage, beta stage, or neither.
|
||||
*/
|
||||
#if 0
|
||||
#if 1
|
||||
#if 0
|
||||
#define ALPHABETA " (Alpha)"
|
||||
#else
|
||||
#define ALPHABETA " (Beta)"
|
||||
|
@ -83,7 +88,7 @@
|
|||
|
||||
/** @brief Product copyright.
|
||||
*/
|
||||
#define RED_PRODUCT_LEGAL "Copyright (c) 2014-2016 Datalight, Inc. All Rights Reserved Worldwide."
|
||||
#define RED_PRODUCT_LEGAL "Copyright (c) 2014-2017 Datalight, Inc. All Rights Reserved Worldwide."
|
||||
|
||||
|
||||
/** @brief Product patents.
|
||||
|
|
|
@ -1061,6 +1061,7 @@ static REDSTATUS DiskFlush(
|
|||
#error "The STM32 StdPeriph driver is not supported. Please use the HAL driver or modify the Reliance Edge block device interface."
|
||||
#endif
|
||||
|
||||
|
||||
/** @brief Number of times to call BSP_SD_GetStatus() before timing out and
|
||||
returning an error.
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <redcoreapi.h>
|
||||
#include <redvolume.h>
|
||||
#include <redposix.h>
|
||||
#include "redpath.h"
|
||||
#include <redpath.h>
|
||||
|
||||
|
||||
static bool IsRootDir(const char *pszLocalPath);
|
||||
|
@ -405,11 +405,11 @@ static bool IsRootDir(
|
|||
Example | Result
|
||||
------- | ------
|
||||
"" false
|
||||
"\" false
|
||||
"\\" false
|
||||
"/" false
|
||||
"//" false
|
||||
"a" true
|
||||
"\a" true
|
||||
"\\a" true
|
||||
"/a" true
|
||||
"//a" true
|
||||
|
||||
@param pszPathIdx The path to examine, incremented to the point of
|
||||
interest.
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <redvolume.h>
|
||||
#include <redcoreapi.h>
|
||||
#include <redposix.h>
|
||||
#include "redpath.h"
|
||||
#include <redpath.h>
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
|
|
|
@ -152,10 +152,11 @@ static int red_stat(const char *pszPath, REDSTAT *pStat);
|
|||
#define link(path, hardlink) red_link(MakeFullPath(path), MakeFullPath(hardlink))
|
||||
#define opendir(path) red_opendir(MakeFullPath(path))
|
||||
|
||||
#define FSSTRESS_BUF_SIZE 1024U
|
||||
|
||||
/* Stores the simulated current working directory.
|
||||
*/
|
||||
static char szLocalCwd[1024U] = "/";
|
||||
static char szLocalCwd[FSSTRESS_BUF_SIZE] = "/";
|
||||
|
||||
|
||||
/** @brief Change the current working directory.
|
||||
|
@ -195,7 +196,7 @@ static int red_chdir(
|
|||
}
|
||||
else
|
||||
{
|
||||
char szOldCwd[1024U];
|
||||
char szOldCwd[FSSTRESS_BUF_SIZE];
|
||||
|
||||
/* chdir() must have no effect on the CWD if it fails, so save the CWD
|
||||
so we can revert it if necessary.
|
||||
|
@ -324,7 +325,7 @@ static const char *MakeFullPath(
|
|||
const char *pszName)
|
||||
{
|
||||
#define MAXVOLNAME 64U /* Enough for most configs. */
|
||||
static char aszFullPath[2U][MAXVOLNAME + 1U + 1024U];
|
||||
static char aszFullPath[2U][MAXVOLNAME + 1U + FSSTRESS_BUF_SIZE];
|
||||
static uint32_t ulWhich = 0U;
|
||||
|
||||
char *pszFullPath = aszFullPath[ulWhich];
|
||||
|
|
|
@ -93,7 +93,7 @@ int32_t RedAtoI(
|
|||
significant digits than can be represented in a uint32_t variable, the
|
||||
output is unspecified.
|
||||
|
||||
@param pachNum A pointer to a constant array of hex characters.
|
||||
@param pszNum A pointer to a constant array of hex characters.
|
||||
@param pulNum A pointer to the location in which to store the uint32_t
|
||||
result. Upon return, this value will be modified ONLY if
|
||||
the function succeeds and the returned pointer is valid (not
|
||||
|
|
|
@ -376,7 +376,7 @@ uint64_t RedMulDiv64(
|
|||
|
||||
@param ullDividend The value to divide.
|
||||
@param ulDivisor The value to divide by.
|
||||
@param pulRemander Populated with the remainder; may be NULL.
|
||||
@param pulRemainder Populated with the remainder; may be NULL.
|
||||
|
||||
@return The quotient (result of the division).
|
||||
*/
|
||||
|
@ -480,9 +480,9 @@ uint64_t RedUint64DivMod32(
|
|||
However, it does so without ever actually dividing/modulating a 64-bit
|
||||
value, since such operations are not allowed in all environments.
|
||||
|
||||
@param ullDividend The value to divide.
|
||||
@param ullDivisor The value to divide by.
|
||||
@param pullRemander Populated with the remainder; may be NULL.
|
||||
@param ullDividend The value to divide.
|
||||
@param ullDivisor The value to divide by.
|
||||
@param pullRemainder Populated with the remainder; may be NULL.
|
||||
|
||||
@return The quotient (result of the division).
|
||||
*/
|
||||
|
|
|
@ -143,7 +143,7 @@ typedef struct
|
|||
|
||||
|
||||
static uint32_t ProcessFormatSegment(char *pcBuffer, uint32_t ulBufferLen, const char *pszFormat, PRINTFORMAT *pFormat, uint32_t *pulSpecifierLen);
|
||||
static uint32_t ParseFormatSpecifier(char const *pszFomat, PRINTFORMAT *pFormatType);
|
||||
static uint32_t ParseFormatSpecifier(char const *pszFormat, PRINTFORMAT *pFormatType);
|
||||
static PRINTTYPE ParseFormatType(const char *pszFormat, uint32_t *pulTypeLen);
|
||||
static uint32_t LtoA(char *pcBuffer, uint32_t ulBufferLen, int32_t lNum, uint32_t ulFillLen, char cFill);
|
||||
static uint32_t LLtoA(char *pcBuffer, uint32_t ulBufferLen, int64_t llNum, uint32_t ulFillLen, char cFill);
|
||||
|
@ -719,20 +719,20 @@ static uint32_t ProcessFormatSegment(
|
|||
not found.
|
||||
*/
|
||||
static uint32_t ParseFormatSpecifier(
|
||||
char const *pszFomat,
|
||||
char const *pszFormat,
|
||||
PRINTFORMAT *pFormatType)
|
||||
{
|
||||
bool fContainsIllegalSequence = false;
|
||||
uint32_t ulLen = 0U;
|
||||
uint32_t ulIdx = 0U;
|
||||
|
||||
while(pszFomat[ulIdx] != '\0')
|
||||
while(pszFormat[ulIdx] != '\0')
|
||||
{
|
||||
uint32_t ulTypeLen;
|
||||
|
||||
/* general output
|
||||
*/
|
||||
if(pszFomat[ulIdx] != '%')
|
||||
if(pszFormat[ulIdx] != '%')
|
||||
{
|
||||
ulIdx++;
|
||||
}
|
||||
|
@ -745,15 +745,15 @@ static uint32_t ParseFormatSpecifier(
|
|||
pFormatType->ulSpecifierIdx = ulIdx;
|
||||
ulIdx++;
|
||||
|
||||
if(pszFomat[ulIdx] == '-')
|
||||
if(pszFormat[ulIdx] == '-')
|
||||
{
|
||||
pFormatType->fLeftJustified = true;
|
||||
ulIdx++;
|
||||
}
|
||||
|
||||
if((pszFomat[ulIdx] == '0') || (pszFomat[ulIdx] == '_'))
|
||||
if((pszFormat[ulIdx] == '0') || (pszFormat[ulIdx] == '_'))
|
||||
{
|
||||
pFormatType->cFillChar = pszFomat[ulIdx];
|
||||
pFormatType->cFillChar = pszFormat[ulIdx];
|
||||
ulIdx++;
|
||||
}
|
||||
else
|
||||
|
@ -761,15 +761,15 @@ static uint32_t ParseFormatSpecifier(
|
|||
pFormatType->cFillChar = ' ';
|
||||
}
|
||||
|
||||
if(pszFomat[ulIdx] == '*')
|
||||
if(pszFormat[ulIdx] == '*')
|
||||
{
|
||||
pFormatType->fHasVarWidth = true;
|
||||
ulIdx++;
|
||||
}
|
||||
else if(ISDIGIT(pszFomat[ulIdx]))
|
||||
else if(ISDIGIT(pszFormat[ulIdx]))
|
||||
{
|
||||
pFormatType->ulFillLen = (uint32_t)RedAtoI(&pszFomat[ulIdx]);
|
||||
while(ISDIGIT(pszFomat[ulIdx]))
|
||||
pFormatType->ulFillLen = (uint32_t)RedAtoI(&pszFormat[ulIdx]);
|
||||
while(ISDIGIT(pszFormat[ulIdx]))
|
||||
{
|
||||
ulIdx++;
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ static uint32_t ParseFormatSpecifier(
|
|||
*/
|
||||
}
|
||||
|
||||
pFormatType->type = ParseFormatType(&pszFomat[ulIdx], &ulTypeLen);
|
||||
pFormatType->type = ParseFormatType(&pszFormat[ulIdx], &ulTypeLen);
|
||||
if(pFormatType->type != PRFMT_UNKNOWN)
|
||||
{
|
||||
/* Even though we are returning successfully, keep track of
|
||||
|
|
Loading…
Reference in a new issue