gonzui


Format: Advanced Search

mtkernel_3/device/common/drvif/msdrvif.hbare sourcepermlink (0.00 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    Device Driver for micro T-Kernel for 亮T-Kernel 3.0
    4:  *
    5:  *    Copyright (C) 2020 by Ken Sakamura.
    6:  *    This software is distributed under the T-License 2.2.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by TRON Forum(http://www.tron.org) at 2020/10/21.
   10:  *
   11:  *----------------------------------------------------------------------
   12:  */
   13: 
   14: 
   15: /*
   16:  *      msdrvif.h
   17:  *
   18:  *      mSDI: Simple Device driver I/F layer for micro T-Kernel
   19:  */
   20: 
   21: #ifndef __DEVICE_MSDI_H__
   22: #define __DEVICE_MSDI_H__
   23: 
   24: /*
   25:  * Device registration information
   26:  */
   27: typedef struct S_MSDI   T_MSDI;
   28: 
   29: typedef struct {
   30:         void*  exinf;           /* Extended information (may be optional) */
   31:         UB     devnm[L_DEVNM+1]; /* Physical device name */
   32:         ATR    drvatr;            /* Driver attributes */
   33:         ATR    devatr;            /* Device attributes */
   34:         INT    nsub;              /* Number of subunits */
   35:         INT    blksz;             /* Unique data block size (-1 = unknown) */
   36: 
   37:         ER  (*openfn)( ID devid, UINT omode, T_MSDI* );
   38:         ER  (*closefn)( ID devid, UINT option, T_MSDI* );
   39:         INT (*readfn)( T_DEVREQ *req, T_MSDI *p_msdi );
   40:         INT (*writefn)( T_DEVREQ *req, T_MSDI *p_msdi );
   41:         INT (*eventfn)( INT evttyp, void *evtinf, T_MSDI* );
   42: } T_DMSDI;
   43: 
   44: struct S_MSDI {
   45:         ID             devid;     /* Device ID*/
   46:         FastLock       lock; /* Lock for exclusive access control */
   47:         T_DMSDI                dmsdi;        /* Device registration information */
   48: };
   49: 
   50: 
   51: /*
   52:  * Device registration & Delete
   53:  * 
   54:  */
   55: IMPORT ER msdi_def_dev( T_DMSDI *ddev, T_IDEV *idev, T_MSDI** );        /* Register */
   56: IMPORT ER msdi_del_dev( T_MSDI* );                                      /* Delete */
   57: 
   58: #endif /* __DEVICE_MSDI_H__ */