1 #ifndef  CLIB_POSEIDON_PROTOS_H
    2 #define  CLIB_POSEIDON_PROTOS_H
    3 
    4 /*
    5 **	$Id: poseidon_protos.h,v 1.13 2008/09/15 21:36:25 piru Exp $
    6 **
    7 **	C prototypes. For use with 32 bit integers only.
    8 **
    9 **	Copyright © 2008 Chris Hodges
   10 **	    All Rights Reserved
   11 */
   12 
   13 #ifndef  EXEC_TYPES_H
   14 #include <exec/types.h>
   15 #endif
   16 #ifndef  EXEC_LISTS_H
   17 #include <exec/lists.h>
   18 #endif
   19 #ifndef  EXEC_INTERRUPTS_H
   20 #include <exec/interrupts.h>
   21 #endif
   22 #ifndef  EXEC_SEMAPHORES_H
   23 #include <exec/semaphores.h>
   24 #endif
   25 #ifndef  EXEC_DEVICES_H
   26 #include <exec/devices.h>
   27 #endif
   28 #ifndef  EXEC_IO_H
   29 #include <exec/io.h>
   30 #endif
   31 #ifndef  EXEC_PORTS_H
   32 #include <exec/ports.h>
   33 #endif
   34 #ifndef  UTILITY_UTILITY_H
   35 #include <utility/utility.h>
   36 #endif
   37 #ifndef  DEVICES_TIMER_H
   38 #include <devices/timer.h>
   39 #endif
   40 #ifndef  LIBRARIES_POSEIDON_H
   41 #include <libraries/poseidon.h>
   42 #endif
   43 
   44 #ifdef __cplusplus
   45 extern "C" {
   46 #endif /* __cplusplus */
   47 
   48 APTR psdAllocVec( ULONG size );
   49 VOID psdFreeVec( APTR memptr );
   50 VOID psdLockWritePBase( VOID );
   51 VOID psdLockReadPBase( VOID );
   52 VOID psdUnlockPBase( VOID );
   53 STRPTR psdCopyStr( STRPTR name );
   54 VOID psdDelayMS( ULONG milli );
   55 APTR psdAddHardware( STRPTR name, ULONG unit );
   56 VOID psdRemHardware( APTR phw );
   57 APTR psdEnumerateHardware( APTR phw );
   58 APTR psdAllocDevice( APTR phw );
   59 VOID psdFreeDevice( APTR pd );
   60 VOID psdLockReadDevice( APTR pd );
   61 VOID psdLockWriteDevice( APTR pd );
   62 VOID psdUnlockDevice( APTR pd );
   63 APTR psdEnumerateDevice( APTR pp );
   64 APTR psdGetNextDevice( APTR pd );
   65 LONG psdGetAttrsA( ULONG type, APTR psdstruct, struct TagItem *taglist );
   66 LONG psdGetAttrs( ULONG type, APTR psdstruct, ULONG tag1, ... );
   67 LONG psdSetAttrsA( ULONG type, APTR psdstruct, struct TagItem *taglist );
   68 LONG psdSetAttrs( ULONG type, APTR psdstruct, ULONG tag1, ... );
   69 APTR psdAllocPipe( APTR pd, struct MsgPort *mp, APTR pep );
   70 APTR psdFreePipe( APTR pp );
   71 VOID psdPipeSetup( APTR pp, ULONG rt, ULONG rq, ULONG val, ULONG idx );
   72 LONG psdDoPipe( APTR pp, APTR data, ULONG len );
   73 VOID psdSendPipe( APTR pp, APTR data, ULONG len );
   74 VOID psdAbortPipe( APTR pp );
   75 LONG psdWaitPipe( APTR pp );
   76 ULONG psdGetPipeActual( APTR pp );
   77 LONG psdGetPipeError( APTR pp );
   78 STRPTR psdGetStringDescriptor( APTR pp, ULONG idx );
   79 BOOL psdSetDeviceConfig( APTR pp, ULONG cfgnum );
   80 APTR psdAddClass( STRPTR name, ULONG version );
   81 VOID psdRemClass( APTR puc );
   82 VOID psdClassScan( VOID );
   83 STRPTR psdNumToStr( ULONG type, LONG idx, STRPTR defstr );
   84 struct Task *psdSpawnSubTask( STRPTR name, APTR initpc, APTR userdata );
   85 APTR psdAddErrorMsgA( ULONG level, STRPTR origin, STRPTR fmtstr, APTR fmtdata );
   86 APTR psdAddErrorMsg( ULONG level, STRPTR origin, STRPTR fmtstr, ... );
   87 VOID psdRemErrorMsg( APTR pem );
   88 VOID psdSafeRawDoFmtA( STRPTR buf, ULONG len, STRPTR fmtstr, APTR fmtdata );
   89 VOID psdSafeRawDoFmt( STRPTR buf, ULONG len, STRPTR fmtstr, ... );
   90 BOOL psdSetAltInterface( APTR pp, APTR pif );
   91 APTR psdFindDeviceA( APTR pd, struct TagItem *taglist );
   92 APTR psdFindDevice( APTR pd, ... );
   93 APTR psdClaimAppBindingA( struct TagItem *taglist );
   94 APTR psdClaimAppBinding( ULONG tag1, ... );
   95 APTR psdReleaseAppBinding( APTR pab );
   96 APTR psdAddEventHandler( struct MsgPort *mp, ULONG msgmask );
   97 VOID psdRemEventHandler( APTR peh );
   98 VOID psdSendEvent( ULONG ehmt, APTR param1, APTR param2 );
   99 VOID psdReleaseDevBinding( APTR pd );
  100 VOID psdReleaseIfBinding( APTR pif );
  101 BOOL psdReadCfg( APTR pic, APTR formdata );
  102 APTR psdWriteCfg( APTR pic );
  103 APTR psdFindCfgForm( APTR pic, ULONG formid );
  104 APTR psdNextCfgForm( APTR pic );
  105 BOOL psdRemCfgForm( APTR pic );
  106 APTR psdAddCfgEntry( APTR pic, APTR formdata );
  107 BOOL psdRemCfgChunk( APTR pic, ULONG chnkid );
  108 APTR psdGetCfgChunk( APTR pic, ULONG chnkid );
  109 VOID psdParseCfg( VOID );
  110 VOID psdUnbindAll( VOID );
  111 BOOL psdSetClsCfg( STRPTR owner, APTR form );
  112 APTR psdGetClsCfg( STRPTR owner );
  113 BOOL psdSetUsbDevCfg( STRPTR owner, STRPTR devid, STRPTR ifid, APTR form );
  114 APTR psdGetUsbDevCfg( STRPTR owner, STRPTR devid, STRPTR ifid );
  115 APTR psdFindInterfaceA( APTR pd, APTR pif, struct TagItem *taglist );
  116 APTR psdFindInterface( APTR pd, APTR pif, ... );
  117 APTR psdFindEndpointA( APTR pif, APTR pep, struct TagItem *taglist );
  118 APTR psdFindEndpoint( APTR pif, APTR pep, ... );
  119 STRPTR psdCopyStrFmtA( STRPTR fmtstr, APTR fmtdata );
  120 STRPTR psdCopyStrFmt( STRPTR fmtstr, ... );
  121 BOOL psdSetForcedBinding( STRPTR owner, STRPTR devid, STRPTR ifid );
  122 STRPTR psdGetForcedBinding( STRPTR devid, STRPTR ifid );
  123 APTR psdCheckPipe( APTR pp );
  124 APTR psdOpenStreamA( APTR pep, struct TagItem *taglist );
  125 APTR psdOpenStream( APTR pep, ... );
  126 VOID psdCloseStream( APTR pps );
  127 LONG psdStreamRead( APTR pps, APTR buffer, LONG length );
  128 LONG psdStreamWrite( APTR pps, APTR buffer, LONG length );
  129 LONG psdStreamFlush( APTR pps );
  130 LONG psdGetStreamError( APTR pps );
  131 VOID psdCalculatePower( APTR phw );
  132 BOOL psdLoadCfgFromDisk( STRPTR filename );
  133 BOOL psdSaveCfgToDisk( STRPTR filename, LONG mode );
  134 VOID psdDebugSemaphores( VOID );
  135 VOID psdHubClassScan( APTR pd );
  136 APTR psdHubClaimAppBindingA( struct TagItem *taglist );
  137 VOID psdHubReleaseDevBinding( APTR pd );
  138 VOID psdHubReleaseIfBinding( APTR pif );
  139 APTR psdAllocCfgForm( ULONG formid );
  140 BOOL psdAddStringChunk( APTR pic, ULONG chunkid, STRPTR contents );
  141 BOOL psdMatchStringChunk( APTR pic, ULONG chunkid, STRPTR contents );
  142 STRPTR psdGetStringChunk( APTR pic, ULONG chunkid );
  143 STRPTR psdOnlineReport( APTR formdata );
  144 APTR psdFindDescriptorA( APTR pd, APTR pdd, struct TagItem *taglist );
  145 APTR psdFindDescriptor( APTR pd, APTR pdd, ... );
  146 APTR psdDoHubMethodA( APTR pd, ULONG methodid, APTR methoddata );
  147 APTR psdDoHubMethod( APTR pd, ULONG methodid, ... );
  148 APTR psdAllocRTIsoHandlerA( APTR pep, struct TagItem *taglist );
  149 APTR psdAllocRTIsoHandler( APTR pep, ... );
  150 VOID psdFreeRTIsoHandler( APTR prt );
  151 LONG psdStartRTIso( APTR prt );
  152 LONG psdStopRTIso( APTR prt );
  153 ULONG psdBorrowLocksWait( struct Task *task, ULONG signals );
  154 
  155 #ifdef __cplusplus
  156 }
  157 #endif /* __cplusplus */
  158 
  159 #endif   /* CLIB_POSEIDON_PROTOS_H */