📄 flformat.h
字号:
FLDword exbBufferLen; /* Size of the given EXB buffer */
FLDword exbLen; /* The specific size to leave for the EXB */
FLWord exbWindow; /* Set explicit DiskOnChip window base */
FLWord exbFlags; /* For the flags list see doc2exb.h */
#endif /* WRITE_EXB_IMAGE */
FLByte cascadedDeviceNo; /* Not used */
FLByte noOfCascadedDevices; /* Not used */
FLProgressCallback progressCallback;
/* Progress callback routine, will be called if not NULL.
The callback routine is called after erasing each unit,
and its parameters are the total number of erase units
to format and the number erased so far.
The callback routine returns a Status value. A value of
OK (0) allows formatting to continue. Any other value
will abort the formatting with the returned status code. */
/* In case the FL_REPORT_MOUNT_PROGRESS compilation flag is set the
routine will also report the mount progress of the mount routine
for each of the Disk partitions. A 0,0 return values will report
the end of a format status and of a mount operation */
/* Note the following section is not used by for DiskOnChips */
/*************************************************************/
FLDword vmAddressingLimit;
/* A part of the FTL Virtual Map always resides in RAM. The
RAM part is the one that is used to address the part of
the media below the VM addressing limit. Reading and
writing to this part is usually faster to some degree.
The downside is that the bigger the limit, the more RAM
size is required.
To get the extra RAM requirement in bytes, divide the
limit by 128 or by 256, depending on whether you
specified in #2.9 more than 32 or not, respectively.
The minimum VM limit is 0.
The standard value to use is 0x10000 (first 64 KBytes) */
FLWord embeddedCISlength;
/* Length in bytes of CIS to embed after the unit header */
FLByte FAR1 * embeddedCIS;
/* The unit header is structured as a beginning of a PCMCIA
'tuple' chain (a CIS). The unit header contains a
data-organization tuple, which points past the end of the
unit header to a location which usually just contains
hex FF's which mark an 'end-of-tuple-chain'. Optionally,
it is possible to embed an entire CIS chain at this
location. If so, 'embeddedCISlength' marks the length in
bytes */
} FormatParams2;
/*----------------------------------------------------------*/
/* User Format Parameters record for flFormatVolume routine */
/*----------------------------------------------------------*/
typedef struct {
FLSDword bootImageLen;
/* Space to reserve for a boot-image at the start of the
medium. The FLite volume will begin at the next higher
erase unit boundary */
unsigned percentUse;
/* NAND flash inherently contains some bad blocks. TrueFFS handles
* those blocks by managing a pool of spare blocks also called transfer
* units. This format parameter specifies the percentage of the media
* to use. According to the flash specifications, SLC flashes should use
* 98% while MLC flashes should use 95%. You can let TrueFFS
* automatically choose the percentage according to the flash spec by
* using the TL_DEFAULT_PERCENTAGE definition.
*/
unsigned noOfSpareUnits;
/* Disk partitions needs at least one spare erase unit to function as
a read/write media. That unit is normally taken from the transfer
units specified by the percentUsed field, but it is possible to
specify additional units (which takes more media space). This
ensures that if all the transfer units become bad and inerasable,
the spare unit enables TrueFFS to continue its read/write
functionality. Conversely, if no spare units are available the
media may switch into read-only mode. The standard value used is 3 */
FLDword vmAddressingLimit;
/* A part of the FTL Virtual Map always resides in RAM. The
RAM part is the one that is used to address the part of
the media below the VM addressing limit. Reading and
writing to this part is usually faster to some degree.
The downside is that the bigger the limit, the more RAM
size is required.
To get the extra RAM requirement in bytes, divide the
limit by 128 or by 256, depending on whether you
specified in #2.9 more than 32 or not, respectively.
The minimum VM limit is 0.
The standard value to use is 0x10000 (first 64 KBytes) */
FLProgressCallback progressCallback;
/* Progress callback routine, will be called if not NULL.
The callback routine is called after erasing each unit,
and its parameters are the total number of erase units
to format and the number erased so far.
The callback routine returns a Status value. A value of
OK (0) allows formatting to continue. Any other value
will abort the formatting with the returned status code. */
/* DOS formatting section */
FLSByte volumeId[4];
/* Volume identification number */
FLSByte FAR1 * volumeLabel;
/* Volume label string. If NULL, no label */
unsigned noOfFATcopies;
/* It is customary to format DOS media with 2 FAT copies.
The first copy is always used, but more copies make it
possible to recover if the FAT becomes corrupted (a
rare occurrence). On the other hand, this slows down
performance and uses media space.
The standard value to use is 2 */
unsigned embeddedCISlength;
/* Length in bytes of CIS to embed after the unit header */
FLSByte FAR1 * embeddedCIS;
/* The unit header is structured as a beginning of a PCMCIA
'tuple' chain (a CIS). The unit header contains a
data-organization tuple, which points past the end of the
unit header to a location which usually just contains
hex FF's which mark an 'end-of-tuple-chain'. Optionally,
it is possible to embed an entire CIS chain at this
location. If so, 'embeddedCISlength' marks the length in
bytes */
} FormatParams;
/*----------------------------------------------------------*/
/* Format Parameters record passed to the translation layer */
/*----------------------------------------------------------*/
typedef struct {
/* Global device info */
FLSDword bootImageLen;
FLByte percentUse;
FLByte noOfBDTLPartitions;
FLByte noOfBinaryPartitions;
BDTLPartitionFormatParams FAR2* BDTLPartitionInfo;
BinaryPartitionFormatParams FAR2* binaryPartitionInfo;
FLByte flags;
/* First volume info */
#ifdef HW_PROTECTION
FLByte protectionKey[8];
FLByte protectionType;
#endif /* HW_PROTECTION */
#ifdef COMPRESSION
FLWord ratioDenominator;
FLWord ratioNominator;
#endif /* COMPRESSION */
FLByte noOfSpareUnits;
FLByte volumeId[4];
FLByte FAR1 * volumeLabel;
FLByte noOfFATcopies;
/* Special features */
#ifdef WRITE_EXB_IMAGE
FLSDword exbLen;
#endif /* WRITE_EXB_IMAGE */
FLByte cascadedDeviceNo;
FLByte noOfCascadedDevices;
FLProgressCallback progressCallback;
FLDword osakVersion;
/* None DiskOnChip parameters */
FLDword vmAddressingLimit;
FLWord embeddedCISlength;
FLByte FAR1 * embeddedCIS;
} TLFormatParams;
#define BINARY_SIGNATURE_NAME 4
#define BINARY_SIGNATURE_LEN 8
#define SIGN_SPL "劏瑺"
/* Standard initializer for BDTLPartitionFormatParams structure */
#define TL_DEFAULT_PERCENTAGE 0 /* Use default percentage of the media */
#ifdef HW_PROTECTION
#ifdef COMPRESSION
#define STD_BDTL_PARAMS {0,3,TL_FORMAT_FAT,{0,0,0,0},NULL,2,{0,0,0,0,0,0,0,0},0,0,2}
#else
#define STD_BDTL_PARAMS {0,3,TL_FORMAT_FAT,{0,0,0,0},NULL,2,{0,0,0,0,0,0,0,0},0}
#endif /* COMPRESSION */
#else
#ifdef COMPRESSION
#define STD_BDTL_PARAMS {0,3,TL_FORMAT_FAT,{0,0,0,0},NULL,2,0,2}
#else
#define STD_BDTL_PARAMS {0,3,TL_FORMAT_FAT,{0,0,0,0},NULL,2}
#endif /* COMPRESSION */
#endif /* HW_PROTECTION */
/* Standard initializer for BinaryPartitionFormatParams structure */
#ifdef HW_PROTECTION
#define STD_BINARY_PARAMS {0,{'B','I','P','O'},8,{0,0,0,0,0,0,0,0},0}
#else
#define STD_BINARY_PARAMS {0,{'B','I','P','O'},8}
#endif /* HW_PROTECTION */
/* Standard initializer for FormatParams2 structure */
#ifdef WRITE_EXB_IMAGE
#define STD_FORMAT_PARAMS2 {TL_DEFAULT_PERCENTAGE,1,0,NULL,NULL,NULL,0,0,0,0,0,0,NULL,0x10000l,0,NULL}
#else
#define STD_FORMAT_PARAMS2 {TL_DEFAULT_PERCENTAGE,1,0,NULL,NULL,0,0,NULL,0x10000l,0,NULL}
#endif /* WRITE_EXB_IMAGE */
/* Standard initializer for FormatParams structure */
#ifdef RUGGEDIZED
#define STD_RUGGEDIZE_FORMAT_PARAMS {-1, TL_DEFAULT_PERCENTAGE, 2, 0x10000l, NULL, {0,0,0,0}, NULL, 2, 0, NULL}
#endif
#define STD_FORMAT_PARAMS {-1, TL_DEFAULT_PERCENTAGE, 3, 0x10000l, NULL, {0,0,0,0}, NULL, 2, 0, NULL}
#endif /* FORMAT_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -