home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / Guide.lzx / Guide / pExec / Device.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-11  |  6.9 KB  |  192 lines

  1. @DATABASE "pExec/Device.h"
  2. @MASTER   "Work2:AD/IInc/pExec/Device.h"
  3. @REMARK   This file was created by ADtoHT 2.0 on 11-Mär-97  13:34:23
  4. @REMARK   Do not edit
  5. @REMARK   ADtoHT is © 1993-1995 Christian Stieber
  6.  
  7. @NODE MAIN "pExec/Device.h"
  8. @TOC "__pOS_Dev.guide/MAIN"
  9.  
  10. @{"pExec/Device.h" LINK File}
  11.  
  12.  
  13. @{b}Structures@{ub}
  14.  
  15. @{"pOS_Device" LINK "pExec/Device.h/File" 21}  @{"pOS_IORequest" LINK "pExec/Device.h/File" 53}  @{"pOS_IOStdReq" LINK "pExec/Device.h/File" 66}  @{"pOS_StdDeviceFunction" LINK "pExec/Device.h/File" 138}
  16. @{"pOS_Unit" LINK "pExec/Device.h/File" 29}    
  17.  
  18.  
  19. @{b}#defines@{ub}
  20.  
  21. @{"_pOS_GetDeviceFunction()" LINK "pExec/Device.h/File" 161}  @{"_pOS_GetStdDeviceFunction()" LINK "pExec/Device.h/File" 158}
  22.  
  23. @ENDNODE
  24. @NODE File "pExec/Device.h"
  25. #ifndef __INC_POS_PEXEC_DEVICE_H
  26. #define __INC_POS_PEXEC_DEVICE_H
  27. /*******************************************************************
  28.  Includes Release 24
  29.  (C) Copyright 1995-1997 proDAD
  30.      All Rights Reserved
  31.  
  32.  $AUT Holger Burkarth
  33.  $DAT >>Device.h<<   09 Nov 1996    19:07:27 - (C) ProDAD
  34. *******************************************************************/
  35. #ifndef __INC_POS_PEXEC_LIBRARY_H
  36. #include <@{"pExec/Library.h" LINK "pExec/Library.h/File"}>
  37. #endif
  38. #ifndef __INC_POS_PEXEC_MSGPORT_H
  39. #include <@{"pExec/MsgPort.h" LINK "pExec/MsgPort.h/File"}>
  40. #endif
  41.  
  42.  
  43. /*----------------------------------
  44. -----------------------------------*/
  45. struct pOS_Device
  46. {
  47.   @{"struct pOS_Library" LINK "pExec/Library.h/File" 26} dd_Library;
  48. };
  49.  
  50.  
  51. /*----------------------------------
  52. -----------------------------------*/
  53. struct pOS_Unit
  54. {
  55.   @{"struct pOS_MsgPort" LINK "pExec/MsgPort.h/File" 18} unit_MsgPort; /* queue for unprocessed messages */
  56.                             /* instance of msgport is recommended */
  57.   @{"UBYTE" LINK "pExec/Types.h/File" 95}   unit_Flags;
  58.   @{"UBYTE" LINK "pExec/Types.h/File" 95}   unit_Num;         /* kann vom Device für eigene Zwecke verwendet werden */
  59.   @{"UWORD" LINK "pExec/Types.h/File" 93}   unit_OpenCnt;     /* number of active opens */
  60. };
  61.  
  62.  
  63. enum pOS_UnitFlags
  64. {
  65.   UNITF_Active  =0x01, /* BeginIO-Task is working */
  66.   UNITF_InTask  =0x02, /* Unit-Task is working */
  67.   UNITF_Quit    =0x04, /* quit Unit-Task */
  68.   UNITF_Stopped =0x08, /* Unit-Task is CMD_STOP */
  69.   UNITF_NeedSig =0x10, /* Unit-Task need WackUp-Signal */
  70. };
  71.  
  72.  
  73.  
  74.  
  75. /*----------------------------------
  76. -----------------------------------*/
  77. struct pOS_IORequest
  78. {
  79.   @{"struct pOS_Message" LINK "pExec/MsgPort.h/File" 41}  io_Message;
  80.   @{"struct pOS_Device" LINK File 21}  *io_Device;   /* device node pointer  */
  81.   @{"struct pOS_Unit" LINK File 29}    *io_Unit;     /* unit (driver private) */
  82.   @{"UWORD" LINK "pExec/Types.h/File" 93}               io_Command;   /* (enum pOS_IOReqCommands) */
  83.   @{"UBYTE" LINK "pExec/Types.h/File" 95}               io_Flags;     /* (enum pOS_IOReqFlags) */
  84.   @{"SBYTE" LINK "pExec/Types.h/File" 94}               io_Error;     /* (enum pOS_IOReqErrors) */
  85. };
  86.  
  87.  
  88. /*----------------------------------
  89. -----------------------------------*/
  90. struct pOS_IOStdReq
  91. {
  92.   @{"struct pOS_Message" LINK "pExec/MsgPort.h/File" 41}  io_Message;
  93.   @{"struct pOS_Device" LINK File 21}  *io_Device;   /* device node pointer  */
  94.   @{"struct pOS_Unit" LINK File 29}    *io_Unit;     /* unit (driver private)*/
  95.   @{"UWORD" LINK "pExec/Types.h/File" 93}               io_Command;   /* (enum pOS_IOReqCommands) */
  96.   @{"UBYTE" LINK "pExec/Types.h/File" 95}               io_Flags;     /* (enum pOS_IOReqFlags) */
  97.   @{"SBYTE" LINK "pExec/Types.h/File" 94}               io_Error;     /* (enum pOS_IOReqErrors) */
  98.   @{"ULONG" LINK "pExec/Types.h/File" 91}               io_Actual;    /* actual number of bytes transferred */
  99.   @{"ULONG" LINK "pExec/Types.h/File" 91}               io_Length;    /* requested number bytes transferred */
  100.   @{"APTR" LINK "pExec/Types.h/File" 87}                io_Data;      /* points to data area */
  101.   @{"ULONG" LINK "pExec/Types.h/File" 91}               io_Offset;    /* offset for block structured devices */
  102.   @{"ULONG" LINK "pExec/Types.h/File" 91}               io_OPad;
  103.   @{"UBYTE" LINK "pExec/Types.h/File" 95}               io_Pad[8];
  104. };
  105.  
  106.  
  107.  
  108.  
  109.  
  110. enum pOS_IOReqFlags
  111. {
  112.   IOREQB_Quick   = 0,
  113.  
  114.   IOREQF_Quick   = 0x01,
  115.   IOREQF_IntSig  = 0x02, /* für Device-eigene interne Zwecke */
  116.  
  117.   IOREQF_Pending = 0x80,
  118. };
  119.  
  120.  
  121. enum pOS_IOReqErrors
  122. {
  123.   IOERR_None       = 0,
  124.   IOERR_OpenFail   =-1, /* device/unit failed to open */
  125.   IOERR_Aborted    =-2, /* request terminated early [after AbortIO()] */
  126.   IOERR_NoCMD      =-3, /* command not supported by device */
  127.   IOERR_BadLength  =-4, /* not a valid length (usually IO_LENGTH) */
  128.   IOERR_BadAddress =-5, /* invalid address (misaligned or bad range) */
  129.   IOERR_UnitBusy   =-6, /* device opens ok, but requested unit is busy */
  130.   IOERR_Selftest   =-7, /* hardware failed self-test */
  131.   IOERR_NoMem      =-8, /* not enough memory */
  132.   IOERR_NoSubCMD   =-9  /* sub-command not supported by device */
  133. };
  134.  
  135.  
  136. enum pOS_IOReqCommands
  137. {
  138.   CMD_INVALID   = 0,
  139.   CMD_RESET     = 1,
  140.   CMD_READ      = 2,
  141.   CMD_WRITE     = 3,
  142.   CMD_UPDATE    = 4,
  143.   CMD_CLEAR     = 5,
  144.   CMD_STOP      = 6,
  145.   CMD_START     = 7,
  146.   CMD_FLUSH     = 8,
  147.  
  148.   CMD_NONSTD    = 9,
  149. };
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158. /*----------------------------------
  159.  Rückwärtsgerichtete Struktur, DevBase
  160.  steht auf das Ende der Struct.
  161. -----------------------------------*/
  162. struct pOS_StdDeviceFunction
  163. {
  164.   @{"struct pOS_LibraryFunction" LINK "pExec/Library.h/File" 17} Reserved2[8];
  165.  
  166.   @{"VOID" LINK "pExec/Types.h/File" 83}  (*AbortIO_func)(@{"_R_LB" LINK "pExec/Types.h/File" 35} @{"struct pOS_Device" LINK File 21}*,_R_A0 struct pOS_IORequest*);
  167.   @{"UBYTE" LINK "pExec/Types.h/File" 95} _d5[8];
  168.   @{"VOID" LINK "pExec/Types.h/File" 83}  (*BeginIO_func)(@{"_R_LB" LINK "pExec/Types.h/File" 35} @{"struct pOS_Device" LINK File 21}*,_R_A0 struct pOS_IORequest*);
  169.   @{"UBYTE" LINK "pExec/Types.h/File" 95} _d4[8];
  170.  
  171.   @{"struct pOS_LibraryFunction" LINK "pExec/Library.h/File" 17} Reserved1[8];
  172.  
  173.   @{"struct pOS_SegmentLst" LINK "pDOS/Segment.h/File" 32}* (*Expunge_func)(@{"_R_LB" LINK "pExec/Types.h/File" 35} @{"struct pOS_Device" LINK File 21}*);
  174.   @{"UBYTE" LINK "pExec/Types.h/File" 95} _d3[8];
  175.   @{"VOID" LINK "pExec/Types.h/File" 83}  (*Close_func)(@{"_R_LB" LINK "pExec/Types.h/File" 35} @{"struct pOS_Device" LINK File 21}*,_R_A0 struct pOS_IORequest*);
  176.   @{"UBYTE" LINK "pExec/Types.h/File" 95} _d2[8];
  177.   @{"BOOL" LINK "pExec/Types.h/File" 99}  (*Open_func)(@{"_R_LB" LINK "pExec/Types.h/File" 35} @{"struct pOS_Device" LINK File 21}*,_R_A0 struct pOS_IORequest*,_R_D0 ULONG unitNr,_R_D1 ULONG flags);
  178.   @{"UBYTE" LINK "pExec/Types.h/File" 95} _d1[8];
  179. }; /* => DeviceBase */
  180.  
  181.  
  182. #define _pOS_GetStdDeviceFunction(dev) \\
  183.  ( (@{"struct pOS_StdDeviceFunction" LINK File 138}*)((@{"ULONG" LINK "pExec/Types.h/File" 91})(dev) - sizeof(@{"struct pOS_StdDeviceFunction" LINK File 138})) )
  184.  
  185. #define _pOS_GetDeviceFunction(dev,index) \\
  186.  ( (@{"struct pOS_LibraryFunction" LINK "pExec/Library.h/File" 17}*)((@{"ULONG" LINK "pExec/Types.h/File" 91})(dev) - (index)*sizeof(@{"struct pOS_LibraryFunction" LINK "pExec/Library.h/File" 17})) )
  187.  
  188.  
  189.  
  190. #endif
  191. @ENDNODE
  192.