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

📄 davrttbl.h

📁 FDI Intel开发的FLASH文件系统,功能很强大
💻 H
字号:
/* Copyright (c) 1995-2004 Intel Corporation */
/* Intel Confidential                        */

/* ###########################################################################
###  DAV - Direct Access Volume Enhancement to FDI
###
###  Module: DavRtTbl.h - Header Types & Macros Include File
###
###  $Workfile: DavRtTbl.h $
###  $Revision: 9 $
###  $NoKeywords: $
########################################################################### */

/*                                                               
 *****************************************************************
 * NOTICE OF LICENSE AGREEMENT                                    
 *                                                                
 * This code is provided by Intel Corp., and the use is governed  
 * under the terms of a license agreement. See license agreement  
 * for complete terms of license.                                 
 *                                                                
 * YOU MAY ONLY USE THE SOFTWARE WITH INTEL FLASH PRODUCTS.  YOUR 
 * USE OF THE SOFTWARE WITH ANY OTHER FLASH PRODUCTS IS EXPRESSLY 
 * PROHIBITED UNLESS AND UNTIL YOU APPLY FOR, AND ARE GRANTED IN  
 * INTEL'S SOLE DISCRETION, A SEPARATE WRITTEN SOFTWARE LICENSE   
 * FROM INTEL LICENSING ANY SUCH USE.                             
 *****************************************************************
 */

#ifndef __DAV_RT_TABLE_H__  /* sentry header */
#define __DAV_RT_TABLE_H__

#if (DIRECT_ACCESS_VOLUME == TRUE)

/*### Global Declarations
#########################*/
/*Fix Start:SCR964 */
#define RTTBL_MaxEntries DAV_BLOCKCOUNT /* Max of 1 Word */
/*Fix End:SCR964 */
#define RTTBL_MinEntries 1

/*Fix Start:SCR964 */
/*########################################################################*/
/*### Reclaim Table (RT)                                                  */

/*
// RTTBL_Leader (16 bytes)
//
//     3                     2                   1
//     1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0  <- Bits ( 4 Bytes)
//    +-------------------------------+---------------+---------------+
//  0 |            UniqueId 1         |      RFU      |    NumRows    |
//    +-------------------------------+---------------+---------------+
//  1 |                             RFU                               |
//    +---------------+---------------+-------------------------------+
//  2 |           Last Block          |        NumberBlocks           |                           
//    +---------------+---------------+-------------------------------+
//  3 |            RFU                |          UniqueId 2           |
//    +---------------+---------------+---------------+---------------+
//    |       0       |      1        |       2       |       3       | <- Byte
//
*/
typedef struct
{
   UINT16 UniqueId1;
   UINT16  NumRows;
   UINT32 RFU_2;
   UINT16  LastBlock;
   UINT16  NumberBlocks;
   UINT16 RFU_4;
   UINT16 UniqueId2;
} RTTBL_Leader, __FAR_ * RTTBL_LeaderPtr;
/*Fix End:SCR964 */

/*Fix Start:SCR964 */
ERR_CODE  RTTBL_AllocateFlash(FDI_Handle aObjHandle, UINT16 aFirstBlock, UINT16 aBlockNumber, EnBlockOperation* aStatePtr);
/*Fix End:SCR964 */

/* UniqueId1 */
#define RTTBL_UniqueId1                       0xF0F0
void    RTTBL_SetUniqueId1(RTTBL_LeaderPtr aPtr, UINT16 aDWord);
UINT16  RTTBL_GetUniqueId1(RTTBL_LeaderPtr aPtr);

/* UniqueId2 */
#define RTTBL_UniqueId2                       0xF0F0
void    RTTBL_SetUniqueId2(RTTBL_LeaderPtr aPtr, UINT16 aDWord);
UINT16  RTTBL_GetUniqueId2(RTTBL_LeaderPtr aPtr);

/* Entry Number */
/*Fix Start:SCR964 */
void    RTTBL_SetNumRows(RTTBL_LeaderPtr aPtr, UINT16 aWord);
UINT16   RTTBL_GetNumRows(RTTBL_LeaderPtr aPtr);
/*Fix End:SCR964 */

/* Last Block */
/*Fix Start:SCR964 */
void    RTTBL_SetLastBlock(RTTBL_LeaderPtr aPtr, UINT16 aWord);
UINT16   RTTBL_GetLastBlock(RTTBL_LeaderPtr aPtr);
/*Fix End:SCR964 */

/* Block Number */
/*Fix Start:SCR964 */
void    RTTBL_SetBlockNumber(RTTBL_LeaderPtr aPtr, UINT16 aWord);
UINT16   RTTBL_GetBlockNumber(RTTBL_LeaderPtr aPtr);
/*Fix End:SCR964 */

/*
// RTTBL_Entry (8 bytes)
//     3                     2                   1
//     1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0  <- Bits ( 4 Bytes)
//    +-------------------------------+---------------+---------------+
//  0 |        Progress State         |      RFU      |    OprType    |
//    +-------------------------------+---------------+---------------+
//    |       0       |      1        |       2       |       3       | <- Byte
*/
typedef struct
{
   UINT16 ProgressState;
   UINT8  RFU;
   UINT8  Operation;
} RTTBL_Entry, __FAR_ * RTTBL_EntryPtr;

/* Entry Status Field */
#define RTTBL_MASK_RtEntryProgressState                        0xFFFF
#define RTTBL_RtEntryProgressState_NoOperationInProgress       0xFFFF /* 1111 1111 1111 1111 */
#define RTTBL_RtEntryProgressState_CopyOutInProgress           0xFFFC /* 1111 1111 1111 1100 */
#define RTTBL_RtEntryProgressState_ErasePageBlockInProgress    0xFFC0 /* 1111 1111 1100 0000 */
#define RTTBL_RtEntryProgressState_CopyBackInProgress          0xFC00 /* 1111 1100 0000 0000 */
#define RTTBL_RtEntryProgressState_EraseReclaimBlockInProgress 0xF000 /* 1111 0000 0000 0000 */
#define RTTBL_RtEntryProgressState_OperationComplete           0xC000 /* 1100 0000 0000 0000 */
#define RTTBL_RtEntryProgressState_NoOperationRequired         0x0000 /* 0000 0000 0000 0000 */
void    RTTBL_SetRtEntryProgressState(RTTBL_EntryPtr aPtr, UINT16 aWord);
UINT16  RTTBL_GetRtEntryProgressState(RTTBL_EntryPtr aPtr);
/* E5.5.970 Start */ 
UINT16  RTTBL_GetRecoveredRtEntryProgressState( RTTBL_EntryPtr aPtr,
                                                FDI_Handle     aHandle,
                                                ERR_CODE *     statusPtr );
/* E5.5.970 End */ 

/* Entry Operation */
#define RTTBL_RtEntryOpr_NotUsed                             0xFF
#define RTTBL_RtEntryOpr_BlockCopy                           0x01 /* 0000 0001 */
#define RTTBL_RtEntryOpr_BlockErase                          0x02 /* 0000 0010 */
void    RTTBL_SetRtEntryOpr(RTTBL_EntryPtr aPtr, UINT8 aByte);
UINT8   RTTBL_GetRtEntryOpr(RTTBL_EntryPtr aPtr);

/*
// RTTBL_ObjectTable (28 bytes)
//
//     3                     2                   1
//     1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0  <- Bits ( 4 Bytes)
//    +---------------------------------------------------------------+
//  0 |                                                               |
//    +                                                               +
//  1 |                                                               |
//    +                           RtHeader                            +
//  2 |                                                               |
//    +                                                               +
//  3 |                                                               |
//    +---------------------------------------------------------------+
//  4 |                 RtEntry[RTTBL_MinEntries]                     |
//    +                                                               +
// .. |   NOTE: The design does NOT read the entire table into SRAM   |
//    +---------------+---------------+---------------+---------------+
//    |       0       |      1        |       2       |       3       | <- Byte
//
*/
typedef struct
{
   RTTBL_Leader RtHeader;
   RTTBL_Entry  RtEntry[RTTBL_MinEntries];

} RTTBL_ObjectTable, __FAR_ * RTTBL_ObjectTablePtr;

/*########################################################################*/
/*### Public Functions                                                    */

#define RTTBL_CalcTableSize(aNumRows) \
   (sizeof(RTTBL_Leader)+(sizeof(RTTBL_Entry)*aNumRows))      

/* Table functions */
ERR_CODE RTTBL_WriteRtEntryProgressState(FDI_HandlePtr aHandle, RTTBL_EntryPtr aPtr);

/* Search functions */
ERR_CODE RTTBL_GetFirstRtEntry(FDI_Handle* aHandlePtr, RTTBL_EntryPtr aEntryPtr, RTTBL_LeaderPtr aLeaderPtr);
ERR_CODE RTTBL_GetNextRtEntry (FDI_Handle* aFlashNextPtr, RTTBL_EntryPtr aEntryPtr, FDI_Handle* aFlashCurrentPtr);

#endif /* DIRECT_ACCESS_VOLUME */

#endif /* sentrydif */

⌨️ 快捷键说明

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