📄 cmdpkt.h
字号:
/* *---------------------------------------------------------------------- * T-Kernel / Standard Extension * * Copyright (C) 2006 by Ken Sakamura. All rights reserved. * T-Kernel / Standard Extension is distributed * under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * * Version: 1.00.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* * cmdpkt.h (file) * * File management * Command packet format */#ifndef _FM_CMDPKT_H_#define _FM_CMDPKT_H_#include "filemgr.h"#include <sys/syscall.h>#include <extension/sys/segment.h>#include <extension/sys/tkse_ssid.h>#include <extension/sys/svc/iffile.h>/* * Service function number */typedef enum { /* Initialize/End the file system. */ FM_INIT_FN = (INT)(0x80010000U | FM_SVC), FM_FINISH_FN = (INT)(0x80020000U | FM_SVC), /* Call the manager service. */ FM_STARTUP_FN = (INT)(0x80030100U | FM_SVC), FM_CLEANUP_FN = (INT)(0x80040100U | FM_SVC), FM_BREAK_FN = (INT)(0x80050100U | FM_SVC), /* Service command between file systems for internal use. */ FMI_GetFileInfo_FN = (INT)(0x80100400U | FM_SVC), FMI_ChangeLinkFileName_FN = (INT)(0x80110200U | FM_SVC), FMI_SetWorkFile_FN = (INT)(0x80120200U | FM_SVC), /* Forced termination of command */ FMI_BreakSysCall_FN = (INT)0xffffffffU} FmFunctionNumber;/* * Work area in the command packet. */typedef struct FmWorkSpace { PINFO *pinfo; /* Management information of request process. */ RNO rdvno; /* Request accept rendezvous number */ LINK lnk; /* Link for forwarding */ TC *pathp; /* Path pointer for forwarding */} FmWorkSpace;/* * File management command packet */typedef struct FmCmdPkt { SyscallCmdPacket cmd; FmWorkSpace wrk;} FmCmdPkt;/* * Rendezvous port attribute for packet passing */#define FmPortAttr /*(T_CPOR)*/{0, (TA_TPRI), sizeof(VP), sizeof(VP), "fmport"}IMPORT T_CPOR fmPortAttr;/* * Rendezvous port ID for forwarding directions * Do not forward when NoForward. * Forward to the port of the manager task when ForwardMgr. * Forward to the port of the specified ID otherwise. */typedef ID FwdID;#define NoForward ((FwdID)(InvalidID)) /* Show that it is not forwarded. */#define ForwardMgr ((FwdID)(InvalidID - 1)) /* Forward to the manager task. */#define WaitRequest ((FwdID)(InvalidID - 2)) /* Go into indeterminate waiting. *//* * TRUE when forwarding request from a file system task. */#define isCmdForward(pkt) ( (pkt)->wrk.lnk.fs_name[0] != 0 )#define resetCmdForward(pkt) ( (pkt)->wrk.lnk.fs_name[0] = (TC)0 )/* * Waiting time and semaphore attribute for synchronous execution control flag. */#define SyncExecFlagAttr /*(T_CSEM)*/{0, (TA_TFIFO), 1, 1, "syncexec"}#define SyncExecWait ( (TMO)10 ) /* Millisecond */#include "accmode.h"#include "filedes.h"/* * Argument packet of the service function */typedef struct { PINFO *pinfo;} FM_STARTUP_PARA;typedef struct { PINFO *pinfo;} FM_CLEANUP_PARA;typedef struct { ID tskid;} FM_BREAK_PARA;typedef struct { LINK *lnk; TC *fname; STIME *ctime; FileAccMode *amode;} FMI_GetFileInfo_PARA;typedef struct { LINK *lnk; TC *fname;} FMI_ChangeLinkFileName_PARA;typedef struct { LINK *lnk; PINFO *pinfo;} FMI_SetWorkFile_PARA;IMPORT ER fmDefineEntries( BOOL StartUp );IMPORT ER fmCallMgrTask( FmCmdPkt *pkt, SyscallPattern ptn );IMPORT ER fmForwardMgrTask( RNO rdvno, FmCmdPkt *pkt );IMPORT ER fmcCallFsTask( ID port, FmCmdPkt *pkt );IMPORT ER fmForwardFsTask( ID port, RNO rdvno, FmCmdPkt *pkt );/* * Service command between file systems for internal use. * Entry for calling */IMPORT ER fmIGetFileInfo( LINK *lnk, FileName fname, STIME *ctime, FileAccMode *amode );IMPORT ER fmIChangeLinkFileName( LINK *lnk, FileName fname );IMPORT ER fmISetWorkFile( LINK *lnk, PINFO *pinfo );IMPORT ER fmcICloseFile( struct FD *fd );#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -