home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC6.DMS / in.adf / incl.lha / INCLUDE / clib / exec_protos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-29  |  8.5 KB  |  192 lines

  1. #ifndef  CLIB_EXEC_PROTOS_H
  2. #define  CLIB_EXEC_PROTOS_H
  3.  
  4. /*
  5. **    $VER: exec_protos.h 39.15 (1.10.93)
  6. **    Includes Release 40.15
  7. **
  8. **    C prototypes. For use with 32 bit integers only.
  9. **
  10. **    (C) Copyright 1990-1993 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. */
  13.  
  14. #ifndef  EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17. #ifndef  EXEC_TASKS_H
  18. #include <exec/tasks.h>
  19. #endif
  20.  
  21. #ifdef __cplusplus
  22. #define CLIBCPLUSON
  23. #pragma -
  24. #endif
  25.  
  26. /*------ misc ---------------------------------------------------------*/
  27. ULONG Supervisor( unsigned long (*userFunction)() );
  28. /*------ special patchable hooks to internal exec activity ------------*/
  29. /*------ module creation ----------------------------------------------*/
  30. void InitCode( unsigned long startClass, unsigned long version );
  31. void InitStruct( APTR initTable, APTR memory, unsigned long size );
  32. struct Library *MakeLibrary( APTR funcInit, APTR structInit,
  33.     unsigned long (*libInit)(), unsigned long dataSize,
  34.     unsigned long segList );
  35. void MakeFunctions( APTR target, APTR functionArray,
  36.     unsigned long funcDispBase );
  37. struct Resident *FindResident( UBYTE *name );
  38. APTR InitResident( struct Resident *resident, unsigned long segList );
  39. /*------ diagnostics --------------------------------------------------*/
  40. void Alert( unsigned long alertNum );
  41. void Debug( unsigned long flags );
  42. /*------ interrupts ---------------------------------------------------*/
  43. void Disable( void );
  44. void Enable( void );
  45. void Forbid( void );
  46. void Permit( void );
  47. ULONG SetSR( unsigned long newSR, unsigned long mask );
  48. APTR SuperState( void );
  49. void UserState( APTR sysStack );
  50. struct Interrupt *SetIntVector( long intNumber, struct Interrupt *interrupt );
  51. void AddIntServer( long intNumber, struct Interrupt *interrupt );
  52. void RemIntServer( long intNumber, struct Interrupt *interrupt );
  53. void Cause( struct Interrupt *interrupt );
  54. /*------ memory allocation --------------------------------------------*/
  55. APTR Allocate( struct MemHeader *freeList, unsigned long byteSize );
  56. void Deallocate( struct MemHeader *freeList, APTR memoryBlock,
  57.     unsigned long byteSize );
  58. APTR AllocMem( unsigned long byteSize, unsigned long requirements );
  59. APTR AllocAbs( unsigned long byteSize, APTR location );
  60. void FreeMem( APTR memoryBlock, unsigned long byteSize );
  61. ULONG AvailMem( unsigned long requirements );
  62. struct MemList *AllocEntry( struct MemList *entry );
  63. void FreeEntry( struct MemList *entry );
  64. /*------ lists --------------------------------------------------------*/
  65. void Insert( struct List *list, struct Node *node, struct Node *pred );
  66. void AddHead( struct List *list, struct Node *node );
  67. void AddTail( struct List *list, struct Node *node );
  68. void Remove( struct Node *node );
  69. struct Node *RemHead( struct List *list );
  70. struct Node *RemTail( struct List *list );
  71. void Enqueue( struct List *list, struct Node *node );
  72. struct Node *FindName( struct List *list, UBYTE *name );
  73. /*------ tasks --------------------------------------------------------*/
  74. APTR AddTask( struct Task *task, APTR initPC, APTR finalPC );
  75. void RemTask( struct Task *task );
  76. struct Task *FindTask( UBYTE *name );
  77. BYTE SetTaskPri( struct Task *task, long priority );
  78. ULONG SetSignal( unsigned long newSignals, unsigned long signalSet );
  79. ULONG SetExcept( unsigned long newSignals, unsigned long signalSet );
  80. ULONG Wait( unsigned long signalSet );
  81. void Signal( struct Task *task, unsigned long signalSet );
  82. BYTE AllocSignal( long signalNum );
  83. void FreeSignal( long signalNum );
  84. LONG AllocTrap( long trapNum );
  85. void FreeTrap( long trapNum );
  86. /*------ messages -----------------------------------------------------*/
  87. void AddPort( struct MsgPort *port );
  88. void RemPort( struct MsgPort *port );
  89. void PutMsg( struct MsgPort *port, struct Message *message );
  90. struct Message *GetMsg( struct MsgPort *port );
  91. void ReplyMsg( struct Message *message );
  92. struct Message *WaitPort( struct MsgPort *port );
  93. struct MsgPort *FindPort( UBYTE *name );
  94. /*------ libraries ----------------------------------------------------*/
  95. void AddLibrary( struct Library *library );
  96. void RemLibrary( struct Library *library );
  97. struct Library *OldOpenLibrary( UBYTE *libName );
  98. void CloseLibrary( struct Library *library );
  99. APTR SetFunction( struct Library *library, long funcOffset,
  100.     unsigned long (*newFunction)() );
  101. void SumLibrary( struct Library *library );
  102. /*------ devices ------------------------------------------------------*/
  103. void AddDevice( struct Device *device );
  104. void RemDevice( struct Device *device );
  105. BYTE OpenDevice( UBYTE *devName, unsigned long unit,
  106.     struct IORequest *ioRequest, unsigned long flags );
  107. void CloseDevice( struct IORequest *ioRequest );
  108. BYTE DoIO( struct IORequest *ioRequest );
  109. void SendIO( struct IORequest *ioRequest );
  110. struct IORequest *CheckIO( struct IORequest *ioRequest );
  111. BYTE WaitIO( struct IORequest *ioRequest );
  112. void AbortIO( struct IORequest *ioRequest );
  113. /*------ resources ----------------------------------------------------*/
  114. void AddResource( APTR resource );
  115. void RemResource( APTR resource );
  116. APTR OpenResource( UBYTE *resName );
  117. /*------ private diagnostic support -----------------------------------*/
  118. /*------ misc ---------------------------------------------------------*/
  119. APTR RawDoFmt( UBYTE *formatString, APTR dataStream, void (*putChProc)(),
  120.     APTR putChData );
  121. ULONG GetCC( void );
  122. ULONG TypeOfMem( APTR address );
  123. ULONG Procure( struct SignalSemaphore *sigSem,
  124.     struct SemaphoreMessage *bidMsg );
  125. void Vacate( struct SignalSemaphore *sigSem,
  126.     struct SemaphoreMessage *bidMsg );
  127. struct Library *OpenLibrary( UBYTE *libName, unsigned long version );
  128. /*--- functions in V33 or higher (Release 1.2) ---*/
  129. /*------ signal semaphores (note funny registers)----------------------*/
  130. void InitSemaphore( struct SignalSemaphore *sigSem );
  131. void ObtainSemaphore( struct SignalSemaphore *sigSem );
  132. void ReleaseSemaphore( struct SignalSemaphore *sigSem );
  133. ULONG AttemptSemaphore( struct SignalSemaphore *sigSem );
  134. void ObtainSemaphoreList( struct List *sigSem );
  135. void ReleaseSemaphoreList( struct List *sigSem );
  136. struct SignalSemaphore *FindSemaphore( UBYTE *sigSem );
  137. void AddSemaphore( struct SignalSemaphore *sigSem );
  138. void RemSemaphore( struct SignalSemaphore *sigSem );
  139. /*------ kickmem support ----------------------------------------------*/
  140. ULONG SumKickData( void );
  141. /*------ more memory support ------------------------------------------*/
  142. void AddMemList( unsigned long size, unsigned long attributes, long pri,
  143.     APTR base, UBYTE *name );
  144. void CopyMem( APTR source, APTR dest, unsigned long size );
  145. void CopyMemQuick( APTR source, APTR dest, unsigned long size );
  146. /*------ cache --------------------------------------------------------*/
  147. /*--- functions in V36 or higher (Release 2.0) ---*/
  148. void CacheClearU( void );
  149. void CacheClearE( APTR address, unsigned long length, unsigned long caches );
  150. ULONG CacheControl( unsigned long cacheBits, unsigned long cacheMask );
  151. /*------ misc ---------------------------------------------------------*/
  152. APTR CreateIORequest( struct MsgPort *port, unsigned long size );
  153. void DeleteIORequest( APTR iorequest );
  154. struct MsgPort *CreateMsgPort( void );
  155. void DeleteMsgPort( struct MsgPort *port );
  156. void ObtainSemaphoreShared( struct SignalSemaphore *sigSem );
  157. /*------ even more memory support -------------------------------------*/
  158. APTR AllocVec( unsigned long byteSize, unsigned long requirements );
  159. void FreeVec( APTR memoryBlock );
  160. /*------ V39 Pool LVOs...*/
  161. APTR CreatePool( unsigned long requirements, unsigned long puddleSize,
  162.     unsigned long threshSize );
  163. void DeletePool( APTR poolHeader );
  164. APTR AllocPooled( APTR poolHeader, unsigned long memSize );
  165. void FreePooled( APTR poolHeader, APTR memory, unsigned long memSize );
  166. /*------ misc ---------------------------------------------------------*/
  167. ULONG AttemptSemaphoreShared( struct SignalSemaphore *sigSem );
  168. void ColdReboot( void );
  169. void StackSwap( struct StackSwapStruct *newStack );
  170. /*------ task trees ---------------------------------------------------*/
  171. void ChildFree( APTR tid );
  172. void ChildOrphan( APTR tid );
  173. void ChildStatus( APTR tid );
  174. void ChildWait( APTR tid );
  175. /*------ future expansion ---------------------------------------------*/
  176. APTR CachePreDMA( APTR address, ULONG *length, unsigned long flags );
  177. void CachePostDMA( APTR address, ULONG *length, unsigned long flags );
  178. /*------ New, for V39*/
  179. /*--- functions in V39 or higher (Release 3) ---*/
  180. /*------ Low memory handler functions*/
  181. void AddMemHandler( struct Interrupt *memhand );
  182. void RemMemHandler( struct Interrupt *memhand );
  183. /*------ Function to attempt to obtain a Quick Interrupt Vector...*/
  184. ULONG ObtainQuickVector( APTR interruptCode );
  185.  
  186. #ifdef CLIBCPLUSON
  187. #undef CLIBCPLUSON
  188. #pragma +
  189. #endif
  190.  
  191. #endif     /* CLIB_EXEC_PROTOS_H */
  192.