arch/m68k-amiga: Define the gcc symbol 'start' instead of using .bss
[AROS.git] / rom / exec / etask.h
blob40bda38a4afe4263d86d1df5e13bf70abb25fb71
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 "mmextra.h"
16 #include "mungwallextra.h"
18 /* Known alert context types */
19 #define AT_NONE 0x00
20 #define AT_CPU 0x01
21 #define AT_MUNGWALL 0x02
22 #define AT_MEMORY 0x03
24 /* Alert data. Can have different contents, depending on what actually happened */
25 struct AlertContext
27 union
29 struct ExceptionContext acpu;
30 struct MungwallContext amw;
31 struct MMContext amm;
32 } u;
35 struct IntETask
37 struct ETask iet_ETask;
38 #ifdef DEBUG_ETASK
39 STRPTR iet_Me;
40 #endif
41 APTR iet_RT; /* Structure for resource tracking */
42 APTR iet_Context; /* Structure to store CPU registers */
43 UQUAD iet_CpuTime;
44 UQUAD iet_private1;
45 ULONG iet_AlertCode; /* Alert code for crash handler */
46 UBYTE iet_AlertType; /* Type of the alert context */
47 UBYTE iet_AlertFlags; /* See below */
48 APTR iet_AlertLocation; /* Alert location for crash handler */
49 APTR iet_AlertStack; /* Frame pointer for stack backtrace */
50 struct AlertContext iet_AlertData; /* Extra data coming with the crash */
53 #define GetIntETask(task) ((struct IntETask *)(((struct Task *) \
54 (task))->tc_UnionETask.tc_ETask))
55 #define IntETask(etask) ((struct IntETask *)(etask))
57 /* iet_AlertFlags */
58 #define AF_Alert 0x01 /* The task is in alert state */
59 #define AF_Location 0x02 /* iet_AlertLocation is filled in */
62 * This function resets crash status of the task:
63 * - AF_Alert flag serves as an actual indicator of crash status.
64 * If we enter Alert() with this flag already set, this is
65 * considered a nested alert and is directed to supervisor-mode routine.
66 * - AF_Location flag can also be set only once. It is either set explicitly
67 * before calling Alert(), or it is set by Alert() routine itself. So we clear
68 * it in order for Alert() to be able to remember it if task ever alerts again.
69 * - iet_AlertType specifies type of alert context (if any). We make sure
70 * it is clear so as next time Alert() will not display old information.
72 static inline void ResetETask(struct IntETask *etask)
74 etask->iet_AlertType = AT_NONE;
75 etask->iet_AlertFlags = 0;
78 #endif /* _ETASK_H */