fx_api.h

来自「Zoran V966 DVD 解码 Soc芯片的源程序」· C头文件 代码 · 共 963 行 · 第 1/3 页

H
963
字号
#define FX_FS_INFO_SECTOR      0x030
#endif

#ifdef FILEX_ENABLE_WRITE
/* Define values for 32-bit FAT additional information update.  */

#define FX_DONT_UPDATE              0
#define FX_POSSIBLE_UPDATE          1
#define FX_UPDATE_NOW               2
#endif 

typedef struct FX_GEOMETRY_STRUCT {

    // Available CHS. 
    USHORT uwCylinders;
    USHORT uwHeads;
    USHORT uwSectorsPerTrack;

    // Partition Start.
    USHORT uwStartHead;
    USHORT uwStartSector;
    USHORT uwStartCylinder;
    USHORT uwEndHead;
    USHORT uwEndSector;
    USHORT uwEndCylinder;
    ULONG  ulPartitionStartSector;


    // Number of sectors that make up one FAT.
    ULONG ulSectorsPerFAT;

	
    // Number of sectors in a cluster.
    BYTE   bySectorsPerCluster;

    // Number of 32-byte entries in the root directory.
    USHORT uwRootEntries;

    // Total number of sectors in the media.
    ULONG  ulSizeInSectors;

    // Number of sectors that make up one FAT.
    USHORT uwSectorsPerFAT;

    // Number of sectors from beginning of media to boot sector.
    ULONG  ulHiddenSectors;

    // Type of FAT.
    // NOTE: This does not include FAT32, but rather FAT12, FAT16, and
    // a newer version of FAT16 when the number of clusters exceeds 16
    // bits (that is called here BIGDOS).
    BYTE   byFatType;

    // Type of File System (written in PBR as part of SystemID).
    // Can differ from the type of FAT.
    BYTE   byFsType;	

    #define FX_FAT12                    0x01
    #define FX_FAT16                    0x04
    #define FX_BIGDOS                   0x06
    #define FX_FAT32                    0x0B
    #define FX_NO_FAT                   0xFF

    // Alignment for a first sector of a partition.
    ULONG  ulPartitionAlignment;

    // Number of sector on device, where MBR resides.
    ULONG  ulMbrSector;

    // For NANDs and NORs, this is the number of sectors that each erasable
    // block contains.
    USHORT uwSectorsPerBlockBits;

    // This parameter refers only to NANDs. It states the type of the NAND,
    // according to 4 defined groups (see FCU documentation for details).
    UINT   uiNandType;

    // This parameter refers only to NORs. It states the type of the NOR,
    // currently supporting Intel and Amd.
    UINT   uiNorType;

    // This parameter refers only to NORs - it specifies if there is a special
    // boot block (a block which can be erased in a smaller resolution).
    BOOL   bNorBlockMapKnown;

	// This parameter holds the speed of the specific media we are working
    // with, in case it affects calls to the FCU driver.
    // The different speed options are media type specific.
    UINT   uiSpeed;

    // This parameter defines with which type of card we are working with - 
    // SD(4bit) or MMC(1bit).
    UINT   uiSdProtocol;


} FX_GEOMETRY, *FX_GEOMETRY_PTR;


/* Define directory entry type.  Directory entries are found in the
   root directory and in directory files (sub-directories).  Default
   the directory name length to 13 for 8.3 compatibility (the dot and
   a NULL at the end).  The user may change this on the compilation 
   command line.  */

#ifndef FX_MAX_LONG_NAME_LEN
//#define FX_MAX_LONG_NAME_LEN 13
#define FX_MAX_LONG_NAME_LEN 65
#endif

#define FX_MAX_SHORT_NAME_LEN       13          /* Only allowed value is 13 */

#ifdef FILEX_ENABLE_WRITE

#ifndef FX_MAX_CACHED_FAT_ENTRY
#define FX_MAX_CACHED_FAT_ENTRY     16          /* Minimum value is 1, suggested max 128 */
#endif

/* Define a single entry in the FAT cache.  The FAT cache is used to reduce the 
   number of times the actual FAT sectors need to be accessed, thereby improving
   performance.  */

typedef struct FX_FAT_ENTRY_STRUCT
{
    ULONG fx_fat_cluster;
    ULONG fx_fat_value;
} FX_FAT_ENTRY;

#endif // enable filex write

#ifndef FX_FAT_MAP_SIZE
#define FX_FAT_MAP_SIZE             128         /* Minimum 1, maximum any */
#endif


typedef struct FX_DIR_ENTRY_STRUCT
{
#ifdef FILEX_ENABLE_WRITE
    //CHAR		 *fx_dir_entry_name;
    //change FileX to use unicode
    WCHAR		 *fx_dir_entry_name;
#else
    //CHAR            fx_dir_entry_name[FX_MAX_LONG_NAME_LEN];
    //change FileX to use unicode
    WCHAR			fx_dir_entry_name[FX_MAX_LONG_NAME_LEN];
#endif
    UINT            fx_dir_long_name_present;   /* 0 (default) => not present; 1 => present*/
    UCHAR           fx_dir_entry_attributes;
    UINT            fx_dir_entry_time;
    UINT            fx_dir_entry_date;
    ULONG           fx_dir_entry_cluster;
    ULONG           fx_dir_entry_file_size;
    ULONG           fx_dir_entry_log_sector;
//#ifdef FILEX_ENABLE_WRITE
    ULONG           fx_dir_entry_next_log_sector;
    //CHAR            fx_dir_short_name[FX_MAX_SHORT_NAME_LEN] ;
    //change FileX to use unicode
    CHAR            fx_dir_short_name[FX_MAX_SHORT_NAME_LEN] ;
    UINT            fx_dir_long_name_shorted;
//#endif
    ULONG           fx_dir_entry_byte_offset;
} FX_DIR_ENTRY;


/* Define the path data structure.  This structure will contain
   the current path and the information for performing directory
   entry operations.  */

typedef struct FX_PATH_STRUCT
{
    /* Define the path information.  */
    FX_DIR_ENTRY    fx_path_directory;
#ifndef FILEX_NO_DEFAULT_PATH_STRING	
    //CHAR            fx_path_string[FX_MAXIMUM_PATH];
    //change FileX to use unicode
    WCHAR			fx_path_string[FX_MAXIMUM_PATH];
#endif
    ULONG           fx_path_current_entry;
#ifdef FILEX_ENABLE_WRITE
//    CHAR            fx_path_name_buffer[FX_MAX_LONG_NAME_LEN];
#endif
} FX_PATH;

typedef FX_PATH FX_LOCAL_PATH;


/* Define the cache control data structure.  There are FX_MAX_SECTOR_CACHE
   of these structures defined inside the FX_MEDIA structure.  Each entry 
   maintains a cache representation of a media sector.  */

typedef struct FX_CACHED_SECTOR_STRUCT
{

    /* Define the buffer pointer associated with this cache entry.  */
    UCHAR_PTR       fx_cached_sector_memory_buffer;


    /* Define the sector number that is cached.  */
    ULONG           fx_cached_sector;

    /* Define the flag that indicates whether or not the cached sector
       has been modified and needs to be written to the media.  */
    UINT            fx_cached_sector_buffer_dirty;

    /* Define the next cached sector pointer.  This is used to implement
       the "last used" algorithm when looking for cache entry to swap out to
       the physical media.  */
    struct FX_CACHED_SECTOR_STRUCT
                    *fx_cached_sector_next_used;   

} FX_CACHED_SECTOR;


/* Define a driver function */

//typedef VOID(*FX_DRIVER)(struct FX_MEDIA_STRUCT*);

/* Define the media control block.  All information about each open
   media device are maintained in by the FX_MEDIA data type.  */

typedef struct FX_MEDIA_STRUCT
{
#ifdef I86_USB_SUPPORT
    BYTE  bUSBLun;
#endif

    /* Define the media ID used for error checking.  */
    ULONG           fx_media_id;

    /* Define the media's name.  */
    //CHAR_PTR        fx_media_name;
    //change FileX to use unicode
    WCHAR*			  fx_media_name;

    /* Define the media's protection object, which is a ThreadX semaphore.  
       Only one thread is allowed to access any media or associated files
       at a time.  If FX_SINGLE_THREAD is defined, the FileX services are 
       going to be called from only one thread, hence the protection is 
       not needed.  */
#ifndef FX_SINGLE_THREAD
    OS_SEMAPHORE    fx_media_protect;
#endif

    /* Remember the memory buffer area.  */
    UCHAR_PTR       fx_media_memory_buffer;
    UCHAR_PTR       fx_media_memory_buffer_orig;
    ULONG           fx_media_memory_size;

    /* Define the sector cache control structures for this media.  */
    struct FX_CACHED_SECTOR_STRUCT
                    fx_media_sector_cache[FX_MAX_SECTOR_CACHE];

    /* Define the number of sectors actually cached based on the
       user supplied buffer at media open time.  */
    ULONG           fx_media_sector_cache_size;

    /* Define the end of the cache area.  This is used to determine
       if the I/O is for the internal memory of the media.  */
    UCHAR_PTR       fx_media_sector_cache_end;

    /* Define the list head of the cached sector entries.  This
       pointer points to the most recenty used cache sector.  */
    struct FX_CACHED_SECTOR_STRUCT
                    *fx_media_sector_cache_list_ptr;

    /* Define the basic information about the associated media.  */
    UINT            fx_media_bytes_per_sector;
    UINT            fx_media_sectors_per_track;
    UINT            fx_media_heads;

    ULONG           fx_media_total_sectors;
    ULONG           fx_media_total_clusters;
    UINT            fx_media_reserved_sectors;
    UINT            fx_media_root_sector_start;
    UINT            fx_media_root_sectors;
    UINT            fx_media_data_sector_start;
    UINT            fx_media_sectors_per_cluster;
    UINT            fx_media_sectors_per_FAT;
    UINT            fx_media_number_of_FATs;
    UINT            fx_media_12_bit_FAT;
    UINT            fx_media_32_bit_FAT;
    ULONG           fx_media_hidden_sectors;
    ULONG           fx_media_root_clus_32;
    UINT            fx_media_root_directory_entries;
    ULONG           fx_media_available_clusters;
    ULONG           fx_media_cluster_search_start;
    UCHAR           fx_media_type;
#ifdef FILEX_ENABLE_WRITE
    UINT            fx_media_FAT32_additional_info_update; //Fx_media_close
#endif

    /* Define the information pertinent to the I/O driver interface.  */
    VOID            *fx_media_driver_info;
    UINT            fx_media_driver_request;
    UINT            fx_media_driver_status;
    UCHAR_PTR       fx_media_driver_buffer;
    ULONG           fx_media_driver_logical_sector;
    ULONG           fx_media_driver_sectors;
    ULONG           fx_media_driver_physical_sector;
    UINT            fx_media_driver_physical_track;
    UINT            fx_media_driver_physical_head;  
    UINT            fx_media_driver_write_protect;      /* The driver sets this to FX_TRUE when media is write protected.  */
    UINT            fx_media_driver_free_sector_update; /* The driver sets this to FX_TRUE when it needs to know freed clusters.  */
#ifdef FILEX_ENABLE_WRITE
    UINT            fx_media_driver_system_write;	
#endif 

    /* Define the driver entry point.  */
    //FX_DRIVER       fx_media_driver_entry;
    /* Define the driver entry point.  */
    VOID            (*fx_media_driver_entry)(struct FX_MEDIA_STRUCT *);

    /* Define the current directory information for the media.  */
    FX_PATH         fx_media_default_path;

    /* Define the head pointer for the open files of this media.  */
//    struct FX_FILE_STRUCT
//                    *fx_media_opened_file_list;

    /* Define the counter for keeping track of how many open files are 
       present.  */
//    ULONG           fx_media_opened_file_count;

⌨️ 快捷键说明

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