📄 davcfgtbl.h
字号:
void CFGTBL_SetPgUniqueId2(CFGTBL_PgReclaimEntryPtr aPtr, UINT16 aWord);
UINT16 CFGTBL_GetPgUniqueId2(CFGTBL_PgReclaimEntryPtr aPtr);
/*
// CFGTBL_PaReclaimEntry (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 | ProgressState |
// +-------------------------------+-------------------------------+
// 1 | RFU |
// +---------------------------------------------------------------+
// 2 | RFU |
// +-------------------------------+-------------------------------+
// 3 | RFU | UniqueId 2 |
// +-------------------------------+-------------------------------+
// | 0 | 1 | 2 | 3 | <- Byte
//
*/
typedef struct
{
UINT16 UniqueId1; /* Write Once */
UINT16 ProgressState; /* Write Once */
UINT32 RFU_1;
UINT32 RFU_2;
UINT16 RFU_3;
UINT16 UniqueId2; /* Write Once */
} CFGTBL_PaReclaimEntry, __FAR_ * CFGTBL_PaReclaimEntryPtr;
/* ReclaimStatus Field */
#define CFGTBL_MASK_PaProgressState 0xFFFF /* 10 bit Mask */
/* Original (Pa Block) */
#define CFGTBL_PaProgressState_PreliminaryCopy 0xFFFC /* 1111 1111 1111 1100 */
#define CFGTBL_PaProgressState_EraseRBInProgress 0xFFF0 /* 1111 1111 1111 0000 */
#define CFGTBL_PaProgressState_ReclaimComplete 0xFF00 /* 1111 1111 0000 0000 */
#define CFGTBL_PaProgressState_Normal 0xFC00 /* 1111 1100 0000 0000 */
#define CFGTBL_PaProgressState_ReclaimInProgress 0xF000 /* 1111 0000 0000 0000 */
#define CFGTBL_PaProgressState_RelocateInProgress 0xC000 /* 1100 0000 0000 0000 */
#define CFGTBL_PaProgressState_CopyOutComplete 0x0000 /* 0000 0000 0000 0000 */
/* Target (Reclaim Block */
#define CFGTBL_PaProgressState_ErasePSInProgress 0xFFFF /* 1111 1111 1111 1111 */
#define CFGTBL_PaProgressState_CopyBackInProgress 0xFFFC /* 1111 1111 1111 1100 */
void CFGTBL_SetPaProgressState(CFGTBL_PaReclaimEntryPtr aPtr, UINT16 aWord);
UINT16 CFGTBL_GetPaProgressState(CFGTBL_PaReclaimEntryPtr aPtr);
/* E5.5.970 Start */
UINT16 CFGTBL_GetRecoveredPaProgressState( CFGTBL_PaReclaimEntryPtr aPtr,
FDI_Handle aHandle,
ERR_CODE * statusPtr );
/* E5.5.970 End */
/* UniqueId1 */
void CFGTBL_SetPaUniqueId1(CFGTBL_PaReclaimEntryPtr aPtr, UINT16 aWord);
UINT16 CFGTBL_GetPaUniqueId1(CFGTBL_PaReclaimEntryPtr aPtr);
/* UniqueId2 */
void CFGTBL_SetPaUniqueId2(CFGTBL_PaReclaimEntryPtr aPtr, UINT16 aWord);
UINT16 CFGTBL_GetPaUniqueId2(CFGTBL_PaReclaimEntryPtr aPtr);
/*
// CFGTBL_ObjectTable (16 bytes + 64 bytes = 80 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 | |
// + PaReclaimStatus +
// 2 | |
// + +
// 3 | |
// +---------------------------------------------------------------+
// 4 | |
// + +
// .. | PgReclaimStatus |
// + +
// 8 | |
// +---------------+---------------+---------------+---------------+
// | 0 | 1 | 2 | 3 | <- Byte
//
*/
typedef struct
{
CFGTBL_PaReclaimEntry PaReclaimStatus;
CFGTBL_PgReclaimEntry PgReclaimStatus;
} CFGTBL_ObjectTable, __FAR_ * CFGTBL_ObjectTablePtr;
typedef enum
{
enCompletedDefragCleanupState,
enAbortedDefragCleanupState
} EnCleanupState;
typedef enum
{
enBlockOperationNone,
enBlockOperationCopy,
enBlockOperationErase
} EnBlockOperation;
/*########################################################################*/
/*### Public Functions */
/* CT Table Functions */
ERR_CODE CFGTBL_ReadTable(FDI_Handle aHandle, CFGTBL_ObjectTablePtr aPtr);
BOOLEAN CFGTBL_IsValidTable (CFGTBL_ObjectTablePtr aPtr);
ERR_CODE CFGTBL_WriteTableEntryPage(FDI_Handle aHandle);
ERR_CODE CFGTBL_WriteTableEntryPara(FDI_Handle aHandle, BOOLEAN aTableCopy);
FDI_Handle CFGTBL_CalcEntryHandle(FDI_Handle* aTableHandlePtr, UINT8 aEntryIndex);
/* Page Reclaim Functions */
ERR_CODE CFGTBL_GetFirstCtEntry (FDI_Handle* aFlashHandlePtr, CFGTBL_EntryPtr aEntry, UINT8* aNumEntryPtr);
ERR_CODE CFGTBL_GetNextCtEntry (FDI_Handle* aFlashNextPtr, CFGTBL_EntryPtr aEntry, FDI_Handle* aPtr);
ERR_CODE CFGTBL_GetUnusedCtEntry (UINT8* aIndex, CFGTBL_EntryPtr aEntry);
ERR_CODE CFGTBL_CreateCtEntryInFlash (UINT8 aIndex, CFGTBL_EntryPtr aEntry);
ERR_CODE CFGTBL_InvalidateCtEntryByStatus(UINT8 aEntryType, UINT8 aEntryStatus, BOOLEAN aPlrRestart);
ERR_CODE CFGTBL_ValidateCtEntryInFlash (UINT8 aIndex);
BOOLEAN CFGTBL_GetCtEntryByStatus(FDI_Handle aTableHandle, UINT8 aEntryType, UINT8 aEntryStatus, CFGTBL_PgReclaimEntryPtr aCfgPageEntryPtr,FDI_Handle* aEntryHandlePtr, UINT8* aCtIndexPtr, FDI_Handle* aCtEntryHandlePtr);
/* Page reclaim functions */
ERR_CODE CFGTBL_WritePageProgressState(UINT16 aNewState);
FDI_Handle CFGTBL_CalcPageReclaimHandle(FDI_Handle* aTableHandlePtr);
/* User Interface */
ERR_CODE CFGTBL_AllocateFlash();
ERR_CODE CFGTBL_Allocate_PAGE_RECLAIM();
/*Fix Start:SCR964 */
ERR_CODE CFGTBL_Allocate_OTTTBL(OTTTBL_EntryPtr aSramListPtr, UINT16 aArraySize, UINT8 aReclaimType, UINT16 aFirstRowBlkNum, UINT16 aLastRowBlkNum);
ERR_CODE CFGTBL_Allocate_RTTBL (UINT16 aLastBlock, UINT16 aNumBlocks, EnBlockOperation* aBlockInfoPtr);
/*Fix End:SCR964 */
ERR_CODE CFGTBL_Allocate_RATTBL(UINT16 aNumRows, UINT32 aBackupOffset, UINT32 aBackupSize, BOOLEAN aValidateFlag);
ERR_CODE CFGTBL_DeAllocatePageTables(EnCleanupState aState, ERR_CODE aStatus, BOOLEAN aPlrRecovery);
ERR_CODE CFGTBL_CorruptFixedHeader();
ERR_CODE CFGTBL_CtEntry_FixISF_PLR(UINT16* uint16_ptr, UINT32 flash_address, BOOLEAN restart);
/* Paragraph reclaim functions */
ERR_CODE CFGTBL_CopyTableToReclaim (FDI_Handle aSrc, FDI_Handle aDest);
ERR_CODE CFGTBL_CopyTableToParagraphSpace(FDI_Handle aSrc, FDI_Handle aDest, BOOLEAN aPerformCfgTblReclaim);
ERR_CODE CFGTBL_ModifyPaProgressState(UINT16 aState);
FDI_Handle CFGTBL_CalcPaReclaimHandle(FDI_Handle* aTableHandlePtr);
#endif /* DIRECT_ACCESS_VOLUME */
#endif /* sentrydif */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -