home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / at-inc-bin.lha / os-include / exec / tasks.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  3KB  |  100 lines

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