struct Task


#include <exec/tasks.h>



struct Executable
{
    ULONG  exe_Magic;    /* lower 16 bits should be 0x0107 */
    ULONG  exe_Text;	/* size of text segment */
    ULONG  exe_Data;	/* size of initialized data */
    ULONG  exe_BSS;	/* size of uninitialized data */
    ULONG  exe_Syms;	/* size of symbol table (not used) */
    ULONG  exe_Entry;	/* entry point (not used) */
    ULONG  exe_TRSize;	/* size of text relocation */
    ULONG  exe_DRSize;	/* size of data relocation */
    /* text, data, textreloc, datareloc follows the struct */
};


struct Program
{
    struct Node pm_Node;/* For linking, ln_Name points to the name */
    struct Executable *pm_Exec;
    ULONG  pm_Size;     /* Size of the executable */
    char   pm_Name[2];  /* first two chars of the name */
    /* Name continues here */
};


struct Task
{
    struct Node tc_Node;
    UWORD	tc_State;	/* TS_RUN, TS_READY, TS_WAIT .. */
    UWORD	tc_Slice;	/* Time slice counter */
    ULONG	tc_Elapsed;	/* Total time used by this task */

    ULONG	tc_SigWait;	/* signals we are waiting for */
    ULONG	tc_SigRecvd;	/* signals we have received */
    ULONG	tc_SigAlloc;	/* signals we have allocated */
    UWORD	*tc_Stack;	/* Stack start */
    ULONG	tc_StackSize;	/* Stack size */

    ULONG	tc_SPReg;	/* stack pointer */
    ULONG	tc_Regsave[14];	/* hiding place for registers */
    ULONG	tc_Reg_a0;

    UWORD	tc_IDNestCnt;	/* interrupt disable count */
    UWORD	tc_TDNestCnt;	/* task disable count */

    /* Task-specific exception handler or NULL */
    VOID	(*tc_ExceptCode)(ULONG Data,UWORD *StackFrame);
    ULONG	tc_ExceptData;	/* Data passed to the handler */

    struct MsgPort tc_Port;	/* message queue */
    struct List tc_MemList;     /* For AllocRemember (& FreeRemember) */

    UWORD       tc_UserID;      /* Task owner ID */
    UWORD       tc_GroupID;     /* Task owner Group ID */

    ULONG	tc_UserData;	/* For use by the task; no restrictions! */
};

/*----- Task States ----------------------------------------*/
#define TS_INVALID	0
#define TS_ADDED	1
#define TS_RUN		2
#define TS_READY	3
#define TS_WAIT		4
#define TS_EXCEPT	5
#define TS_REMOVED	6

/*----- Predefined Signals -------------------------------------*/
/* 8 low-order bits are currently pre-allocated by AddTask() */
#define SIGB_ABORT	0
#define SIGB_CHILD	1
#define SIGB_PORT	2
#define SIGB_DELAY	3
#define SIGB_CTRL_C     4
#define SIGB_CTRL_D     5

#define SIGF_ABORT	(1L<<0)
#define SIGF_CHILD	(1L<<1)
#define SIGF_PORT	(1L<<2)
#define SIGF_DELAY	(1L<<3)
#define SIGF_CTRL_C     (1L<<4)
#define SIGF_CTRL_D     (1L<<5)

#endif	/* EXEC_TASKS_H */
Used in: almost everything