home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / c / cmdsys.zip / DEVHLP.H < prev    next >
C/C++ Source or Header  |  1992-12-08  |  4KB  |  118 lines

  1. /*
  2.  *        devhlp.h            Date=921208
  3.  *
  4.  *        OS/2 Dev Help interface for 'C' device drivers
  5.  */
  6.  
  7. /*=====================================================================*/
  8.  
  9. #ifndef OS2_INCLUDED                                        // has os2.h been included?
  10. #include <os2def.h>
  11. #endif
  12.  
  13. /*=====================================================================*/
  14.  
  15. #define LT_SHORT_TERM    0x0000
  16. #define LT_LONG_TERM        0x0100
  17. #define LT_ANY_MEMORY    0x0000
  18. #define LT_HIGH_MEMORY    0x0200
  19. #define LT_NORMAL            0x0000
  20. #define LT_VERIFY            0x0400
  21.  
  22. #define LW_WAIT            0x0000
  23. #define LW_NOWAIT            0x0001
  24.  
  25. #define UV_RX                0x0000                        // read/executable
  26. #define UV_RW                0x0001                        // read/write
  27. #define UV_FREE            0x0002                        // free the selector
  28. #define UV_RX_IOPL        0x0003                        // read/executable with iopl
  29. #define UV_RW_IOPL        0x0004                        // read/write with iopl
  30. #define UV_RW_IO_TAG        0x0005                        // read/write with iopl with tag
  31.  
  32. #define UV_FORE_VIDEO    0x0000                        // foreground only video selector
  33.  
  34. #define BF_INTERRUPT        0x0000                        // blocking is interruptible
  35. #define BF_NOINTERRUPT    0x0001                        // blocking is not interruptible
  36.  
  37. #define BL_NORMAL            0x0000                        // normal wakeup from Block
  38. #define BL_TIMEOUT        0x0100                        // timeout wakeup
  39. #define BL_ABNORMAL        0x0200                        // abnormal wakeup
  40. #define BL_INTERRUPT        0x0400                        // sleep was interrupted
  41.  
  42. #define INT_NOSHARE        0x0000                        // nonshared interrupt
  43. #define INT_SHARE            0x0001                        // shared interrupt
  44.  
  45. #define AP_HIGH            0x0000                        // allocate above 1M
  46. #define AP_LOW                0x0001                        // allocate below 1M
  47.  
  48. /*=====================================================================*/
  49.  
  50. typedef struct _ATTACH_REC {
  51.     VOID FAR  *realEntry;                                // real mode IDC entry point
  52.     SEL       realDS;                                        // real mode DS
  53.     VOID FAR  *protEntry;                                // protected mode IDC entry point
  54.     SEL       protDS;                                        // protected mode DS
  55.     } ATTACH_REC;
  56.  
  57. typedef struct _MESSAGE_REC {
  58.     USHORT  idMsg;
  59.     USHORT  numMsg;
  60.     CHAR    message[1];
  61.     } MESSAGE_REC;
  62.  
  63. typedef struct _STACK_REC {
  64.     USHORT  length;
  65.     USHORT  flags;
  66.     USHORT  level;
  67.     USHORT  stackCLI;
  68.     USHORT  stackSTI;
  69.     USHORT  stackEOI;
  70.     USHORT  nest;
  71.     } STACK_REC;
  72.  
  73. /*=====================================================================*/
  74.  
  75. VOID    DevHelpInit( VOID FAR *devHlpEntry );
  76. USHORT  AllocGDTSel( SEL FAR *selArray, USHORT num );
  77. USHORT  AllocPhys( ULONG size, USHORT flag, ULONG FAR *address );
  78. USHORT  AttachDD( ATTACH_REC FAR *attachData, CHAR FAR *devName );
  79. USHORT  Block( VOID FAR *reqPacket, ULONG interval, USHORT flag );
  80. USHORT  DisplayMessage( MESSAGE_REC FAR * );
  81. VOID    EOI( USHORT level );
  82. USHORT  FreePhys( ULONG address );
  83. USHORT  GetDOSVar( USHORT type, ULONG *var );
  84. USHORT  InternalError( CHAR FAR *message, USHORT length );
  85. USHORT  Lock( SEL selector, USHORT flag );
  86. USHORT  PhysToGDTSel( ULONG address, USHORT length, SEL selector );
  87. USHORT  PhysToUVirt( ULONG address, USHORT length, USHORT reqType, 
  88.                 USHORT tagType, VOID FAR *vAddr );
  89. USHORT  PhysToVirt( ULONG address, USHORT length, VOID FAR *vAddr );
  90. USHORT  PullReqPacket( VOID *queue, VOID FAR * FAR *reqPacket );
  91. USHORT  PushReqPacket( VOID *queue, VOID FAR *reqPacket );
  92. USHORT  ProtToReal( VOID );
  93. USHORT  RealToProt( VOID );
  94. USHORT  StackUsage( STACK_REC FAR *stackUsage );
  95. USHORT  ResetTimer( VOID (FAR timerFunc)( VOID ));
  96. USHORT  Run( VOID FAR *event );
  97. USHORT  SemClear( HSEM handle );
  98. USHORT  SemHandle( ULONG idSem, USHORT flag, HSEM *handle );
  99. USHORT  SemRequest( HSEM handle, ULONG timeOut );
  100. USHORT  SentEvent( USHORT event, USHORT arg );
  101. USHORT  SetIRQ( VOID (FAR intrFunc)( VOID ), USHORT level, USHORT flag );
  102. USHORT  SetTimer( VOID (FAR timerFunc)( VOID ));
  103. VOID    TCYield( VOID );
  104. USHORT  TickCount( VOID (FAR timerFunc)( VOID ), USHORT count );
  105. VOID    Unlock( ULONG addr );
  106. USHORT  UnSetIRQ( USHORT level );
  107. USHORT  VerifyAccess( VOID FAR *ptr, USHORT num, USHORT type );
  108. USHORT  VirtToPhys( VOID FAR *ptr, ULONG *addr );
  109. VOID    Yield( VOID );
  110.  
  111. VOID    BreakPoint( VOID );
  112. USHORT  SelectorLimit( SEL selector );
  113.  
  114. USHORT  CopyPhysToVirt( VOID FAR *ptr, ULONG physAddr, USHORT length );
  115. USHORT  CopyVirtToPhys( ULONG physAddr, VOID FAR *ptr, USHORT length );
  116. USHORT  CopyPhysToPhys( ULONG destAddr, ULONG srcAddr, USHORT length );
  117.  
  118. /*=====================================================================*/