📄 flchkdef.h
字号:
/******************************************************************************/
/* */
/* Copyright (C), 1995-2006, msystems Ltd. All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* 1. Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* 3. Neither the name of msystems nor the names of its contributors may be */
/* used to endorse or promote products derived from this software without */
/* specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED */
/* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR */
/* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/******************************************************************************/
/*
* $Log: V:/PVCSDB/DiskOnChip/archives/Testing/TrueFFS 6.3/Drop 2.5/3/common/flchkdef.h-arc $
*
* Rev 1.78.2.3 Sep 13 2006 10:44:22 yaniv.iarovici
* Update version to EQA3 Alpha2
*
* Rev 1.78.1.6 Sep 11 2006 13:45:20 yaniv.iarovici
* Legal header added
*
* Rev 1.78.1.5 Sep 10 2006 10:04:00 Yaniv.Iarovici
* Update version number - DOC Driver 1.0 EQA1 Alpha2.
*
* Rev 1.78.1.4 Sep 03 2006 14:44:50 Yaniv.Iarovici
* 1. Define flReadEvenNumberOfBytes() instead of flRead512Bytes() to support DRQ>1
* 2. Define flWriteEvenNumberOfBytes() instead of flWrite512Bytes() to support DRQ>1
*
* Rev 1.78.1.3 Aug 22 2006 13:24:40 Yaniv.Iarovici
* Change FL_MAX_TL_PARTITIONS default to '14'
*
* Rev 1.78.1.2 Aug 16 2006 08:46:36 Yaniv.Iarovici
* 1) Change 7.0.0.0 to 1.0.0.0
* 2) Change TrueFFSVersion value to "1020"
* 3) If FL_DOC_ADDRESS is NOT defined and FL_LOW_DOC_ADDRESS defined, set '#define FL_DOC_ADDRESS FL_LOW_DOC_ADDRESS'.
*
* Rev 1.78.1.0 Aug 08 2006 15:55:30 Polina.Marimont
* DOC Driver 1.0 initial
*/
/************************/
/* TrueFFS source files */
/* -------------------- */
/************************/
/*****************************************************************************
* File Header *
* ----------- *
* Name : flchkdef.h *
* *
* Description : Sanity check for flcustom.h files. *
* *
*****************************************************************************/
#ifndef _FL_CHK_DEFS_H_
#define _FL_CHK_DEFS_H_
#include "flcustom.h"
#include "flsystem.h"
#define FL_MIGRATION_VERSION
#ifdef FL_MIGRATION_VERSION /* enable floors support for migration version */
#ifndef FL_DOCH_DONT_SUPPORT_FLOORS
#define DOCH_FLOORS
#endif /*FL_DOCH_DONT_SUPPORT_FLOORS*/
#endif /*FL_MIGRATION_VERSION*/
#define FL_NEW_MAPSECTOR
#ifndef MTD_STANDALONE
/* TrueFFS version
*
* Number written on the flash by INFTL format specifying the TrueFFS version
* The media was formated with. the number bellow specifies version
* 1.0.0.0
*/
#define TrueFFSVersion "1000"
/* Tracking number for TrueFFS configuration managment
*
* Number for configuration mangment of special purpose versions
*/
#define TrueFFS_EQA_Version 3
#define TrueFFS_RC_Version 0
#define TrueFFS_PATCH_Version 0
#define TrueFFS_Alpha_Version 2
#define TrueFFS_Beta_Version 0
/* Programmer type version
*
* This string is placed in the media header indicating the programmer
* Name and version used to format the media
*/
#ifndef FL_PROGRAMMER_NAME
#define FL_PROGRAMMER_NAME "CORE"
#endif /* FL_PROGRAMMER_NAME */
#ifndef FL_PROGRAMMER_VERSION
#define FL_PROGRAMMER_VERSION "0000"
#endif /* FL_PROGRAMMER_VERSION */
/********************************************************************/
/* Device base address (Use previous versions definition if exits */
/* and FL_DOC_ADDRESS does not exist. */
/********************************************************************/
#if !defined(FL_DOC_ADDRESS) && defined(FL_LOW_DOC_ADDRESS)
#define FL_DOC_ADDRESS FL_LOW_DOC_ADDRESS
#endif
/*******************************************/
/* Validity check and overlapping defines */
/*******************************************/
#if !defined(FL_READ_ONLY) && !defined(FS_READ_ONLY) && defined(READ_ONLY)
#define FL_READ_ONLY
#define FS_READ_ONLY
#endif
/* The format option needs some internal defintions */
#if !defined(FL_FORMAT_VOLUME) && defined(FORMAT_VOLUME)
#define FL_FORMAT_VOLUME
#endif
#if (defined(FL_FORMAT_VOLUME) && defined(FL_READ_ONLY))
#error "You can not define FL_READ_ONLY and FL_FORMAT_VOLUME at the same time"
#endif /* (defined(FL_FORMAT_VOLUME) && defined(FL_READ_ONLY)) */
#if (defined(FS_FORMAT_VOLUME) && defined(FS_READ_ONLY))
#error "You can not define FS_READ_ONLY and FS_FORMAT_VOLUME at the same time"
#endif /* (defined(FS_FORMAT_VOLUME) && defined(FS_READ_ONLY)) */
#if (defined(FS_CREATE_LOGICAL_PARTITIONS) && defined(FS_READ_ONLY))
#error "You can not define FS_READ_ONLY and FS_CREATE_LOGICAL_PARTITIONS"
#endif
/* VERIFY_ERASED_SECTOR should always come together with FL_VERIFY_WRITE */
#if !defined(FL_VERIFY_WRITE) && defined(VERIFY_WRITE)
#define FL_VERIFY_WRITE
#endif
#if defined (FL_VERIFY_WRITE) && !defined (VERIFY_ERASED_SECTOR)
#define VERIFY_ERASED_SECTOR
#endif
#if !defined (FL_VERIFY_WRITE) && defined (VERIFY_ERASED_SECTOR)
#define FL_VERIFY_WRITE
#endif
/* In case FL_READ_ONLY is defined FS_READ_ONLY needs to be defined as well */
#ifdef FL_READ_ONLY
#ifndef FS_READ_ONLY
#define FS_RED_ONLY
#endif /* FS_READ_ONLY */
#endif /* FL_READ_ONLY */
/* Validity check for system files MACROES */
#ifndef FL_FOPEN
#define FL_FOPEN
#endif /* FL_FOPEN */
#ifndef FL_FCLOSE
#define FL_FCLOSE
#endif /* FL_FCLOSE */
#ifndef FL_FPRINTF
#define FL_FPRINTF
#endif /* FL_FPRINTF */
/* Number of file system - logical partitions
*
* Defines Maximum Number of logical partitons on a BDTL partition
*
* The actual number of partitions depends on the format placed on each device.
*/
#ifndef FS_MAX_LOGICAL_PARTITIONS
#define FS_MAX_LOGICAL_PARTITIONS 4 /* per TL partition. There is no hard limit */
#endif /* FS_MAX_LOGICAL_PARTITIONS */
/* Validity check of FL_VOLUMES and FL_SOCKETS parameters. */
#if !defined(FL_VOLUMES) && defined(VOLUMES)
#define FL_VOLUMES VOLUMES
#endif
#if !defined(FS_VOLUMES) && defined(FL_VOLUMES)
#define FS_VOLUMES FL_VOLUMES
#endif
#if !defined(FL_SOCKETS) && defined(SOCKETS)
#define FL_SOCKETS SOCKETS
#endif
#if !defined(FS_SOCKETS) && defined(FL_SOCKETS)
#define FS_SOCKETS FL_SOCKETS
#endif
#if !defined(FL_VOLUMES) && defined(FL_SOCKETS)
#define FL_VOLUMES FL_SOCKETS
#endif /* SOCKETS && ! VOLUMES */
#if !defined(FS_VOLUMES) && defined(FS_SOCKETS)
#define FS_VOLUMES FS_SOCKETS
#endif /* SOCKETS && ! VOLUMES */
#if !defined(FL_SOCKETS) && defined(FL_VOLUMES)
#define FL_SOCKETS FL_VOLUMES
#endif /* ! SOCKETS && VOLUMES */
#if !defined(FS_SOCKETS) && defined(FS_VOLUMES)
#define FS_SOCKETS FS_VOLUMES
#endif /* ! SOCKETS && VOLUMES */
#if (FL_SOCKETS > FL_VOLUMES) || (FS_SOCKETS > FS_VOLUMES)
#error "SOCKETS should not be bigger then VOLUMES"
#endif /* SOCKETS > VOLUMES */
#if !defined(FL_FIXED_MEDIA) && defined(FIXED_MEDIA)
#define FL_FIXED_MEDIA
#endif
/* The POLLING_INTERVAL definition is not really relevant to DiskOnChip
* Starting from TrueFFS 6.1 it was removed from flcustom.h, but TrueFFS
* still support this functionality.
*/
#ifndef POLLING_INTERVAL
#define POLLING_INTERVAL 0
#endif /* POLLING_INTERVAL */
/* TrueFFS 5.2 used the FL_QUICK_MOUNT_INFO_EXIST defintion. TrueFFS 6.1
* uses simple FL_ON and FL_OFF instead.
*/
#define FL_QUICK_MOUNT_INFO_EXIST FL_ON
/* Starting from TrueFFS 6.1 this flag does not reduce code and therfore was
* added as a default.
*
*/
#define FL_LOW_LEVEL
/* Some S/W modules like boot SDK do not need the read bad blocks tables routine.
* However for TrueFFS these defintion is vital
*/
/* 12-bit FAT support
*
* Comment the following line if you do not need support for DOS media with
* 12-bit FAT (typically media of 8 MBytes or less).
*/
#define FS_FAT_12BIT
#define MTD_READ_BBT /* Compile the read BBT routine code */
#else /* MTD_STANDALONE */
#ifndef FL_FIXED_MEDIA
#define FL_FIXED_MEDIA
#endif
#ifndef NO_READ_BBT_CODE
/* When compiled in the BDK mode, the read BBT code will be compiled unless
* NO_READ_BBT_CODE was defined.
*/
#define MTD_READ_BBT /* Compile the read BBT routine code */
#endif /* NO_READ_BBT_CODE */
#ifndef FL_SOCKETS
#define FL_SOCKETS 1 /* The only available number */
#endif
#define FIXED_MEDIA
#define DO_NOT_YIELD_CPU
#endif /* MTD_STANDALONE */
/* Number of translation layer partitions
*
* Defines Maximum Number of Translation layer partitions on a physical device
*
* The actual number of partitions depends on the format placed on each device.
*/
#ifndef FL_MAX_TL_PARTITIONS
#define FL_MAX_TL_PARTITIONS 14
#endif /* FL_MAX_TL_PARTITIONS */
/* The Maximum number of partitions is limited to 8 due to SAFTL buffers */
#if (FL_MAX_TL_PARTITIONS > 14)
#error "Can not define more then 14 partitions\r\n"
#endif /* (FL_MAX_TL_PARTITIONS > 8) */
/* Max Number of binary partitions */
#ifndef MAX_BINARY_PARTITIONS_PER_DRIVE
#define MAX_BINARY_PARTITIONS_PER_DRIVE 3
#endif /* MAX_BINARY_PARTITIONS_PER_DRIVE */
/* There can not be more binary partition, then total supported partitions */
#if (MAX_BINARY_PARTITIONS_PER_DRIVE >= FL_MAX_TL_PARTITIONS)
#error "MAX_BINARY_PARTITIONS_PER_DRIVE must be smaller then FL_MAX_TL_PARTITIONS\r\n"
#endif /* (MAX_BINARY_PARTITIONS_PER_DRIVE >= FL_MAX_TL_PARTITIONS) */
/* Default file system TL partitions */
#if !defined(FS_MAX_TL_PARTITIONS) && defined(FL_MAX_TL_PARTITIONS)
#define FS_MAX_TL_PARTITIONS FL_MAX_TL_PARTITIONS
#endif
/* The TLS and MTDS constants where changed in TrueFFS 6.2 to a
* more generic name : FL_TLS and FL_MTDS
*/
#ifndef FL_TLS
#define FL_TLS TLS
#endif /* FL_TLS */
#ifndef FL_MTDS
#define FL_MTDS MTDS
#endif /* FL_MTDS */
/* Make sure that the CHARSIZE is well defined */
#ifndef CHARSIZE
#define CHARSIZE 8 /*The default char size is 8*/
#endif
/* Make sure flPack and flspread are well defined */
#if (CHARSIZE == 8)
#ifndef flspread
#define flspread(source,length)
#endif /* flspread */
#ifndef flpack
#define flpack(source,length)
#endif /* flpack */
#endif /* (CHARSIZE == 8) */
/* Make sure FL2BYTE is well defined */
#ifndef FL2BYTE
#if (CHARSIZE == 8)
#define FL2BYTE(var) ((FLByte)(var))
#else
#define FL2BYTE(var) ((FLByte)((var) & 0x00FF))
#endif /* (CHARSIZE == 8) */
#endif /* FL2BYTE */
#ifndef FL_PACKED_STRUCTURES_BEFORE
#define FL_PACKED_STRUCTURES_BEFORE
#endif /* FL_PACKED_STRUCTURES_BEFORE */
#ifndef FL_PACKED_STRUCTURES_AFTER
#ifdef FL_PACKED_STRUCTURES
#define FL_PACKED_STRUCTURES_AFTER FL_PACKED_STRUCTURES
#else
#define FL_PACKED_STRUCTURES_AFTER
#endif /* FL_PACKED_STRUCTURES */
#endif /* FL_PACKED_STRUCTURES_AFTER */
/* Starting from TrueFFS version 6.x the ASSUMED_NFTL_UNIT_SIZE was changed to
* FL_ASSUMED_MIN_UNIT_SIZE.
*/
#ifndef FL_ASSUMED_MIN_UNIT_SIZE
#define FL_ASSUMED_MIN_UNIT_SIZE ASSUMED_NFTL_UNIT_SIZE
#endif /* FL_ASSUMED_MIN_UNIT_SIZE */
/* Starting from TrueFFS version 6.x the MAX_VOLUME_MBYTES was changed to
* FL_ASSUMED_MAX_VOLUME_MBYTES.
*/
#ifndef FL_ASSUMED_MAX_VOLUME_MBYTES
#ifdef MAX_VOLUME_MBYTES
#define FL_ASSUMED_MAX_VOLUME_MBYTES MAX_VOLUME_MBYTES
#else
/* TrueFFS sets the sector size according to this definitions. As a result customers
that do not customize this definition will be limited to a very small media (32MB)
without even knowing it.
*/
#define FL_ASSUMED_MAX_VOLUME_MBYTES 64
#endif /* MAX_VOLUME_MBYTES */
#endif /* FL_ASSUMED_MAX_VOLUME_MBYTES */
/* When using static allocation , SAFTL may requires the number of sectors
* in a logical unit. This value can normally be deduced from the unit size.
* However if you need to support several DiskOnChip devices with different
* unit sizes, you may need to define the smallest unit size, while defining
* the largest number of logical sectors in a logical unit
*/
#ifndef FL_ASSUMED_MAX_SECTORS_PER_UNIT
#define FL_ASSUMED_MAX_SECTORS_PER_UNIT (FL_ASSUMED_MIN_UNIT_SIZE>>FL_SECTOR_SIZE_BITS)
#endif /* FL_ASSUMED_MAX_SECTORS_PER_UNIT */
/* Validity check for FL_LOW_LEVEL compilation flag.
*
* Starting from TrueFFS 5.1 the LOW_LEVEL was changed to FL_LOW_LEVEL
* The reason was that it clashed with Windows NT LOW_LEVEL macro.
*/
#ifndef FL_LOW_LEVEL
#ifdef LOW_LEVEL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -