假定某个设备只通过一个IO寄存器实现读端口和写端口(无中断管理),如果设计成VxWorks操作系统的命名设备IO驱动,谁帮忙写出其设备对象的数据结构的核心内容?
------解决方案--------------------------------------------------------
/* device struct information*/
typedef struct OMMDev {
DEV_HDR devHdr;
int openCount;
int maxBoardNum;
int boardNum;
int baseAddr;
SEM_ID muteSem; /* mutex semphore */
SEM_ID syncSem; /* a sync semphore for our dual drvier buffer */
int intLevel; /* interrupt level(IRQ) */
int intCount; /* interrupt count */
BOOL created; /* TRUE if this device has been created */
SEL_WAKEUP_LIST selWakeupList; /* select wakeup list */
BOOL DrvDataAvailable;
}OMM_DEV;