📄 device.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. * *---------------------------------------------------------------------- *//* * device.h (extension) * * Device management */#ifndef __EXTENSION_DEVICE_H__#define __EXTENSION_DEVICE_H__#include <basic.h>#include "typedef.h"#include <tk/devmgr.h>#ifdef __cplusplusextern "C" {#endif#define L_DEVNM 8 /* Length of device name *//* * Open mode */#define D_READ 0x0001U /* Read-only open */#define D_WRITE 0x0002U /* Write-only open */#define D_UPDATE 0x0003U /* Open for update */#define D_EXCL 0x0100U /* Specify exclusive mode */#define D_WEXCL 0x0200U /* Specify exclusive write mode *//* * Device management information */typedef struct dev_state { UW attr; /* Device attribute */ UW mode; /* Access mode */ W blksz; /* Physical block size (<=0: Unknown) */ W wprt; /* Decision to write (<=0:Enabled/Unknown,1: Disabled) */} DEV_STATE;/* * Device information */typedef struct { UW attr; /* Device attribute */ W nsub; /* Number of subunits */ TC name[L_DEVNM]; /* Unit name */} DEV_INFO;/* * Suspend request mode */#define D_SUSPEND 0x0001 /* Suspend */#define D_DISSUS 0x0002 /* Prohibit suspending */#define D_ENASUS 0x0003 /* Allow suspending */#define D_CHECK 0x0004 /* Check on count of suspending prohibitions */#define D_EMRGSUS 0x0010 /* Suspend in case of emergency */#define D_FORCE 0x8000 /* Specify forced suspending */#define D_NOTIFY 0x1000 /* Request notification */#define D_NOTSUS 0x0001 /* Notify suspend */#define D_NOTRES 0x0002 /* Notify resume *//* * Definitions for automatic generation of interface library (mkiflib) *//*** DEFINE_IFLIB[INCLUDE FILE]<extension/device.h>[PREFIX]DM***//* * Device management system call *//* [BEGIN SYSCALLS] */IMPORT ER tkse_opn_dev2(TC *dev, W o_mode, W* error);IMPORT ER tkse_cls_dev2(W dd, UINT option, W* error);IMPORT ER tkse_rea_dev2(W dd, W start, B* buf, W size, W* a_size, W* error);IMPORT ER tkse_wri_dev2(W dd, W start, B* buf, W size, W* a_size, W* error);/* RESERVE_NO */IMPORT ER tkse_dev_sts(TC *dev, DEV_STATE *buf);IMPORT ER tkse_get_dev2(TC *dev, W num);IMPORT ER tkse_lst_dev2(DEV_INFO *dev, W ndev);IMPORT ER tkse_sus_dev(UW mode);IMPORT ID tkse_opn_dev( UB *devnm, UINT omode );IMPORT ER tkse_cls_dev( ID dd, UINT option );IMPORT ID tkse_rea_dev( ID dd, INT start, VP buf, INT size, TMO tmout );IMPORT ER tkse_srea_dev( ID dd, INT start, VP buf, INT size, INT *asize );IMPORT ID tkse_wri_dev( ID dd, INT start, VP buf, INT size, TMO tmout );IMPORT ER tkse_swri_dev( ID dd, INT start, VP buf, INT size, INT *asize );IMPORT ID tkse_wai_dev( ID dd, ID reqid, INT *asize, ER *ioer, TMO tmout );IMPORT ID tkse_get_dev( ID devid, UB *devnm );IMPORT ID tkse_ref_dev( UB *devnm, T_RDEV *rdev );IMPORT ID tkse_oref_dev( ID dd, T_RDEV *rdev );IMPORT INT tkse_lst_dev( T_LDEV *ldev, INT start, INT ndev );/* [END SYSCALLS] */#ifdef __cplusplus}#endif#endif /* __EXTENSION_DEVICE_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -