For compatibily with AmigaOS we are handle this cases specially:
[AROS.git] / compiler / include / exec / execbase.h
blob8ff250a54fc8fc47e512b51e2f0634c070fc472c
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<<0)
114 #define AFB_68020 1
115 #define AFF_68020 (1L<<1)
116 #define AFB_68030 2
117 #define AFF_68030 (1L<<2)
118 #define AFB_68040 3
119 #define AFF_68040 (1L<<3)
120 #define AFB_68060 7
121 #define AFF_68060 (1L<<7)
122 /* Co-Processors */
123 #define AFB_68881 4
124 #define AFF_68881 (1L<<4)
125 #define AFB_68882 5
126 #define AFF_68882 (1L<<5)
127 #define AFB_FPU40 6
128 #define AFF_FPU40 (1L<<6)
129 #define AFB_ADDR32 14 /* AROS extension, CPU has 32-bit addressing */
130 #define AFF_ADDR32 (1L<<14)
131 #define AFB_PRIVATE 15 /* See below */
132 #define AFF_PRIVATE (1L<<15)
134 * AFB_PRIVATE is actually FPU presence flag with architecture-specific meaning:
135 * m68k - Set if any FPU type detected. AmigaOS-compatible, however considered private.
136 * ARM - Set if VFP is present. Considered public.
137 * Others - not used.
139 #define AFB_FPU AFB_PRIVATE
140 #define AFF_FPU AFF_PRIVATE
142 /* SysFlags. Private and AROS-specific. */
143 #define SFF_SoftInt (1L<<5) /* There is a software interrupt pending */
144 #define SFF_QuantumOver (1L<<13) /* Task's time slice is over */
146 /* AttnResched. AmigaOS(tm)-compatible, but private. */
147 #define ARF_AttnSwitch (1L<<7) /* Delayed task switch pending */
149 /* Cache */
150 #define CACRF_EnableI (1L<<0)
151 #define CACRF_FreezeI (1L<<1)
152 #define CACRF_ClearI (1L<<3)
153 #define CACRF_IBE (1L<<4)
154 #define CACRF_EnableD (1L<<8)
155 #define CACRF_FreezeD (1L<<9)
156 #define CACRF_ClearD (1L<<11)
157 #define CACRF_DBE (1L<<12)
158 #define CACRF_WriteAllocate (1L<<13)
159 #define CACRF_InvalidateD (1L<<15)
160 #define CACRF_EnableE (1L<<30)
161 #define CACRF_CopyBack (1L<<31)
163 /* DMA */
164 #define DMA_Continue (1L<<1)
165 #define DMA_NoModify (1L<<2)
166 #define DMA_ReadFromRAM (1L<<3)
169 * Runtime debug output flags, MorphOS-compatible.
170 * Most of them are reserved for now.
172 #define EXECDEBUGF_INITRESIDENT 0x00000001 /* Single resident initialization */
173 #define EXECDEBUGF_INITCODE 0x00000002 /* Kickstart initialization */
174 #define EXECDEBUGF_FINDRESIDENT 0x00000004 /* Resident search */
175 #define EXECDEBUGF_CREATELIBRARY 0x00000010 /* Library creation */
176 #define EXECDEBUGF_SETFUNCTION 0x00000020 /* Library function patching */
177 #define EXECDEBUGF_NEWSETFUNCTION 0x00000040
178 #define EXECDEBUGF_CHIPRAM 0x00000080
179 #define EXECDEBUGF_ADDTASK 0x00000100 /* Task creation */
180 #define EXECDEBUGF_REMTASK 0x00000200 /* Task removal */
181 #define EXECDEBUGF_GETTASKATTR 0x00000400
182 #define EXECDEBUGF_SETTASKATTR 0x00000800
183 #define EXECDEBUGF_EXCEPTHANDLER 0x00001000
184 #define EXECDEBUGF_ADDDOSNODE 0x00002000
185 #define EXECDEBUGF_PCI 0x00004000
186 #define EXECDEBUGF_RAMLIB 0x00008000
187 #define EXECDEBUGF_NOLOGSERVER 0x00010000
188 #define EXECDEBUGF_NOLOGWINDOW 0x00020000
189 #define EXECDEBUGF_LOGFILE 0x00040000
190 #define EXECDEBUGF_LOGKPRINTF 0x00080000
191 #define EXECDEBUGF_PERMMEMTRACK 0x00100000
192 #define EXECDEBUGF_MEMTRACK 0x00200000
193 #define EXECDEBUGF_CYBERGUARDDEADLY 0x00400000
194 #define EXECDEBUGF_LOGEXTENDED 0x00800000
195 #define EXECDEBUGF_LOADSEG 0x01000000
196 #define EXECDEBUGF_UNLOADSEG 0x02000000
197 #define EXECDEBUGF_PPCSTART 0x04000000
198 #define EXECDEBUGF_CGXDEBUG 0x08000000
199 #define EXECDEBUGF_INVZEROPAGE 0x10000000
200 #define EXECDEBUGF_INIT 0x40000000 /* Generic system startup */
201 #define EXECDEBUGF_LOG 0x80000000
204 * AROS-specific definition.
205 * This value ORed with a pointer in SysBase->ResList tells
206 * that it's a pointer to another list, not to a resident.
208 #ifdef __mc68000__
209 #define RESLIST_NEXT (IPTR)0x80000000
210 #else
211 #define RESLIST_NEXT (IPTR)0x00000001
212 #endif
214 #endif /* EXEC_EXECBASE_H */