Add AttnFlags for the Apollo'080, and MMU presence.
[AROS.git] / compiler / include / exec / execbase.inc
blob6837de0887e0243664c179d20feec698961b8d60
1 #ifndef EXEC_EXECBASE_H
2 #define EXEC_EXECBASE_H
4 /*
5     Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6     $Id$
8     Desc: structure of exec.library
9     Lang: english
12 #ifndef EXEC_INTERRUPTS_H
13 #   include <exec/interrupts.h>
14 #endif
15 #ifndef EXEC_LIBRARIES_H
16 #   include <exec/libraries.h>
17 #endif
18 #ifndef EXEC_LISTS_H
19 #   include <exec/lists.h>
20 #endif
21 #ifndef EXEC_TASKS_H
22 #   include <exec/tasks.h>
23 #endif
25 /* Most fields are PRIVATE */
26 struct ExecBase
28 /* Standard Library Structure */
29     struct Library LibNode;
31 /* System Constants */
32     UWORD SoftVer;      /* OBSOLETE */
33     WORD  LowMemChkSum;
34     IPTR  ChkBase;
35     APTR  ColdCapture;
36     APTR  CoolCapture;
37     APTR  WarmCapture;
38     APTR  SysStkUpper;  /* System Stack Bounds */
39     APTR  SysStkLower;
40     IPTR  MaxLocMem;    /* Top address of Chip memory + 1, or Chip RAM size. Amiga-specific */
41     APTR  DebugEntry;
42     APTR  DebugData;
43     APTR  AlertData;
44     APTR  MaxExtMem;    /* Top address of "Slow memory" + 1 (A500 only) */
45     UWORD ChkSum;       /* SoftVer to MaxExtMem */
47 /* Interrupts */
48     struct IntVector IntVects[16];
50 /* System Variables */
51     struct Task *ThisTask;       /* Pointer to currently running task (readable) */
52     ULONG        IdleCount;      /* Incremented when system goes idle            */
53     ULONG        DispCount;      /* Incremented when a task is dispatched        */
54     UWORD        Quantum;        /* # of ticks, a task may run                   */
55     UWORD        Elapsed;        /* # of ticks, the current task has run         */
56     UWORD        SysFlags;       /* Private flags                                */
57     BYTE         IDNestCnt;      /* Disable() nesting count                      */
58     BYTE         TDNestCnt;      /* Forbid() nesting count                       */
59     UWORD        AttnFlags;      /* Attention Flags (readable, see below)        */
60     UWORD        AttnResched;    /* Private scheduler flags                      */
61     APTR         ResModules;     /* Resident modules list                        */
62     APTR         TaskTrapCode;   /* Trap handling code                           */
63     APTR         TaskExceptCode; /* User-mode exception handling code            */
64     APTR         TaskExitCode;   /* Termination code                             */
65     ULONG        TaskSigAlloc;   /* Allocated signals bitmask                    */
66     UWORD        TaskTrapAlloc;  /* Allocated traps bitmask                      */
68 /* PRIVATE Lists */
69     struct List        MemList;
70     struct List        ResourceList;
71     struct List        DeviceList;
72     struct List        IntrList;
73     struct List        LibList;
74     struct List        PortList;
75     struct List        TaskReady;      /* Tasks that are ready to run */
76     struct List        TaskWait;       /* Tasks that wait for some event */
77     struct SoftIntList SoftInts[5];
79 /* Miscellaneous Stuff */
80     LONG               LastAlert[4];
82     UBYTE              VBlankFrequency;      /* Readable                 */
83     UBYTE              PowerSupplyFrequency; /* Readable, Amiga-specific */
84     struct List        SemaphoreList;
86 /* Kickstart */
87     APTR KickMemPtr;
88     APTR KickTagPtr;
89     APTR KickCheckSum;
91 /* Miscellaneous Stuff */
92     UWORD          ex_Pad0;            /* PRIVATE */
93     IPTR           ex_LaunchPoint;     /* PRIVATE */
94     APTR           ex_RamLibPrivate;
95     ULONG          ex_EClockFrequency; /* (readable) */
96     ULONG          ex_CacheControl;    /* PRIVATE */
97     ULONG          ex_TaskID;
98     IPTR           ex_Reserved1[5];
99     APTR           ex_MMULock;         /* PRIVATE */
100     IPTR           ex_Reserved2[2];
101     ULONG          ex_DebugFlags;
102     struct MinList ex_MemHandlers;
103     APTR           ex_MemHandler;      /* PRIVATE */
105 /* Additional field for AROS */
106     struct Library      * DebugAROSBase;
107     struct Library      * lb_TaskResBase;
110 /* AttnFlags */
111 /* Processors */
112 #define AFB_68010        0
113 #define AFF_68010   (1L<<AFB_68010)
114 #define AFB_68020        1
115 #define AFF_68020   (1L<<AFB_68020)
116 #define AFB_68030        2
117 #define AFF_68030   (1L<<AFB_68030)
118 #define AFB_68040        3
119 #define AFF_68040   (1L<<AFB_68040)
120 #define AFB_68060        7
121 #define AFF_68060   (1L<<AFB_68060)
122 #define AFB_AP68080        9
123 #define AFF_AP68080   (1L<<AFB_AP68080)
124 /* Co-Processors */
125 #define AFB_68881        4
126 #define AFF_68881   (1L<<AFB_68881)
127 #define AFB_68882        5
128 #define AFF_68882   (1L<<AFB_68882)
129 #define AFB_FPU40        6
130 #define AFF_FPU40   (1L<<AFB_FPU40)
131 /* AROS extensions */
132 #define AFB_ADDR32       13 /* CPU has 32-bit addressing */
133 #define AFF_ADDR32  (1L<<AFB_ADDR32)
134 #define AFB_PRIVATEB       14 /* MMU is present */
135 #define AFF_PRIVATEB  (1L<<AFB_PRIVATEB)
136 #define AFB_PRIVATE      15 /* FPU presence - See below */
137 #define AFF_PRIVATE (1L<<AFB_PRIVATE)
139  * AFB_PRIVATE is actually FPU presence flag with architecture-specific meaning:
140  * m68k   - Set if any FPU type detected. AmigaOS-compatible, however considered private.
141  * ARM    - Set if VFP is present. Considered public.
142  * Others - not used.
143  */
144 #define AFB_FPU     AFB_PRIVATE
145 #define AFF_FPU     AFF_PRIVATE
147 /* SysFlags. Private and AROS-specific. */
148 #define SFF_SoftInt         (1L<<5)  /* There is a software interrupt pending */
149 #define SFF_QuantumOver     (1L<<13) /* Task's time slice is over             */
151 /* AttnResched. AmigaOS(tm)-compatible, but private. */
152 #define ARF_AttnSwitch      (1L<<7)  /* Delayed task switch pending */
154 /* Cache */
155 #define CACRF_EnableI       (1L<<0)
156 #define CACRF_FreezeI       (1L<<1)
157 #define CACRF_ClearI        (1L<<3)
158 #define CACRF_IBE           (1L<<4)
159 #define CACRF_EnableD       (1L<<8)
160 #define CACRF_FreezeD       (1L<<9)
161 #define CACRF_ClearD        (1L<<11)
162 #define CACRF_DBE           (1L<<12)
163 #define CACRF_WriteAllocate (1L<<13)
164 #define CACRF_InvalidateD   (1L<<15)
165 #define CACRF_EnableE       (1L<<30)
166 #define CACRF_CopyBack      (1L<<31)
168 /* DMA */
169 #define DMA_Continue    (1L<<1)
170 #define DMA_NoModify    (1L<<2)
171 #define DMA_ReadFromRAM (1L<<3)
174  * Runtime debug output flags, MorphOS-compatible.
175  * Most of them are reserved for now.
176  */
177 #define EXECDEBUGF_INITRESIDENT     0x00000001  /* Single resident initialization       */
178 #define EXECDEBUGF_INITCODE         0x00000002  /* Kickstart initialization             */
179 #define EXECDEBUGF_FINDRESIDENT     0x00000004  /* Resident search                      */
180 #define EXECDEBUGF_CREATELIBRARY    0x00000010  /* Library creation                     */
181 #define EXECDEBUGF_SETFUNCTION      0x00000020  /* Library function patching            */
182 #define EXECDEBUGF_NEWSETFUNCTION   0x00000040
183 #define EXECDEBUGF_CHIPRAM          0x00000080
184 #define EXECDEBUGF_ADDTASK          0x00000100  /* Task creation                        */
185 #define EXECDEBUGF_REMTASK          0x00000200  /* Task removal                         */
186 #define EXECDEBUGF_GETTASKATTR      0x00000400
187 #define EXECDEBUGF_SETTASKATTR      0x00000800
188 #define EXECDEBUGF_EXCEPTHANDLER    0x00001000
189 #define EXECDEBUGF_ADDDOSNODE       0x00002000
190 #define EXECDEBUGF_PCI              0x00004000
191 #define EXECDEBUGF_RAMLIB           0x00008000
192 #define EXECDEBUGF_NOLOGSERVER      0x00010000
193 #define EXECDEBUGF_NOLOGWINDOW      0x00020000
194 #define EXECDEBUGF_LOGFILE          0x00040000
195 #define EXECDEBUGF_LOGKPRINTF       0x00080000
196 #define EXECDEBUGF_PERMMEMTRACK     0x00100000
197 #define EXECDEBUGF_MEMTRACK         0x00200000
198 #define EXECDEBUGF_CYBERGUARDDEADLY 0x00400000
199 #define EXECDEBUGF_LOGEXTENDED      0x00800000
200 #define EXECDEBUGF_LOADSEG          0x01000000
201 #define EXECDEBUGF_UNLOADSEG        0x02000000
202 #define EXECDEBUGF_PPCSTART         0x04000000
203 #define EXECDEBUGF_CGXDEBUG         0x08000000
204 #define EXECDEBUGF_INVZEROPAGE      0x10000000
205 #define EXECDEBUGF_INIT             0x40000000  /* Generic system startup               */
206 #define EXECDEBUGF_LOG              0x80000000
209  * AROS-specific definition.
210  * This value ORed with a pointer in SysBase->ResList tells
211  * that it's a pointer to another list, not to a resident.
212  */
213 #ifdef __mc68000__
214 #define RESLIST_NEXT (IPTR)0x80000000
215 #else
216 #define RESLIST_NEXT (IPTR)0x00000001
217 #endif
219 #endif /* EXEC_EXECBASE_H */