⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vsbext1.h

📁 intel的一个高效率FLASH文件系统。思路很好
💻 H
📖 第 1 页 / 共 2 页
字号:
#define     VSBEXT_H


/*============================================================================*/
/*   SELECT OPTIONS -- SELECT  OPTIONS -- SELECT OPTIONS -- SELECT OPTIONS    */
/*============================================================================*/

/*********************  EXTENDED HEADER OPTIONS  ******************************/
#define     EXTENDED_HEADER      FALSE /* Select True for an extended
                                                   header; False removes
                                                   extended headers usage */
#define     EXT_1               FALSE  /* Select True for DOS-like file
                                                   name. Note: both must be True
                                                   for DOS-like*/

/*******************  PARTITION OPTIONS ***************************************/
/* The partition options in this section need to correlate to the */
/* initialization of the static partition_array variable in the   */
/* vfm_sup.c file. Please ensure that any partition changes also get */
/* statically initialized correctly in vfm_sup.c                  */
#define     MAX_PARTITIONS       1     /* max partitions in system
                                                   user defined */
#define     MAX_FILES_OPEN       5     /* max files open concurrently
                                                   user defined */

#define     PARTITION_BEGIN_1    0     /* partition 0  user defined */
#define     PARTITION_END_1      0     

/*#define     PARTITION_BEGIN_2    */   /* partition 1  user defined */
/*#define     PARTITION_END_2      */   /* Change VFM-SUP.C too*/

/*#define     PARTITION_BEGIN_3  2 */  /* partition 2  user defined */
/*#define     PARTITION_END_3    3 */  /* Change VFM-SUP.C too*/

/*#define     PARTITION_BEGIN_4  3 */   /* partition 3  user defined */
/*#define     PARTITION_END_4    3 */   /* Change VFM-SUP.C too*/
/********************** VFM FEATURES-OPTIONS ********************************/
/**     Modify your setup to optimize for ROM (code) or RAM (data)         **/

#define     DO_EDIT              TRUE   /* all edit operations */
#define     DO_APPEND            FALSE  /* append bytes option */
#define     DO_INSERT            FALSE /* insert bytes option */
#define     DO_REPLACE           TRUE   /* replace bytes option   */
#define     DO_DELETE            TRUE   /* delete bytes option */
#define     DO_SPACE             TRUE   /* space reporting */
#define     DO_MAN_RECLAIM       FALSE  /* manual reclaim */
#define     DO_FETCLEANUP        TRUE   /* File Entry Table cleanup */
/* E2.3.30 */
#define     DO_FITCLEANUP        TRUE   /* File Information Table cleanup */
/* E2.3.30 */
#define     AUTO_FETCLEANUP      TRUE   /* FET cleanup upon file deletion */
#define	  SUP_READBYTES	      FALSE  /* ReadBytes function being used */

/*============================================================================*/
/*       DO NOT MODIFY BEYOND THIS POINT -- DO NOT MODIFY BEYOND THIS POINT   */
/*============================================================================*/


/*********************  SUBCOMMAND DEFINITIONS  *******************************/
/* for Open command */
#define     OPEN_OPEN            0     /* open read only mode */
#define     OPEN_EDIT            1     /* open edit mode */
#define     OPEN_CREATE          2     /* open for write-create only */

/* for Find command */
#define     FIND_FIRST           0     /* first file in FET chain */
#define     FIND_NEXT            1     /* next file from current file */
#define     FIND_MATCHED         2     /* file matches type and id */

/* for Edit command */
#define     FILE_INSERT          0     /* insert data into existing file*/
#define     FILE_REPLACE         1     /* replace existing data with new*/
#define     FILE_DELETE          2     /* delete existing data in file */
#define     FILE_APPEND          3     /* append new data to end of file*/

/* for Special command */
#define     SP_INIT              0     /* initialize for VFM */
#define     SP_FORMAT            1     /* erase and initialize for VFM */
#define     SP_RECLAIM           2     /* reclaim dirty sectors */
#define     SP_SEEK              3     /* seek to a file offset */
#define     SP_TELL              4     /* report the current file offset */
#define     SP_SPACE             5     /* report free, dirty and valid sectors */
#define     SP_FETCleanup        6     /* cleanup -collapse the FET chain */
/* E2.3.30 */
#define     SP_FITCleanup        7     /* cleanup -collapse the FIT chain */
/* E2.3.30 */


/*********************  FLASH MEDIA PARTITION STRUCTURE ***********************/
typedef struct partition_info
{
   DWORD    block_size;                /* Component block size */
   BYTE     partition_offset;          /* Partition start component (0 based)*/
   BYTE     partition_end;             /* Partition end component (0 based) */
}PARTITION_INFO;

/***********************  FILE SYSTEM CONTROL STRUCTURES *********************/
typedef struct cmd_ctrl
{
#if SWAP                              /* For BIG Endian systems */
   WORD    partition;                 /* Logical Partition - All */
   WORD    reserved;
#else                                 /* For LITTLE Endian systems */
   WORD    reserved;
   WORD    partition;                 /* Logical Partition - All */
#endif
   DWORD    buffer;                    /* Caller's location to receive
                                          Full Header     - Open read & edit
                                          or Caller's location to submit
                                          Extended Header - Open create
                                          or Transfer Buffer - Read,Write */
                                       /* Offset value - Special seek & tell */
   DWORD    count;                     /* VSB Threshhold count - InitPartition
                                          or Transfer Count - Read,Write,Special */
   DWORD    actual;                    /* Transfer Actual -Read,Write */
   DWORD    scmd;                      /* Sub-command - Special */
   DWORD    type;                      /* PCMCIA EntryType - Open */
   DWORD    id;                        /* PCMCIA UniqueID - Open */
   DWORD    aux;                       /* caller's location to receive
                                          MEMORY_STATUS -  Special space
                                          or FMM control -  Special default */
}CMD_CTRL;

typedef struct file_entry
{
   DWORD    type;                      /* Header type = ZERO(0) */
   DWORD    id;                        /* File identifier */
   WORD     attributes;                /* identifies deleted files */
   DWORD    extended_header_size;      /* Used to store additional file info */
   BYTE     FIT_component;             /* Component location */
   WORD     FIT_VSB;                   /* VSB location within the component */
}FILE_ENTRY;

/* NOTE: The FSD supports a maximum extended header size of one full FIT
       of entries; (max_FIT_entries multiplied by VSB_SIZE).
       The examples support either 11 bytes or a sector. */
#if EXTENDED_HEADER
typedef struct ext_header
{
#if EXT_1                              /* use when DOS-like name */
   BYTE     file_name[8];              /* file name */
   BYTE     file_ext[3];               /* file extension */

#else                                  /* a full sector size */
   BYTE     ext_buffer[VSB_SIZE];
#endif

}EXT_HEADER;
#endif

typedef struct full_header
{
   FILE_ENTRY entry_table;
#if EXTENDED_HEADER
   EXT_HEADER extender;
#endif
}FULL_HEADER;


/* VSB status information for a component */
typedef struct memory_status
{
   WORD     clean_sectors;             /* total available VSBs in comp */
   WORD     dirty_sectors;             /* total discarded VSBs in comp */
   WORD     valid_sectors;             /* total allocated VSBs in comp */
}MEMORY_STATUS;

#endif /*VSB_EXT_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -