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

📄 sec.h

📁 zilog的实时操作系统RZK,可以移植到多种处理器上
💻 H
字号:
/*
 * File       : sec.h
 * Description: This file contains the definitions required for sectors and FIRs required.
 * Author     : Mahadev K C
 * Created on : 30-APR-2003
 *
 * 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 
 */

#ifndef _SEC_H_
#define _SEC_H_

#include "zfstypes.h"
#include "zfsdef.h"
#include "zfstruct.h"

// macros
#define FREE_SECTOR			(0xFFFFFF)


//Function definitions

//Function Name: AllocSector
//Description: This function will search for a free sector and allocates it
ZFS_SEC_ID_t AllocSector( PZFS_VOL_INFO_t pvol_info, ZFS_SEC_ID_t sec_id, UINT8 sec_type ) ;

//Function Name: GetFreeSector
//Description: This function will return the free sector's address
ZFS_SEC_ID_t GetFreeSector( PZFS_VOL_INFO_t pvol_info ) ;

//Function Name: GetNewSecNum
//Description: This function will search through the SAT table to find a new sector num
ZFS_SEC_ID_t GetNewSecNum( PZFS_VOL_INFO_t pvol_info ) ;

//Function Name: FreeSector
//Description: This function will free the sector pointed by sector number and its linked sectors
UINT8 FreeSector( PZFS_VOL_INFO_t pvol_info, ZFS_SEC_ID_t secnum ) ;

//Function Name: AllocFIR
//Description: This function will allocate an FIR from the FIT
PZFS_FIR_t AllocFIR( PZFS_VOL_INFO_t pvol_info, PZFS_FIT_HDR_t pfit_hdr ) ;

//Function Name: FreeFIR
//Description: This function will free the FIR pointing to it.
UINT8 FreeFIR( PZFS_VOL_INFO_t pcol_info, PZFS_FIR_t pfir ) ;

//Function Name: SearchFIR
//Description: This function will search through the FIT for particular file/director name
PZFS_FIR_t SearchFIR( PZFS_VOL_INFO_t pvol_info, PZFS_FIT_HDR_t fit_sec_num, INT8 *fd_name, UINT len ) ;

//Function Name: WriteFIR
//Description: This function will write the FIR contents at the FIR address for the given volume.
void WriteFIR( PZFS_VOL_INFO_t pvol_info, PZFS_FIR_t pfir, PZFS_FIR_t new_fir_data ) ;

//Function Name: OverWriteFIR
//Description: This function will free up the previous FIR and allocates a new FIR in case of 
// Flash and in case of RAM, just overwrites into appropriate RAM location
PZFS_FIR_t OverWriteFIR( PZFS_VOL_INFO_t pvol_info, PZFS_FIT_HDR_t pfit, PZFS_FIR_t pfir, PZFS_FIR_t new_fir_data ) ;

 UINT8 * GetSecAddr( PZFS_VOL_INFO_t pvol_info, ZFS_SEC_ID_t sec_id ) ;

//Function Name: OverWriteSector
//Description: This function will free the previous sector and allocates a new sector and returns the 
// sector id of the newly allocated sector to the caller
ZFS_SEC_ID_t OverWriteSector( PZFS_VOL_INFO_t pvol_info, ZFS_SEC_ID_t cur_sec_id, UINT8 sec_type ) ;

//Function Name: LinkSector
//Description: This function will link the old and new sectors
void LinkSector( PZFS_VOL_INFO_t pvol_info, ZFS_SEC_ID_t old_sec_id, ZFS_SEC_ID_t new_sec_id ) ;

//Function Name: GetBlkWithFreeSector
//Description: This function will return the length of file/directory name present in FIR
extern UINT GetLenOfFDNameFromFIR( INT8 *path ) ;

//Function: GetBlkWithFreeSector
//Description: This function will return the block which has free sector (Valid only in FLASH)
PZFS_BLK_INFO_t GetBlkWithFreeSector( PZFS_VOL_INFO_t pvol_info ) ;

//Function Name: IsDirtySectorsPresent
//Description: This function will check the current volume to return TRUE if dirty sectors are
// present
ZFS_STATUS_t IsDirtySectorsPresent( PZFS_VOL_INFO_t pvol_info ) ;


#endif // _SEC_H_

⌨️ 快捷键说明

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