home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / inc&ad2.0 / includes / exec / tasks.h < prev    next >
C/C++ Source or Header  |  1992-09-01  |  3KB  |  100 lines

  1. #ifndef    EXEC_TASKS_H
  2. #define    EXEC_TASKS_H
  3. /*
  4. **    $Filename: exec/tasks.h $
  5. **    $Release: 2.04 Includes, V37.4 $
  6. **    $Revision: 36.9 $
  7. **    $Date: 91/11/06 $
  8. **
  9. **    Task Control Block, Singals, and Task flags.
  10. **
  11. **    (C) Copyright 1985-1991 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_NODES_H
  16. #include "exec/nodes.h"
  17. #endif /* EXEC_NODES_H */
  18.  
  19. #ifndef EXEC_LISTS_H
  20. #include "exec/lists.h"
  21. #endif /* EXEC_LISTS_H */
  22.  
  23.  
  24. /* Please use Exec functions to modify task structure fields, where available.
  25.  */
  26. struct Task {
  27.     struct  Node tc_Node;
  28.     UBYTE   tc_Flags;
  29.     UBYTE   tc_State;
  30.     BYTE    tc_IDNestCnt;        /* intr disabled nesting*/
  31.     BYTE    tc_TDNestCnt;        /* task disabled nesting*/
  32.     ULONG   tc_SigAlloc;        /* sigs allocated */
  33.     ULONG   tc_SigWait;        /* sigs we are waiting for */
  34.     ULONG   tc_SigRecvd;        /* sigs we have received */
  35.     ULONG   tc_SigExcept;        /* sigs we will take excepts for */
  36.     UWORD   tc_TrapAlloc;        /* traps allocated */
  37.     UWORD   tc_TrapAble;        /* traps enabled */
  38.     APTR    tc_ExceptData;        /* points to except data */
  39.     APTR    tc_ExceptCode;        /* points to except code */
  40.     APTR    tc_TrapData;        /* points to trap code */
  41.     APTR    tc_TrapCode;        /* points to trap data */
  42.     APTR    tc_SPReg;            /* stack pointer        */
  43.     APTR    tc_SPLower;        /* stack lower bound    */
  44.     APTR    tc_SPUpper;        /* stack upper bound + 2*/
  45.     VOID    (*tc_Switch)();        /* task losing CPU      */
  46.     VOID    (*tc_Launch)();        /* task getting CPU  */
  47.     struct  List tc_MemEntry;        /* Allocated memory. Freed by RemTask() */
  48.     APTR    tc_UserData;        /* For use by the task; no restrictions! */
  49. };
  50.  
  51. /*
  52.  * Stack swap structure as passed to StackSwap()
  53.  */
  54. struct    StackSwapStruct {
  55.     APTR    stk_Lower;    /* Lowest byte of stack */
  56.     ULONG    stk_Upper;    /* Upper end of stack (size + Lowest) */
  57.     APTR    stk_Pointer;    /* Stack pointer at switch point */
  58. };
  59.  
  60. /*----- Flag Bits ------------------------------------------*/
  61. #define TB_PROCTIME    0
  62. #define TB_ETASK    3
  63. #define TB_STACKCHK    4
  64. #define TB_EXCEPT    5
  65. #define TB_SWITCH    6
  66. #define TB_LAUNCH    7
  67.  
  68. #define TF_PROCTIME    (1<<0)
  69. #define TF_ETASK    (1<<3)
  70. #define TF_STACKCHK    (1<<4)
  71. #define TF_EXCEPT    (1<<5)
  72. #define TF_SWITCH    (1<<6)
  73. #define TF_LAUNCH    (1<<7)
  74.  
  75. /*----- Task States ----------------------------------------*/
  76. #define TS_INVALID    0
  77. #define TS_ADDED    1
  78. #define TS_RUN        2
  79. #define TS_READY    3
  80. #define TS_WAIT    4
  81. #define TS_EXCEPT    5
  82. #define TS_REMOVED    6
  83.  
  84. /*----- Predefined Signals -------------------------------------*/
  85. #define SIGB_ABORT    0
  86. #define SIGB_CHILD    1
  87. #define SIGB_BLIT    4    /* Note: same as SINGLE */
  88. #define SIGB_SINGLE    4    /* Note: same as BLIT */
  89. #define SIGB_INTUITION    5
  90. #define SIGB_DOS    8
  91.  
  92. #define SIGF_ABORT    (1L<<0)
  93. #define SIGF_CHILD    (1L<<1)
  94. #define SIGF_BLIT    (1L<<4)
  95. #define SIGF_SINGLE    (1L<<4)
  96. #define SIGF_INTUITION    (1L<<5)
  97. #define SIGF_DOS    (1L<<8)
  98.  
  99. #endif    /* EXEC_TASKS_H */
  100.