📄 drv_intf.h
字号:
/***********************************************************************//* *//* MODULE: drv_intf.h 1.3 *//* DATE: 17:58:22 - 97/12/05 *//* PURPOSE: Definitions for application/driver interface *//* *//*---------------------------------------------------------------------*//* *//* Copyright 1991 - 1995 Integrated Systems, Inc. *//* ALL RIGHTS RESERVED *//* *//* Permission is hereby granted to licensees of Integrated Systems, *//* Inc. products to use or abstract this computer program for the *//* sole purpose of implementing a product based on Integrated *//* Systems, Inc. products. No other rights to reproduce, use, *//* or disseminate this computer program, whether in part or in *//* whole, are granted. *//* *//* Integrated Systems, Inc. makes no representation or warranties *//* with respect to the performance of this computer program, and *//* specifically disclaims any responsibility for any damages, *//* special or consequential, connected with the use of this program. *//* *//*---------------------------------------------------------------------*//* *//* This file defines the structures and constants required by the *//* the de_cntrl() functions of many of pSOSystem's drivers. It *//* also defines the error codes for many of pSOSystem's drivers. *//* *//* The origin of error codes returned to pSOSystem applications *//* may be determined from the following table (error code values *//* are in hex, with the apostrophe inserted for readability). *//* *//* ERROR CODE RANGE ORIGIN DEFINED IN *//* ===================== ================== ============== *//* 0000'0001 - 0000'0FFF pSOS+, pSOS+m <psos.h> *//* 0000'1000 - 0000'1FFF (reserved) *//* 0000'2000 - 0000'2FFF pHILE+ <phile.h> *//* 0000'3000 - 0000'3FFF pREPC+ <errno.h> *//* 0000'4000 - 0000'4FFF (reserved) *//* 0000'5000 - 0000'5FFF pNA+, pRPC+, pX11+ <pna.h> *//* 0000'6000 - 0000'FFFF (reserved) *//* * 0001'0000 - 0FFF'FFFF >> User-added drivers << *//* 1000'0000 - 1000'FFFF (reserved) *//* 1001'0000 - 1001'FFFF serial driver <drv_intf.h> *//* 1002'0000 - 1002'FFFF tick timer driver <drv_intf.h> *//* 1003'0000 - 1003'FFFF (reserved) *//* 1004'0000 - 1004'FFFF RAM disk driver <drv_intf.h> *//* 1005'0000 - 1005'FFFF (reserved) *//* 1006'0000 - 1006'FFFF TFTP driver <drv_intf.h> *//* 1007'0000 - 1007'FFFF SLIP driver *//* 1008'0000 - 1008'FFFF MMUlib *//* 1009'0000 - 1009'FFFF IDE driver *//* 100A'0000 - 100A'FFFF FLOPPY driver *//* 100B'0000 - 104F'FFFF (reserved) *//* 1050'0000 - 105F'FFFF SCSI driver <drv_intf.h> *//* 1060'0000 - BFFF'FFFF (reserved) *//* C000'0000 - C000'FFFF Shared mem KI, NI drivers/ki_smem.c,*//* drivers/ni_smem.c *//* C001'0000 - FFFF'FFFF (reserved) *//* *//* * NOTE: Error codes in the range 0001'0000 through 0FFF'FFFF *//* are reserved for user-added drivers. Any custom drivers *//* you add to pSOSystem should return error codes in *//* this range. Other ranges marked "(reserved)" are *//* reserved for use by future additions to pSOSystem and *//* should not be used by custom drivers. *//* *//***********************************************************************/#if defined(__cplusplus)extern "C" {#endif/*---------------------------------------------------------------------*//* Don't allow this file to be included more than once. *//*---------------------------------------------------------------------*/#ifndef _DRV_INTF_H#define _DRV_INTF_H/*---------------------------------------------------------------------*//* DRV_INIT_REG The driver initialization register of the IDLE task. *//* It is used by device drivers as a initialization done flag. This *//* register is cleared to 0 when the IDLE task is created. *//* Each device will use it major device number as the bit number it *//* sets when the device initialization is done. *//*---------------------------------------------------------------------*/#define DRV_INIT_REG 8/*---------------------------------------------------------------------*//* CNSL_INIT_REG The driver initialization register of the IDLE task. *//* It is used by Console drivers as a initialization done flag. This *//* register is cleared to 0 when the IDLE task is created. *//* Each Minor Device number will be used as the bit number. *//*---------------------------------------------------------------------*/#define CNSL_INIT_REG 10/*---------------------------------------------------------------------*//* SERV_INIT_REG The Service initialization register of the IDLE task. *//* This register is used by services as an initialization done flag. *//* This register is cleared to 0 when the IDLE task is created. *//* Each service will use a defined bit number that is defined below *//* in this file as the bit to set in this register when the service *//* is done with it initialization. *//*---------------------------------------------------------------------*/#define SERV_INIT_REG 9#define SMKI_INIT_BIT 0#define SMNI_INIT_BIT 1#define LAN_INIT_BIT 2/*---------------------------------------------------------------------*//* DMAJOR returns the major number of a device from the *//* ioparms->in_dev variable. *//*---------------------------------------------------------------------*/#define DMAJOR(x) ((x & 0xFFFF0000) >> 16) /*---------------------------------------------------------------------*//* DMINOR returns the minor device number of a device from the *//* ioparms->in_dev variable. *//*---------------------------------------------------------------------*/#define DMINOR(x) (x & 0x0000FFFF)/*---------------------------------------------------------------------*//* IDLE_TID The IDLE task tid is used by drivers and services to get *//* the IDLE task system note pad registers. *//*---------------------------------------------------------------------*/#define IDLE_TID 0x00010000/*---------------------------------------------------------------------*//* Functions used to manipulate Scratch pad Registers *//*---------------------------------------------------------------------*/unsigned long ScratchPadTest(unsigned long tid, unsigned long register_number, unsigned long bit);unsigned long ScratchPadSet(unsigned long tid, unsigned long register_number, unsigned long bit);unsigned long ScratchPadUnSet(unsigned long tid, unsigned long register_number, unsigned long bit);/*---------------------------------------------------------------------*//* Error codes returned by Scratch Pad functions *//*---------------------------------------------------------------------*/#define SP_OK 0#define SP_BIT_NOT_SET 0#define SP_BIT_SET 1#define SP_BITNUM 3/*---------------------------------------------------------------------*//* Errors which may be returned by the serial driver *//*---------------------------------------------------------------------*/#define CNSL_HDWR 0x10010100 /* Hardware error */#define CNSL_MINOR 0x10010201 /* Invalid minor device # */#define CNSL_CTRL 0x10010202 /* Invalid function code for Cnsl_Ctrl()*/#define CNSL_BAUD 0x10010203 /* Invalid baud rate for Cnsl_cntrl() */#define CNSL_NINIT 0x10010204 /* Device not initialized */#define CNSL_DATA 0x10010205 /* Unable to allocate driver data area */#define CNSL_SEM 0x10010206 /* Semaphore error */#define CNSL_OSYNC 0x10010207 /* Out of sync */#define CNSL_OPER 0x10010208 /* Operation failed */#define CNSL_PARAM 0x10010209 /* Invalid parameter */#define CNSL_AINIT 0x10010210 /* Console already initialized *//*---------------------------------------------------------------------*//* Error from tick timer *//*---------------------------------------------------------------------*/#define TIMR_TICKRATE 0x10020001 /* Unsupported rate for kc_ticks2sec *//*---------------------------------------------------------------------*//* Errors which may be returned by the RAM disk driver *//*---------------------------------------------------------------------*/#define RDSK_BLOCK 0x10040001 /* Block number too large */#define RDSK_SEM 0x10040002 /* Semaphore error */#define RDSK_MEM 0x10040003 /* Memory error *//*---------------------------------------------------------------------*//* Errors which may be returned by the SCSI driver. *//*---------------------------------------------------------------------*/#define SCSI_ERR 0x10510000 /* SCSI general error code ored */ /* with actual scsi error code */ /* see scsi.h "Values returned */ /* by scsi commands" for more */ /* information */#define SCSI_FSC 0x10500003 /* Failed to send SCSI command */#define SCSI_CHP 0x10500009 /* Failed to init SCSI chip */#define SCSI_UKC 0x1050000B /* Unknown de_ctnrl() function */#define SCSI_ID_ERR 0x1050000C /* Bad SCSI ID de_ctnrl() */#define SCSI_NULL_CDB 0x1050000D /* NULL SCSI Control block */#define SCSI_PTR_CONFLICT 0x1050000E /* Both in and out data */ /* length given */#define SCSI_DATA_PTR_NULL 0x1050000F /* NULL data pointer */#define SCSI_NOT_INIT 0x10500010 /* SCSI not initialized */#define SCSI_ILLRECON 0x10500011 /* bad reconnection */ /* (no disconnect) */#define ESDNOTTDIR 0x10500012 /* incorrect device type for */ /* operation*/#define ESDNODEVICE 0x10500013 /* no such device on SCSI bus */#define ESBLOCKOUTOFRANGE 0x10500014 /* block given is beyond end */ /* of disk */#define ESODDBLOCK 0x10500015 /* Block size is less than */ /* physical */#define ESNO_CAPACITY 0x10500016 /* capacity shows 0 maybe */ /* floppy not in drive? */#define SCSI_FORMAT_FAILED 0x10500017#define SCSI_PART_NUM_BAD 0x10500018 /* Bad partition number */#define SCSI_NOT_PARTITION 0x10500019 /* device not partitioned */#define SCSI_W_PROTECTED 0x1050001A /* write protected */#define SCSI_NO_MEM 0x1050001B /* need memory to complete */ /* command not available */#define SCSI_NOT_OPEN 0x1050001C /* SCSI device not open */#define ESDALLREADYOPEN 0x1050001D /* SCSI device is already open */#define SCSI_END_OF_FILE 0x1050001E /* end of tape file encountered *//*---------------------------------------------------------------------*//* TFTP Driver generated Errors *//*---------------------------------------------------------------------*/#define TFTP_PROTO 0x10060001#define TFTP_TMOUT 0x10060002#define TFTP_SYNC 0x10060003#define TFTP_NOSPC 0x10060004#define TFTP_INVAL 0x10060005#define TFTP_NOINIT 0x10060006/*---------------------------------------------------------------------*//* Errors which may be returned by the IDE driver *//*---------------------------------------------------------------------*/#define IDE_HDWR 0x10090001 /* Hardware error */#define IDE_MINOR 0x10090002 /* Invalid minor device # */#define IDE_CTRL 0x10090003 /* Invalid function code for IDE_Ctrl() */#define IDE_NINIT 0x10090004 /* Device not initialized */#define IDE_DATA 0x10090005 /* Unable to allocate driver data area */#define IDE_SEM 0x10090006 /* Semaphore error */#define IDE_BBLK 0x10090007 /* Bad Block */#define IDE_UCOR 0x10090008 /* Uncorrectable Error */#define IDE_SNF 0x10090009 /* Sector Not Found */#define IDE_T0NF 0x1009000a /* Track 0 Not Found */#define IDE_NDAM 0x1009000b /* Data Address Mark Not Found */#define IDE_RANGE 0x1009000c /* Block range error */#define IDE_DRV 0x1009F000 /* Drive related error in the last byte *//*---------------------------------------------------------------------*//* Errors which may be returned by the FLP driver *//*---------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -