亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rawfslib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* rawFsLib.c - raw block device file system library *//* Copyright 1984-2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------03j,30apr02,jkf  SPR#75255, corrected unneeded api change to rawFsDevInit()                 SPR#72300, 4GB drive failed with rawFsOpen()                 SPR#25017, corrected FIODISKFORMAT docs to reflect reality.03i,09nov01,jkf  SPR#71633, dont set errno when DevCreate is called w/BLK_DEV03h,20sep01,jkf  SPR#69031, common code for both AE & 5.x.03g,31jul00,jkf  removal of RT-11 (rt11) file system, SPR#32821/3122303f,29feb00,jkf  T3 changes, cleanup.03e,31aug99,jkf  changes for new CBIO API.03d,31jul99,jkf  T2 merge, tidiness & spelling, jdi's 01p SPR#(SPR 25663).03c,23jul98,vld	 fixed SPR#8309 : rawFsDevInit() calls rawFsInit()		 with default parameters;		 fixed SPR#21875/9418 : don't validate seeked position for		 volume end overgoing.03b,23jul98,vld	 discontinued actual support for different		 volume states except RAW_VD_MOUNTED and 		 RAW_VD_READY_CHANGED;03a,23jul98,vld	 driver interface changed to support CBIO_DEV;		 fixed SPR#22606 : CBIO on-byte base access functions		 are used instead of per file descriptor buffers02b,23jul98,vld	 added support for 64-bit ioctl requests;                 32-bit restricted old ioctl functions improved to check   	         and to return ERROR for 32-bit overloading results;		 added new routine rawFsIsValHuge().02a,23jul98,vld	 - added support for 64-bit arithmetic to serve huge volumes:		 type of rawFdCurPtr, rawFdNewPtr and rawFdEndPtr                 fields of RAW_FILE_DESC changed to fsize_t;    	    	 - new type defined for block number (block_t);                 - "empty buffer" value constant		 defined as BUF_EMPTY (block_t)(-1)01p,14mar99,jdi  doc: removed refs to config.h and/or configAll.h (SPR 25663).01l,02oct92,srh  added ioctl(FIOGETFL) to return file's open mode01k,22jul92,kdl  changed from 4.0.2-style semaphores to mutexes.01j,18jul92,smb  Changed errno.h to errnoLib.h.01i,04jul92,jcf  scalable/ANSI/cleanup effort.01h,26may92,rrr  the tree shuffle01g,16dec91,gae  added includes for ANSI.01f,19nov91,rrr  shut up some ansi warnings.01e,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed READ, WRITE and UPDATE to O_RDONLY O_WRONLY and ...		  -changed VOID to void		  -changed copyright notice01d,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by kdl.01c,21feb91,jaa	 documentation cleanup.01b,08oct90,kdl  lint.01a,02oct90,kdl  written*//*This library provides basic services for disk devices that do notuse a standard file or directory structure.  The disk volume is treatedmuch like a large file.  Portions of it may be read, written, or thecurrent position within the disk may be changed.  However, thereis no high-level organization of the disk into files or directories.USING THIS LIBRARYThe various routines provided by the VxWorks raw "file system" (rawFs) maybe separated into three broad groups: general initialization,device initialization, and file system operation.The rawFsInit() routine is the principal initialization function;it need only be called once, regardless of how many rawFs deviceswill be used.A separate rawFs routine is used for device initialization.  Foreach rawFs device, rawFsDevInit() must be called to install the device.Several routines are provided to inform the file system ofchanges in the system environment.  The rawFsModeChange() routine may beused to modify the readability or writability of a particular device.The rawFsReadyChange() routine is used to inform the file system that adisk may have been swapped and that the next disk operation should firstremount the disk.  The rawFsVolUnmount() routine informs thefile system that a particular device should be synchronized and unmounted,generally in preparation for a disk change.INITIALIZATIONBefore any other routines in rawFsLib can be used, rawFsInit() must be called to initialize the library.  This call specifies themaximum number of raw device file descriptors that can be opensimultaneously and allocates memory for that many raw file descriptors.Any attempt to open more raw device file descriptors than the specifiedmaximum will result in errors from open() or creat().During the rawFsInit() call, the raw device library is installed as a driverin the I/O system driver table.  The driver number associated with it isthen placed in a global variable, `rawFsDrvNum'.This initialization is enabled when the configuration macro INCLUDE_RAWFSis defined; rawFsInit() is then called from the root task, usrRoot(), inusrConfig.c.DEFINING A RAW DEVICETo use this library for a particular device, the device structureused by the device driver must contain, as the very first item, a CBIOdevice description structure (CBIO_DEV) or block device descriptionstructure (BLK_DEV) .  This must be initializedbefore calling rawFsDevInit().The rawFsDevInit() routine is used to associate a device with the rawFsLibfunctions.  The <pVolName> parameter expected by rawFsDevInit() is a pointer toa name string, to be used to identify the device.  This will serve asthe pathname for I/O operations which operate on the device.  Thisname will appear in the I/O system device table, which may be displayedusing iosDevShow().The syntax of the rawFsDevInit()routine is as follows:.CS    rawFsDevInit	(	char     *pVolName, /@ name to be used for volume - iosDevAdd  @/	BLK_DEV  *pDevice   /@ a pointer to BLK_DEV device or a CBIO_DEV_ID @/	).CEUnlike the VxWorks DOS file system, raw volumes do notrequire an \%FIODISKINIT ioctl() function to initialize volume structures.(Such an ioctl() call can be made for a raw volume, but it has no effect.)As a result, there is no "make file system" routine for raw volumes(for comparison, see the manual entry for rawFsMkfs()).When rawFsLib receives a request from the I/O system, after rawFsDevInit()has been called, it calls the appropriate device driver routinesto access the device.MULTIPLE LOGICAL DEVICESThe block number passed to the block read and write routines is an absolutenumber, starting from block 0 at the beginning of the device.  If desired,the driver may add an offset from the beginning of the physical devicebefore the start of the logical device.  This would normally be done bykeeping an offset parameter in the driver's device-specific structure,and adding the proper number of blocks to the block number passed to the readand write routines.  See the ramDrv manual entry for an example.UNMOUNTING VOLUMES (CHANGING DISKS)A disk should be unmounted before it is removed.  When unmounted,any modified data that has not been written to the disk will be writtenout.  A disk may be unmounted by either calling rawFsVolUnmount() directlyor calling ioctl() with a FIODISKCHANGE function code.There may be open file descriptors to a raw device volume when it isunmounted.  If this is the case, those file descriptors will be markedas obsolete.  Any attempts to use them for further I/O operations willreturn an S_rawFsLib_FD_OBSOLETE error.  To free such file descriptors, use theclose() call, as usual.  This will successfully free the descriptor,but will still return S_rawFsLib_FD_OBSOLETE.SYNCHRONIZING VOLUMESA disk should be "synchronized" before it is unmounted.  To synchronize adisk means to write out all buffered data (the write buffers associatedwith open file descriptors), so that the disk is updated.  It mayor may not be necessary to explicitly synchronize a disk, depending onhow (or if) the driver issues the rawFsVolUnmount() call.When rawFsVolUnmount() is called, an attempt will be made to synchronize thedevice before unmounting.  However, if the rawFsVolUnmount() call is made bya driver in response to a disk being removed, it is obviously too late tosynchronize.  Therefore, a separate ioctl() call specifying the FIOSYNCfunction should be made before the disk is removed.  (This could be done inresponse to an operator command.)If the disk will still be present and writable when rawFsVolUnmount() iscalled, it is not necessary to first synchronize the disk.  Inall other circumstances, failure to synchronize the volume beforeunmounting may result in lost data.IOCTL FUNCTIONSThe VxWorks raw block device file system supports the following ioctl()functions.  The functions listed are defined in the header ioLib.h..iP "FIODISKFORMAT" 16 3No file system is initialized on the disk by this request.This ioctl is passed directly down to the driver-provided function:.CS    fd = open ("DEV1:", O_WRONLY);    status = ioctl (fd, FIODISKFORMAT, 0);.CE.iP "FIODISKINIT"Initializes a raw file system on the disk volume.Since there are no file system structures, this functions performs no action.It is provided only for compatibility with other VxWorks file systems..iP "FIODISKCHANGE"Announces a media change.  It performs the same function as rawFsReadyChange().This function may be called from interrupt level:.CS    status = ioctl (fd, FIODISKCHANGE, 0);.CE.iP "FIOUNMOUNT"Unmounts a disk volume.  It performs the same function as rawFsVolUnmount().This function must not be called from interrupt level:.CS    status = ioctl (fd, FIOUNMOUNT, 0);.CE.iP "FIOGETNAME"Gets the file name of the file descriptor and copies it to the buffer <nameBuf>:.CS    status = ioctl (fd, FIOGETNAME, &nameBuf);.CE.iP "FIOSEEK"Sets the current byte offset on the disk to the position specifiedby <newOffset>:.CS    status = ioctl (fd, FIOSEEK, newOffset);.CE.iP "FIOWHERE"Returns the current byte position from the start of the devicefor the specified file descriptor.This is the byte offset of the next byte to be read or written.It takes no additional argument:.CS    position = ioctl (fd, FIOWHERE, 0);.CE.iP "FIOFLUSH"Writes all modified file descriptor buffers to the physical device..CS    status = ioctl (fd, FIOFLUSH, 0);.CE.iP "FIOSYNC"Performs the same function as FIOFLUSH..iP "FIONREAD"Copies to <unreadCount> the number of bytes from the current file positionto the end of the device:.CS    status = ioctl (fd, FIONREAD, &unreadCount);.CE.LPINCLUDE FILES: rawFsLib.hSEE ALSO: ioLib, iosLib, rawFsLib, ramDrv,.pG "I/O System, Local File Systems"*//* LINTLIBRARY */#include "vxWorks.h"#include "private/dosFsVerP.h"#include "ctype.h"#include "ioLib.h"#include "lstLib.h"#include "stdlib.h"#include "string.h"#include "semLib.h"#include "errnoLib.h"#include "assert.h"#include "cbioLib.h"#include "rawFsLib.h"#define SIZE64#ifdef SIZE64typedef long long       fsize_t;#define RAWFS_IS_VAL_HUGE( val )  ( ( (fsize_t)(val) >> 32 ) != 0 )#elsetypedef size_t          fsize_t;#define RAWFS_IS_VAL_HUGE( val )  FALSE#endif /* SIZE64 *//* Raw device file descriptor */typedef struct		/* RAW_FILE_DESC */    {    NODE	rawFdNode;	/* linked list node info */    SEM_ID	rawFdSemId;	/* semaphore for this file descriptor */    int		rawFdStatus;	/* (OK | NOT_IN_USE) */    RAW_VOL_DESC * pRawFdVd;	/* ptr to volume descriptor */    int		rawFdMode;	/* mode: O_RDONLY, O_WRONLY, O_RDWR */    fsize_t	rawFdNewPtr;	/* file byte ptr for new read/writes */    fsize_t	rawFdEndPtr;	/* file byte ptr to end of file */    cookie_t	rawFdCookie;	/* CBIO cookie of recently accessed sector */    } RAW_FILE_DESC;/* File descriptor status values */#define RAWFD_AVAILABLE		-1	/* file descriptor available */#define RAWFD_IN_USE		0	/* file descriptor in-use */#define RAWFD_OBSOLETE		1	/* file descriptor obsolete */#define BUF_EMPTY	(block_t)(-1)	/* buffer not initialized *//* type definitions *//* GLOBALS */int 	rawFsDrvNum   = ERROR;	   /* I/O system driver number for rawFsLib */					/* default mutex options */int	rawFsVolMutexOptions    = (SEM_Q_PRIORITY | SEM_DELETE_SAFE);int	rawFsFdListMutexOptions = (SEM_Q_PRIORITY | SEM_DELETE_SAFE);int	rawFsFdMutexOptions     = (SEM_Q_PRIORITY | SEM_DELETE_SAFE);/* LOCALS */LOCAL LIST	rawFsFdActiveList;	/* linked list of in-use Fd's */LOCAL LIST	rawFsFdFreeList;	/* linked list of avail. Fd's */LOCAL SEM_ID 	rawFsFdListSemId;	/* file descr list semaphore  */LOCAL int 	rawFsMaxFiles;		/* max files open at once     *//* forward static functions */static STATUS	rawFsBlkRdWr (RAW_VOL_DESC *pVd, block_t startBlk,			      int numBlks, FAST char *pBuf,                               CBIO_RW rw);static STATUS	rawFsBtRdWr (RAW_VOL_DESC *pVd, block_t blk,			     off_t offset, char * pBuf, size_t nBytes,			     CBIO_RW rw, cookie_t * pCookie);static STATUS	rawFsClose (RAW_FILE_DESC *pRawFd);static STATUS	rawFsFdFlush (RAW_FILE_DESC *pRawFd);static void	rawFsFdFree (RAW_FILE_DESC *pRawFd);static RAW_FILE_DESC *rawFsFdGet (void);static STATUS	rawFsFlush (RAW_VOL_DESC *pVd);static STATUS	rawFsIoctl (RAW_FILE_DESC *pRawFd, int function, int arg);static RAW_FILE_DESC *rawFsOpen (RAW_VOL_DESC *pVd, char *name, int flags);static int	rawFsRead (RAW_FILE_DESC *pRawFd, char *pBuf, int maxBytes);static STATUS	rawFsReset (RAW_VOL_DESC *pVd);static STATUS	rawFsSeek (RAW_FILE_DESC *pRawFd, fsize_t position);static STATUS	rawFsVolCheck (RAW_VOL_DESC *pVd);static STATUS	rawFsVolFlush (RAW_VOL_DESC *pVd);static STATUS	rawFsVolMount (RAW_VOL_DESC *pVd);static fsize_t	rawFsWhere (RAW_FILE_DESC *pRawFd);static int	rawFsWrite (RAW_FILE_DESC *pRawFd, char *pBuf, int maxBytes);/********************************************************************************* rawFsIsValHuge -  - check if value is greater, than 4GB (max 32 bit).** * RETURNS: TRUE if is greater, else return FALSE.*/LOCAL BOOL rawFsIsValHuge    (    fsize_t     val    )    {    return RAWFS_IS_VAL_HUGE( val );    } /* rawFsIsValHuge() *//********************************************************************************* rawFsBlkRdWr - read/write block(s) from/to a raw volume** This routine reads/writes the specified block from/to the* specified volume.** RETURNS:* OK, or* ERROR, if read/write error.*/LOCAL STATUS rawFsBlkRdWr    (    FAST RAW_VOL_DESC   *pVd,         	/* pointer to volume descriptor */    block_t             startBlk,       /* starting block for read */    int                 numBlks,        /* how many blocks to read */    FAST char           *pBuf,          /* buffer to receive block */    CBIO_RW		rw		/* read / write */    )    {    return (cbioBlkRW (pVd->rawVdCbio, startBlk, numBlks, pBuf, rw , NULL));    }/********************************************************************************* rawFsBtRdWr - read/write some bytes from/to block.** This routine reads/writes the specified number of bytes* from/to specified block starting at specified offset.** RETURNS:* OK, or* ERROR, if volume access error.*/LOCAL STATUS rawFsBtRdWr    (    FAST RAW_VOL_DESC   *pVd,         /* pointer to volume descriptor */    block_t		blkNum,       /* block number */    off_t		offset,		/* offset in block */    char		*pBuf,          /* data buffer */    size_t		numBytes,        /* how many bytes to process */    CBIO_RW		rw,		/* read / write */    cookie_t        	*pCookie    )    {    return ( cbioBytesRW (    		pVd->rawVdCbio, blkNum, offset, pBuf, numBytes, rw, pCookie));    }/********************************************************************************* rawFsClose - close raw volume

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精彩视频在线观看| 国产精品99久久久| 国产成人免费网站| 色噜噜狠狠成人中文综合| 欧美一级淫片007| 最新国产成人在线观看| 美女精品一区二区| 欧洲视频一区二区| 国产女主播一区| 九色综合狠狠综合久久| 欧美日韩一级大片网址| 26uuu久久天堂性欧美| 国产精品久久久久一区二区三区共| 亚洲成人黄色影院| 色婷婷亚洲婷婷| 亚洲免费观看在线视频| 国产传媒日韩欧美成人| 久久久99精品免费观看不卡| 亚洲黄色录像片| 99精品国产91久久久久久| 久久美女高清视频| 国产成人免费9x9x人网站视频| 欧美一区二区网站| 亚洲午夜日本在线观看| 日韩精品最新网址| 天堂蜜桃91精品| 欧美精品乱码久久久久久按摩 | 制服丝袜av成人在线看| 天堂成人国产精品一区| 在线免费不卡视频| 精品剧情v国产在线观看在线| 天天av天天翘天天综合网色鬼国产| 91久久一区二区| 一区二区三区成人在线视频| 亚洲一区二区三区中文字幕 | 欧美日韩日本视频| 亚洲成精国产精品女| 日本乱码高清不卡字幕| 午夜一区二区三区在线观看| 日韩网站在线看片你懂的| 日韩精品一级中文字幕精品视频免费观看| 欧美日韩亚洲综合一区二区三区| 老司机精品视频导航| 国产欧美日韩激情| 欧美日韩不卡在线| av爱爱亚洲一区| 日韩电影免费一区| 中文字幕综合网| 久久午夜色播影院免费高清| 日本韩国欧美一区| 狠狠色2019综合网| 亚洲午夜免费福利视频| 中文字幕乱码日本亚洲一区二区 | 欧美一级夜夜爽| 欧美日韩在线不卡| 欧洲一区二区av| 欧美色综合天天久久综合精品| 91美女片黄在线| 色香蕉久久蜜桃| 欧美老女人第四色| 666欧美在线视频| 欧美电影免费提供在线观看| 在线观看91av| 精品久久人人做人人爰| 久久久国际精品| 中文字幕第一页久久| 国产精品电影一区二区| 亚洲国产综合人成综合网站| 亚洲成人免费观看| 国产一区二区三区香蕉| 国产老肥熟一区二区三区| 国产成人精品一区二区三区四区 | 欧美美女网站色| 久久久亚洲国产美女国产盗摄| 国产欧美一区二区三区在线看蜜臀 | 亚洲欧美另类久久久精品2019| 亚洲影院免费观看| 免费观看在线综合| 顶级嫩模精品视频在线看| 99久久免费视频.com| 欧美日本一区二区在线观看| 日韩午夜小视频| 亚洲视频在线一区观看| 亚洲女同ⅹxx女同tv| 欧美精品一区二区久久婷婷| 日韩视频免费观看高清在线视频| 中文字幕一区二区三区在线不卡 | 国产一区二区调教| 欧美在线观看视频在线| 精品久久久久久最新网址| 亚洲欧美日韩国产综合在线| 日韩av高清在线观看| 99久久99久久久精品齐齐| 欧美成人精品福利| 亚洲不卡一区二区三区| 国产成人精品三级麻豆| 日韩免费高清av| 偷窥少妇高潮呻吟av久久免费| 97se亚洲国产综合自在线观| 国产性色一区二区| 国产麻豆一精品一av一免费 | 日本视频一区二区| 久久久电影一区二区三区| 美女在线视频一区| 欧美一区二区三区免费大片| 依依成人精品视频| 色诱亚洲精品久久久久久| 欧美国产激情一区二区三区蜜月| 国产一区二区三区美女| 欧美成人video| 北岛玲一区二区三区四区| 国产精品你懂的| 欧美在线看片a免费观看| 亚洲国产精品天堂| 日韩免费一区二区| 国产电影一区在线| 亚洲日本在线看| 欧美一级国产精品| 成人污污视频在线观看| 中文字幕一区二区三| 欧美日韩成人综合在线一区二区| 无吗不卡中文字幕| 久久综合久久久久88| 99久久99久久久精品齐齐| 婷婷一区二区三区| 中文字幕精品—区二区四季| 在线精品观看国产| 国产精品456露脸| 亚洲成人在线观看视频| 精品国产乱码久久久久久免费| 成+人+亚洲+综合天堂| 亚洲h在线观看| 国产精品嫩草99a| 日韩手机在线导航| 91亚洲国产成人精品一区二区三 | 一区二区日韩av| 国产清纯美女被跳蛋高潮一区二区久久w| 一本到一区二区三区| 国产凹凸在线观看一区二区| 婷婷国产v国产偷v亚洲高清| 依依成人精品视频| 国产精品乱码人人做人人爱 | 国产精品国产三级国产aⅴ原创| 成人免费看视频| 国产成人自拍在线| 精品在线你懂的| 久久99精品视频| 精品一区二区三区在线播放| 国产原创一区二区| 一区二区三区精品| 亚洲综合色区另类av| 一级特黄大欧美久久久| 亚洲最快最全在线视频| 亚洲视频在线观看一区| 亚洲一区二区四区蜜桃| 香蕉乱码成人久久天堂爱免费| 丝袜亚洲另类欧美| 三级久久三级久久久| 午夜在线电影亚洲一区| 美美哒免费高清在线观看视频一区二区| 视频一区二区国产| 久久草av在线| 97久久精品人人做人人爽50路 | 国产乱人伦偷精品视频免下载| 国产一区二区免费视频| 国产福利一区在线| 在线视频一区二区三区| 欧美大黄免费观看| 中文字幕日韩av资源站| 调教+趴+乳夹+国产+精品| 精品一区二区三区影院在线午夜| 成人免费视频caoporn| 欧美日韩精品一区视频| 欧美哺乳videos| 亚洲精选在线视频| 国产精品一区二区久久不卡| 欧洲亚洲国产日韩| 国产精品乱码一区二三区小蝌蚪| 亚洲国产精品影院| proumb性欧美在线观看| 欧美一区二区在线免费播放| 亚洲欧美自拍偷拍色图| 麻豆精品视频在线观看免费| 在线观看三级视频欧美| 中文字幕第一页久久| 久久99久久精品欧美| 在线视频综合导航| 国产精品久久久久久久久快鸭| 麻豆极品一区二区三区| 欧美精品777| 一区二区三区色| 色综合久久综合| 亚洲免费电影在线| av在线不卡免费看| 国产精品久久福利| 91麻豆免费观看| 亚洲婷婷在线视频| 99久久国产综合精品色伊| 欧美极品aⅴ影院| 成人av在线电影|