📄 datatype.h
字号:
typedef unsigned char BIT; /* 1 bit variable */
typedef char CHAR; /* native character */
typedef unsigned char BYTE; /* unsigned 1 byte variable */
typedef unsigned short WORD; /* unsigned 2 byte variable */
typedef unsigned long DWORD; /* unsigned 4 byte variable */
typedef long LONG; /* signed 4 byte variable */
typedef short SWORD; /* signed 2 byte variable */
typedef BYTE * BYTE_PTR; /* unsigned 1 byte pointer */
typedef WORD * WORD_PTR; /* unsigned 2 byte pointer */
typedef DWORD * DWORD_PTR; /* unsigned 4 byte pointer */
typedef void * VOID_PTR;
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#define SUCCESS 0
#define FAILED 1
/* If being used on a BIG ENDIAN system, this should be set to TRUE */
#define SWAP FALSE
/* If the machine is a segmented architecture machine, this should be TRUE.
* If not, it should be FALSE.*/
//#define SEGMENTED TRUE
#define SEGMENTED FALSE // modify by wangfei
/* Only used for PLR testing with RAM lowlvl */
#define PLR_TESTING FALSE
#define MLC_DEVICE TRUE
/* If it is a segmented machine, these then have to be far. */
#if SEGMENTED
typedef BYTE far * FULL_BYTE_PTR; /* unsigned 1 byte far pointer */
typedef WORD far * FULL_WORD_PTR; /* unsigned 2 byte far pointer */
typedef DWORD far * FULL_DWORD_PTR; /* unsigned 4 byte far pointer */
typedef void far * FULL_VOID_PTR;
#define SOCKET TRUE
#else
typedef BYTE_PTR FULL_BYTE_PTR; /* unsigned 1 byte far pointer */
typedef WORD_PTR FULL_WORD_PTR; /* unsigned 2 byte far pointer */
typedef DWORD_PTR FULL_DWORD_PTR; /* unsigned 4 byte far pointer */
typedef VOID_PTR FULL_VOID_PTR;
#define SOCKET FALSE
#endif
#if SEGMENTED
#define FAR_PTR far *
#else
#define FAR_PTR *
#endif
typedef struct
{
BYTE block;
WORD vsbIndex;
}LAST_VSB; /* Enabled for all the operations except for writes */
#if PLR_TESTING
typedef struct POWER_LOSS_FLAGS {
BYTE enable_flag;
BYTE breakpoint_number;
DWORD target_iteration;
DWORD current_iteration;
} POWER_LOSS_FLAGS;
extern POWER_LOSS_FLAGS PowerLossFlags;
extern BYTE MLCLevel2;
#endif
#define DEFAULT_BYTE 0xFF
#define DEFAULT_WORD 0xFFFF
#define DEFAULT_LONG 0xFFFFFFFFL
/* used to read directly from Flash during initialization */
#define MC_ADDR 0xD0000000L /* Window address */
#define MC_WIND_MSK 0x00000FFFL /* Window size of 4K mask*/
#define ERASE_TIME_LIMIT 0xc000000L /* Erase loop limit. Since the erase */
/* can occur in the background, we */
/* need to set a limit to error out.*/
/* AS Error code Percolation: All the error codes are sixteen bit error codes
and are percolated from LLVL to VFM */
#define ERR_NONE 0
#define ERR_READ 1
#define ERR_WRITE 2
#define ERR_PARAM 3
#define ERR_OPEN 5
#define ERR_EXISTS 6
#define ERR_NOTEXISTS 7
#define ERR_SPACE 9
#define ERR_NOTOPEN 11
#define ERR_ERASE 12
#define ERR_MAX_FILES 15
#define ERR_DETECT 17
#define ERR_CONNECT 18
#define ERR_JEDEC 19
#define ERR_NOT_EMPTY 20
#define ERR_DIRECTORY 21
#define ERR_FORMAT 22
#define ERR_MEDIA_TYPE 23
#define ERR_NOT_DONE 24
#define ERR_BUSY 25
#define ERR_BOUNDARY 26
#define ERR_EOF 27
#define ERR_NOT_VALID_STRUCTS 28
#define ERR_SUSPEND_UNSUPPORTED 29
#define ERR_WRITE_PROTECT 30
#define ERR_DRV_FULL 31
#define ERR_MAX_OPEN 32
#define ERR_WRITE_UNSUPPORTED 33
/* adapted from enum -cnc */
#define ERR_FLASH_INVALID ERR_JEDEC
#define ERR_FORMAT_INVALID ERR_FORMAT
#define ERR_NOT_FOUND ERR_NOTEXISTS
#define ERR_MEMORY_FULL ERR_DRV_FULL
#define ERR_WRITE_IN_PROGRESS 34
#define ERR_VSB_OVERFLOW 35
#define ERR_VSB_INVALID 36
#define ERR_PARTITION 37
#define ERR_CREATE 38
#define ERR_NOTCLOSED 39
#define ERR_FILEMODE 40
#define ERR_SETUP 41
#if PLR_TESTING
/* PLR Breakpoint definitions */
/* Breakpoint Number Location State Change */
#define PLR_BP1 1 /* fmatvsb.c:[164] DEFAULT_WORD => VSB_FB_PLR_WRITE */
#define PLR_BP2 2 /* fmatvsb.c:[171] VSB_FB_PLR_WRITE => VSB_FB_WRITE */
#define PLR_BP3 3 /* initvsb.c:[228] VSB_FB_PLR_ERASING => VSB_FB_ERASING*/
#define PLR_BP4 4 /* initvsb.c:[264] VSB_FB_ERASING => VSB_FB_WRITE */
#define PLR_BP5 5 /* initvsb.c:[341] => VSB_FB_WRITE */
#define PLR_BP6 6 /* movevsb.c:[162] Bulk Write */
#define PLR_BP7 7 /* movevsb.c:[186] Bulk Write */
#define PLR_BP8 8 /* reclaim.c:[224] DEFAULT_WORD => VSB_FB_RECOVER */
#define PLR_BP9 9 /* reclaim.c:[261] Bulk 2byte write */
#define PLR_BP10 10 /* reclaim.c:[298] Bulk Write */
#define PLR_BP11 11 /* reclaim.c:[309] VSB_FB_RECOVER => VSB_FB_ERASING */
#define PLR_BP12 12 /* reclaim.c:[341] VSB_FB_ERASING => VSB_FB_WRITE */
#define PLR_BP13 13 /* scanvat.c:[261] VSB_ALLOCATING => VSB_PLR_DISCARDED */
#define PLR_BP14 14 /* scanvat.c:[270] VSB_PLR_DISCARDED => VSB_DISCARDED */
#define PLR_BP15 15 /* scanvat.c:[291] VSB_VALID => VSB_DISCARDED */
#define PLR_BP16 16 /* scanvat.c:[299] VSB_(MLC_)ALLOCATED => VSB_VALID */
#define PLR_BP17 17 /* scanvat.c:[310] discarding => VSB_DISCARDED */
#define PLR_BP18 18 /* sysclnup.c[179] => VSB_DISCARDED */
#define PLR_BP19 19 /* writevat.c[192] data write */
#define PLR_BP20 20 /* discvsb.c:[154] ?? => VSB_PLR_DISCARDED */
#define PLR_BP21 21 /* discvsb.c:[158] VATWrite */
#define PLR_BP22 22 /* writesec.c[211] VSB_FB_WRITE => VSB_FB_FULL */
#define PLR_BP23 23 /* writesec.c[224] ?!? VSB_FB_WRITE => VSB_FB_WRITE */
#define PLR_BP24 24 /* writesec.c[234] VSB_FREE => VSB_ALLOCATING */
#define PLR_BP25 25 /* writesec.c[278] data write */
#define PLR_BP26 26 /* writesec.c[284] VSB_ALLOCATING => VSB_ALLOCATED */
#define PLR_BP27 27 /* writesec.c[316] VSB_ALLOCATED => VSB_VALID */
#define PLR_BP28 28 /* writesec.c[248] post WVE(VSB_ALLOCATING) */
#endif /* PLR_TESTING */
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -