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

📄 zfs_conf.c

📁 zilog的实时操作系统RZK,可以移植到多种处理器上
💻 C
字号:
/*
 * File       : ZFS_Conf.c
 *
 * Description: Defines the configurable parameters for FileSystem
 *
 * Copyright 2004 ZiLOG Inc.  ALL RIGHTS RESERVED.
 *
 * This file contains unpublished confidential and proprietary information
 * of ZiLOG, Inc.
 * NO PART OF THIS WORK MAY BE DUPLICATED, STORED, PUBLISHED OR DISCLOSED 
 * IN ANY FORM WITHOUT THE PRIOR WRITTEN CONSENT OF ZiLOG, INC.
 * This is not a license and no use of any kind of this work is authorized
 * in the absence of a written license granted by ZiLOG, Inc. in ZiLOG's 
 * sole discretion 
 */


// ********************************************************
// RZK CORE CONFIGURATION
#include "ZSysgen.h"
#include "ZFSTypes.h"
#include "ZFSCfg.h"
#include "ZFStruct.h"
#include "Ram_Driver.h"
#include "MT28F008_Driver.h"

#ifdef RZKFS
// **************************
// CHANGE THE BELOW VALUES IF YOU KNOW WHAT YOU ARE DOING,
// REFER TO REFERENCE MANUAL FOR DESCRIPTIONS
// **************************
/* notes */
///////////////////////////////////////////////////////
// ZFS_TOTAL_NUM_BLOCKS
// Total number of blocks present in the system. This should include for 
// all volumes. For RAM volume, please add 1 block per RAM volume to the 
// total number of blocks for flash volumes.
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// ZFS_TOTAL_NUM_SECTORS
// Total number of sectors present in the system except sectors present 
// in the RAM volumes. This macro vlaue should contain only the sectors 
// present in FLASH volumes.
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// ZFS_TOTAL_NUM_VOLUMES
// Total number of volumes present in the system
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// ZFS_MAX_FILE_OPEN_COUNT
// Maximum number of file open instances at a time. The application can 
// file open instances upto the value specified. This is per system 
// value and not per volume value.
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// ZFS_MAX_DIRS_SUPPORTED
// Maximum number of directories supported in the system This number also
// includes the root directory of the each volume. Minimum value is number
// of volumes (for root directory of each volume). Use your discretion to 
// reduce or increase depending upon the memory usage
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// ERASE_FLASH
// The FLASH related volumes to be erased before initializing the file
// system. effectively it is nothing but formatting of the flash volumes. 
// 0 - for not erasing (persistance present), 1 - for erasing the flash
// volumes
///////////////////////////////////////////////////////

#if defined(RAM_MAP) || defined(STANDALONE)
    #define ZFS_TOTAL_NUM_BLOCKS            ( 7 )
    #define ZFS_TOTAL_NUM_SECTORS           ( 0xE0000/ZFS_SEC_SIZE )
    #define ZFS_TOTAL_NUM_VOLUMES           ( 1 )

#else

    #ifdef FSCOPY_TO_RAM

        #ifdef _EZ80L92
            #define ZFS_TOTAL_NUM_BLOCKS            ( 1 )
            #define ZFS_TOTAL_NUM_SECTORS           ( 0x40000/ZFS_SEC_SIZE )
            #define ZFS_TOTAL_NUM_VOLUMES           ( 1 )
        #else
            #define ZFS_TOTAL_NUM_BLOCKS            ( 3 )
            #define ZFS_TOTAL_NUM_SECTORS           ( 0x60000/ZFS_SEC_SIZE )
            #define ZFS_TOTAL_NUM_VOLUMES           ( 1 )
        #endif

    #else

        #define ZFS_TOTAL_NUM_BLOCKS            ( 1 )
        #define ZFS_TOTAL_NUM_SECTORS           ( 0x80000/ZFS_SEC_SIZE )
        #define ZFS_TOTAL_NUM_VOLUMES           ( 1 )
    #endif
#endif

#define ZFS_MAX_FILE_OPEN_COUNT         ( 20 )
#define ZFS_MAX_DIRS_SUPPORTED          ( 50 )
#define ERASE_FLASH                     ( 0 )

///////////////////////////////////////////////////////
// Volumes configuration
// The below structure should be filled up with respect to the number of
// volumes and their characterstics. Please refer to User Manual for
// configuration.
///////////////////////////////////////////////////////
ZFS_CONFIG_t g_zfs_cfg[ ZFS_TOTAL_NUM_VOLUMES ] = {
#if defined(RAM_MAP) || defined(STANDALONE)
	{
		"EXTF",				// vol name
		ZFS_EXT_FLASH_DEV_TYPE, // vol type
		(UINT8*)0x120000, 		// vol_start_addr
		0xE0000, 				// vol_size
		7, 						// vol_blocks
		(0xE0000/ZFS_SEC_SIZE), // number of sectors
		FS_MT28F008_Init, 
		FS_MT28F008_Read,
		FS_MT28F008_Write,
		FS_MT28F008_Erase,
		FS_MT28F008_Close
	},
#else
#ifdef FSCOPY_TO_RAM

#ifdef _EZ80L92
	{
		"EXTF",				// vol name
		ZFS_RAM_DEV_TYPE, // vol type
		(UINT8*)0xB80000, 		// vol_start_addr
		0x40000, 				// vol_size
		1, 						// vol_blocks
		(0x40000/ZFS_SEC_SIZE), // number of sectors
		RamDrv_Init, 
		RamDrv_Read,
		RamDrv_Write,
		RamDrv_Erase,
		RamDrv_Close
	},
#else
	{
		"EXTF",				// vol name
		ZFS_EXT_FLASH_DEV_TYPE, // vol type
		(UINT8*)0x1A0000, 		// vol_start_addr
		0x60000, 				// vol_size
		3, 						// vol_blocks
		(0x60000/ZFS_SEC_SIZE), // number of sectors
		FS_MT28F008_Init, 
		FS_MT28F008_Read,
		FS_MT28F008_Write,
		FS_MT28F008_Erase,
		FS_MT28F008_Close
	},
#endif
#else
	{
		"EXTF",				// vol name
		ZFS_RAM_DEV_TYPE, // vol type
		(UINT8*)0xB80000, 		// vol_start_addr
		0x80000, 				// vol_size
		1, 						// vol_blocks
		(0x80000/ZFS_SEC_SIZE), // number of sectors
		RamDrv_Init, 
		RamDrv_Read,
		RamDrv_Write,
		RamDrv_Erase,
		RamDrv_Close
	}
#endif
#endif

} ;


// **************************
// DO NOT CHANGE ANYTHING BELOW IN THIS SECTION
// **************************

ZFS_OPEN_REC_t                                    g_zfs_or[ ZFS_MAX_FILE_OPEN_COUNT ] ;
ZFS_VOL_INFO_t                                    g_zfs_vol_info[ ZFS_TOTAL_NUM_VOLUMES ] ;
ZFS_DIR_LIST_t                                    g_dir_list[ ZFS_MAX_DIRS_SUPPORTED ] ;
ZFS_BLK_INFO_t                                    g_blk_info[ ZFS_TOTAL_NUM_BLOCKS ] ;
UINT8 *                                           g_zfs_sat[ ZFS_TOTAL_NUM_SECTORS ] ;
UINT      g_max_threads                           ;
UINT      g_max_cwd_len                           ;
UINT      g_max_or_entries                        = ZFS_MAX_FILE_OPEN_COUNT ;
UINT      g_max_dirs_supported                    = ZFS_MAX_DIRS_SUPPORTED ;
UINT      g_max_volumes                           = ZFS_TOTAL_NUM_VOLUMES ;
UINT      g_max_flash_sectors                     = ZFS_TOTAL_NUM_SECTORS ;
UINT      g_max_flash_blks                        = ZFS_TOTAL_NUM_BLOCKS ;
UINT8     g_byEraseFlash                          = ERASE_FLASH ;

#endif // RZKFS


// END OF RZK FILE SYSTEM CONFIGURATION
// ********************************************************







⌨️ 快捷键说明

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