Minor fixes to comments.
[AROS.git] / rom / exec / etask.h
blob710eb183fcff53be3e94052268ec5d864c70c47e
1 #ifndef _ETASK_H
2 #define _ETASK_H
4 /*
5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Internal description of the ETask structure
9 Lang: english
12 #include <exec/interrupts.h>
13 #include <exec/tasks.h>
15 #include "alertextra.h"
17 /* Known alert context types */
18 #define AT_NONE 0x00
19 #define AT_CPU 0x01
20 #define AT_MUNGWALL 0x02
21 #define AT_MEMORY 0x03
23 /* Alert data. Can have different contents, depending on what actually happened */
24 struct AlertContext
26 union
28 struct ExceptionContext acpu;
29 struct MungwallContext amw;
30 struct MMContext amm;
31 } u;
34 struct IntETask
36 struct ETask iet_ETask;
37 APTR iet_RT; /* Structure for resource tracking */
38 UQUAD iet_CpuTime;
39 UQUAD iet_private1;
40 ULONG iet_AlertCode; /* Alert code for crash handler */
41 UBYTE iet_AlertType; /* Type of the alert context */
42 UBYTE iet_AlertFlags; /* See below */
43 APTR iet_AlertLocation; /* Alert location for crash handler */
44 APTR iet_AlertStack; /* Frame pointer for stack backtrace */
45 struct AlertContext iet_AlertData; /* Extra data coming with the crash */
46 #ifdef DEBUG_ETASK
47 STRPTR iet_Me;
48 #endif
51 #define GetIntETask(task) ((struct IntETask *)GetETask(task))
52 #define IntETask(etask) ((struct IntETask *)(etask))
54 /* iet_AlertFlags */
55 #define AF_Alert 0x01 /* The task is in alert state */
56 #define AF_Location 0x02 /* iet_AlertLocation is filled in */
59 * This function resets crash status of the task:
60 * - AF_Alert flag serves as an actual indicator of crash status.
61 * If we enter Alert() with this flag already set, this is
62 * considered a nested alert and is directed to supervisor-mode routine.
63 * - AF_Location flag can also be set only once. It is either set explicitly
64 * before calling Alert(), or it is set by Alert() routine itself. So we clear
65 * it in order for Alert() to be able to remember it if task ever alerts again.
66 * - iet_AlertType specifies type of alert context (if any). We make sure
67 * it is clear so as next time Alert() will not display old information.
69 static inline void ResetETask(struct IntETask *etask)
71 etask->iet_AlertType = AT_NONE;
72 etask->iet_AlertFlags = 0;
75 #endif /* _ETASK_H */