📄 filesystem.h
字号:
/******************************************************************************
* Filename : FileSystem.h *
* Start date : 2005/01/13 *
* By : Lu Min *
* Contact : min.lu@samsung.com *
* Description : *
* *
******************************************************************************/
#ifndef _FILE_SYSTEM_
#define _FILE_SYSTEM_
#include "..\..\custom\include\fp_data.h"
#include "Basic_typedefs.h"
#include "s5h_types.h"
#include "Sys_call_abstract.h"
#include "All_Event.h"
#include "s5l_memmap.h"
#include "util.h"
//#include "psd_api.h"
#include "psd.h"
#include "iodma_api.h"
#include "avl_types.h"
#include "avloader_api.h"
#include "servo_ram_extern.h"
#include "string.h"
#include "be_api.h"
#define _FS_SUPPORT_PATH_TABLE_ 1
#define _FS_SUPPORT_L_PATH_ 0
#define _SUPPORT_ULONG_POINTER_COPY_ 1
#define _USE_MALLOC_ 1
#define ADDRESS_OFFSET 0 // ADDRESS_OFFSET = 0x8019000 - (new Audio_buffer address)
#define DUMP_SECTORS 50
#define FS_READ_FILE_NUMBER 7
#define FS_MAX_FILE_NAME_LENGTH 64
#define FS_MAX_DIR_NAME_LENGTH 8
#define FS_MAX_SESSION_SUPPORT 10
#define FS_SEPARATOR_1 0x2E
#define FS_SEPARATOR_2 0x3B
#define ISO_STANDARD_ID "CD001"
#define ISO_CD_UDF "UDFREADER"
#define ISO_VD_PRIMARY 1
#define ISO_MAX_RETRY_CNT 5
#if _FS_SUPPORT_PATH_TABLE_
#define FS_PATH_LEN 8
#endif
typedef enum{
FS_NO_ERROR = 0,
FS_READ_ERROR,
FS_INVALID_PATHNAME,
FS_FORMAT_UNDEFINED,
FS_NO_DEVICE_MOUNT,
FS_NO_PATH_TABLE,
FS_DIRECTORY_END
} FS_Error_t;
typedef enum{
FS_FILE =0,
FS_DIRECTORY
}FS_Flag;
#if 0
typedef enum{
FS_MODE1 = 1,
FS_MODE2
}FS_MODE;
#endif
typedef struct{
UCHAR LEN_DR;
UCHAR ExtAR_Length;
ULONG Location_Ext[2];
ULONG Data_Length[2];
UCHAR Date_Time[7];
UCHAR File_flag;
UCHAR File_unit_sz;
UCHAR Interleave_gap_sz;
ULONG Vol_seq_number;
}FS_DIRECTORY_RECORD;
typedef struct{
UCHAR session_no;
UCHAR path_no;
UCHAR item_counter;
ULONG Offset_LBA_in_session;
USHORT first_offset_byte_in_LBA;
USHORT last_offset_byte_in_LBA;
ULONG offset_in_cur_dir;
ULONG Cur_session_start_LBA;
ULONG parent_dir_LBA;
ULONG dir_length;
ULONG par_dir_length;
USHORT item_offset[64];
USHORT sector_file_no[100];
#if _FS_MP3_READ_ONE_TIME_
ULONG root_lba;
#endif
}FS_CURRENT_INFO;
#if _FS_SUPPORT_PATH_TABLE_
typedef struct{
UCHAR path_no;
UCHAR M_L_path;//0=M,1=L;
ULONG Offset_LBA_in_session;
USHORT first_offset_byte_in_LBA;
USHORT last_offset_byte_in_LBA;
ULONG offset_in_cur_dir;
ULONG parent_dir_no;
ULONG dir_length;
ULONG path_table_location;
USHORT item_offset[256];
USHORT sector_dir_no[25];
UCHAR split_offset[25];
}FS_CURRENT_PATH_INFO;
typedef struct{
UCHAR LEN_DI;
UCHAR ext_attr_rec_len;
ULONG location;
USHORT Parent_dir_no;
}FS_PATH_TABLE_RECORD;
#endif
#if 0
extern FS_MODE gModeFlag;
#endif
extern UCHAR S5H_Lba2Msf(ULONG Lba, S5H_MSF_t *new_msf);
extern S5H_ErrType_t S5H_DumpCd( S5H_MSF_t start,S5H_MSF_t end, void *buffer_1, BOOL edc_chk );
extern unsigned long VcdBcdToHex(UCHAR a);
#if 0
extern UCHAR* WordAlighMalloc(ULONG size);
#endif
//void S5H_Stop( void);
FS_Error_t FS_Dump(ULONG start,UCHAR * buffer);
SINT StrnCmp(CHAR *dst,CHAR *src,UINT length) ;
FS_Error_t FS_MountSession( UCHAR session_no) ;
void FS_init(void);
FS_Error_t FS_Mount(UCHAR session_no) ;
FS_Error_t FS_GetNextElement(UCHAR* name, FS_Flag *flag, ULONG* start, ULONG* length, USHORT *file_no);
FS_Error_t FS_GetPreviousElement(UCHAR* name, FS_Flag *flag, ULONG *start, ULONG *length , USHORT *file_no);
#if 0
FS_Error_t FS_EnterRootDir(void);
FS_Error_t FS_EnterChildDir(UCHAR no);
FS_Error_t FS_ReturnParentDir(void);
#endif
#if _FS_SUPPORT_PATH_TABLE_
FS_Error_t FS_ReadPathTable(void);
#if _FS_MP3_READ_ONE_TIME_
FS_Error_t FS_EnterDir(ULONG LBA);
FS_Error_t FS_GetNextDir(UCHAR* name,USHORT *dir_no, ULONG *LBA);
#else
FS_Error_t FS_EnterDir(USHORT *dir_no);
FS_Error_t FS_GetNextDir(UCHAR* name,USHORT *dir_no);
#endif
FS_Error_t FS_GetPreviousDir(UCHAR* name,USHORT *dir_no);
#endif
#if _FS_MP3_READ_ONE_TIME_
FS_Error_t FS_ReadFileTable(void);
#endif
#if 0
void FS_GotoNextPage(void);
void FS_GotoPreviousPage(void);
#endif
#if 0
BOOL FS_IsFormOne(void);
#endif
ULONG FS_7_3_1(ULONG t);
FS_Error_t FS_Unmount( void ) ;
void FS_SyncInfo(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -