1 #ifndef EXEC_EXECBASE_H 2 #define EXEC_EXECBASE_H 3 4 /* 5 exec include (V50) 6 7 Copyright © 2002 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 #ifndef EXEC_LISTS_H 11 # include <exec/lists.h> 12 #endif 13 14 #ifndef EXEC_INTERRUPTS_H 15 # include <exec/interrupts.h> 16 #endif 17 18 #ifndef EXEC_LIBRARIES_H 19 # include <exec/libraries.h> 20 #endif 21 22 #ifndef EXEC_TASKS_H 23 # include <exec/tasks.h> 24 #endif 25 26 #ifndef UTILITY_TAGITEM_H 27 # include <utility/tagitem.h> 28 #endif 29 30 31 32 #pragma pack(2) 33 34 #define CPUTBSTACKTRACECOUNT 16 35 struct ExecBase 36 { 37 struct Library LibNode; 38 UWORD SoftVer; 39 WORD LowMemChkSum; 40 ULONG ChkBase; 41 APTR ColdCapture; 42 APTR CoolCapture; 43 APTR WarmCapture; 44 APTR SysStkUpper; 45 APTR SysStkLower; 46 ULONG MaxLocMem; 47 APTR DebugEntry; 48 APTR DebugData; 49 APTR AlertData; 50 APTR MaxExtMem; 51 UWORD ChkSum; 52 struct IntVector IntVects[16]; 53 54 struct Task *ThisTask; 55 56 volatile ULONG IdleCount; 57 ULONG DispCount; 58 UWORD Quantum; 59 UWORD Elapsed; 60 volatile UWORD SysFlags; 61 BYTE IDNestCnt; 62 BYTE TDNestCnt; 63 64 UWORD AttnFlags; 65 66 volatile UWORD AttnResched; 67 APTR ResModules; 68 APTR TaskTrapCode; 69 APTR TaskExceptCode; 70 APTR TaskExitCode; 71 ULONG TaskSigAlloc; 72 UWORD TaskTrapAlloc; 73 74 struct List MemList; 75 struct List ResourceList; 76 struct List DeviceList; 77 struct List IntrList; 78 struct List LibList; 79 struct List PortList; 80 struct List TaskReady; 81 struct List TaskWait; 82 struct SoftIntList SoftInts[5]; 83 84 LONG LastAlert[4]; 85 UBYTE VBlankFrequency; 86 UBYTE PowerSupplyFrequency; 87 struct List SemaphoreList; 88 APTR KickMemPtr; 89 APTR KickTagPtr; 90 APTR KickCheckSum; 91 UWORD ex_Pad0; 92 ULONG ex_LaunchPoint; 93 APTR ex_RamLibPrivate; 94 ULONG ex_EClockFrequency; 95 ULONG ex_CacheControl; 96 ULONG ex_TaskID; 97 98 /* New ABox Emulation Entries 99 */ 100 ULONG ex_EmulHandleSize; /* PPC EmulHandleSize..*private* */ 101 struct MsgPort *ex_PPCTrapMsgPort; /* PPC ABox Exception MsgPort..*private* */ 102 ULONG ex_Reserved1[3]; 103 104 APTR ex_MMULock; 105 106 APTR ex_PatchPool; /* PatchPool Ptr needed by SetFunction..*private* */ 107 APTR ex_PPCTaskExitCode; /* PPC Task exit function */ 108 ULONG ex_DebugFlags; /* Exec Debug Flags..*private* */ 109 110 struct MinList ex_MemHandlers; 111 APTR ex_MemHandler; 112 113 }; 114 115 /* 116 * Outdated 68k cpu informations 117 * 118 */ 119 #define AFB_68010 0 120 #define AFB_68020 1 121 #define AFB_68030 2 122 #define AFB_68040 3 123 #define AFB_68881 4 124 #define AFB_68882 5 125 #define AFB_FPU40 6 126 #define AFB_68060 7 127 #define AFB_PRIVATE 15 128 129 #define AFF_68010 (1 << AFB_68010) 130 #define AFF_68020 (1 << AFB_68020) 131 #define AFF_68030 (1 << AFB_68030) 132 #define AFF_68040 (1 << AFB_68040) 133 #define AFF_68881 (1 << AFB_68881) 134 #define AFF_68882 (1 << AFB_68882) 135 #define AFF_FPU40 (1 << AFB_FPU40) 136 #define AFF_68060 (1 << AFB_68060) 137 #define AFF_PRIVATE (1 << AFB_PRIVATE) 138 139 /* 140 * Outdated 68k cache functionality 141 * Mostly without function. 142 */ 143 144 #define CACRF_EnableI (1 << 0) 145 #define CACRF_FreezeI (1 << 1) 146 #define CACRF_ClearI (1 << 3) 147 #define CACRF_IBE (1 << 4) 148 #define CACRF_EnableD (1 << 8) 149 #define CACRF_FreezeD (1 << 9) 150 #define CACRF_ClearD (1 << 11) 151 #define CACRF_DBE (1 << 12) 152 #define CACRF_WriteAllocate (1 << 13) 153 #define CACRF_EnableE (1 << 30) 154 #define CACRF_CopyBack (1 << 31) 155 156 #define DMA_Continue (1 << 1) 157 #define DMA_NoModify (1 << 2) 158 #define DMA_ReadFromRAM (1 << 3) 159 160 #define SB_SAR 15 161 #define SB_TQE 14 162 #define SB_SINT 13 163 164 #define SF_SAR (1 << SB_SAR) 165 #define SF_TQE (1 << SB_TQE) 166 #define SF_SINT (1 << SB_SINT) 167 168 /****** Debug Flags...(don't depend on them) **********/ 169 170 #define EXECDEBUGF_INITRESIDENT 0x1UL 171 #define EXECDEBUGF_INITCODE 0x2UL 172 #define EXECDEBUGF_FINDRESIDENT 0x4UL 173 174 #define EXECDEBUGF_CREATELIBRARY 0x10UL 175 #define EXECDEBUGF_SETFUNCTION 0x20UL 176 #define EXECDEBUGF_NEWSETFUNCTION 0x40UL 177 #define EXECDEBUGF_CHIPRAM 0x80UL 178 179 #define EXECDEBUGF_ADDTASK 0x100UL 180 #define EXECDEBUGF_REMTASK 0x200UL 181 #define EXECDEBUGF_GETTASKATTR 0x400UL 182 #define EXECDEBUGF_SETTASKATTR 0x800UL 183 184 #define EXECDEBUGF_EXCEPTHANDLER 0x1000UL 185 #define EXECDEBUGF_ADDDOSNODE 0x2000UL 186 #define EXECDEBUGF_PCI 0x4000UL 187 #define EXECDEBUGF_RAMLIB 0x8000UL 188 189 #define EXECDEBUGF_NOLOGSERVER 0x10000UL 190 #define EXECDEBUGF_NOLOGWINDOW 0x20000UL 191 192 /* 193 * "env:MorphOS/LogPath" contains the logfile path, 194 * If not specified it's using "ram:.morphoslog" 195 */ 196 #define EXECDEBUGF_LOGFILE 0x40000UL 197 #define EXECDEBUGF_LOGKPRINTF 0x80000UL 198 199 200 /* Memory Tracking Flags 201 */ 202 203 #define EXECDEBUGF_PERMMEMTRACK 0x100000UL 204 #define EXECDEBUGF_MEMTRACK 0x200000UL 205 206 207 /* CyberGuardPPC Flags 208 */ 209 210 #define EXECDEBUGF_CYBERGUARDDEADLY 0x400000UL 211 212 /* 213 * extended logserver output flag 214 */ 215 #define EXECDEBUGF_LOGEXTENDED 0x800000UL 216 217 218 /* PPCLib Flags 219 */ 220 221 #define EXECDEBUGF_LOADSEG 0x01000000UL 222 #define EXECDEBUGF_UNLOADSEG 0x02000000UL 223 #define EXECDEBUGF_PPCSTART 0x04000000UL 224 225 226 /* UserFlags 227 */ 228 229 /* 230 * Enables debug output for cybergraphx 231 */ 232 #define EXECDEBUGF_CGXDEBUG 0x08000000UL 233 234 /* 235 * CyberGuard Zeropage protection 236 */ 237 #define EXECDEBUGF_INVZEROPAGE 0x10000000UL 238 239 /* 240 * Should be used to control user LibInit/DevInit Debug output 241 */ 242 #define EXECDEBUGF_INIT 0x40000000UL 243 244 /* 245 * Should be used to control logging 246 */ 247 #define EXECDEBUGF_LOG 0x80000000UL 248 249 250 /* 251 * Execbase list IDs 252 */ 253 #define EXECLIST_DEVICE 0 254 #define EXECLIST_INTERRUPT 1 255 #define EXECLIST_LIBRARY 2 256 #define EXECLIST_MEMHANDLER 3 257 #define EXECLIST_MEMHEADER 4 258 #define EXECLIST_PORT 5 259 #define EXECLIST_RESOURCE 6 260 #define EXECLIST_SEMAPHORE 7 261 #define EXECLIST_TASK 8 262 263 /* 264 * **** dos.library/RunCommand hook **** 265 * 266 * - Hook Object is BPTR seglist. 267 * - ExecNotifyMessage.Extra points to: 268 * struct RunCommandExtra { 269 * BPTR seglist; 270 * ULONG stacksize; 271 * STRPTR argptr; 272 * ULONG argsize; 273 * }; 274 * - Before seglist is executed EXECNOTIFYF_POST is not set. 275 * - After seglist execution is done EXECNOTIFYF_POST is set. 276 * - EXECNOTIFYF_REMOVE has no meaning and is never set. 277 */ 278 #define EXECNOTIFY_RUNCOMMAND 9 279 280 /* 281 * Execnotify hook message 282 */ 283 struct ExecNotifyMessage 284 { 285 ULONG Type; 286 ULONG Flags; 287 ULONG Extra; 288 struct TagItem *Extension; 289 }; 290 291 #define EXECNOTIFYF_REMOVE (1 << 0) /* if clear, is ADD */ 292 #define EXECNOTIFYF_POST (1 << 1) /* if clear, is PRE */ 293 294 /* 295 * AddExecNodeTagList tags 296 */ 297 #define SAL_Dummy (TAG_USER + 1000) 298 #define SAL_Type (SAL_Dummy + 1) 299 #define SAL_Priority (SAL_Dummy + 2) 300 #define SAL_Name (SAL_Dummy + 3) 301 302 303 304 #pragma pack() 305 306 #endif