-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibstructs.h
382 lines (354 loc) · 12.7 KB
/
libstructs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
// Copyright (c) 2019, 2020 Dennis van der Boon
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <powerpc/powerpc.h>
#include <powerpc/portsPPC.h>
#include <powerpc/semaphoresPPC.h>
#include <powerpc/tasksPPC.h>
#include <exec/types.h>
#include <exec/exec.h>
#include <dos/dos.h>
#include <powerpc/portsPPC.h>
#include <powerpc/tasksPPC.h>
#include <powerpc/powerpc.h>
struct MsgFrame {
struct Message mf_Message;
volatile ULONG mf_Identifier;
struct MsgPort* mf_MirrorPort;
struct TaskPPC* mf_PPCTask;
struct PPCArgs mf_PPCArgs;
ULONG mf_Signals;
ULONG mf_Arg[3];
};
struct CacheSize {
ULONG cz_SizeBit;
ULONG cz_SizeBytes;
};
struct DebugArgs {
STRPTR db_ProcessName;
ULONG db_Function;
ULONG db_Arg[4];
};
struct SysCall {
ULONG sc_Function;
ULONG sc_Arg[4];
};
struct MirrorTask {
struct MinNode mt_Node;
struct TaskPPC* mt_PPCTask;
struct Task* mt_Task;
struct MsgPort* mt_Port;
ULONG mt_Flags;
};
struct PPCZeroPage {
ULONG zp_PPCMemBase;
struct ExecBase* zp_SysBase;
struct MemHeader* zp_PPCMemHeader;
volatile ULONG zp_Status;
struct PPCBase* zp_PowerPCBase; //Also used in kernel.s as 16(r0)!
ULONG zp_PageTableSize;
ULONG zp_CacheGap[2];
ULONG zp_MemSize;
volatile ULONG zp_DECCounter;
};
struct InternalConsts {
struct ExecBase* ic_SysBase;
BPTR ic_SegList;
struct DosLibrary* ic_DOSBase;
struct PciBase* ic_PciBase;
struct PPCBase* ic_PowerPCBase;
struct ExpansionBase* ic_ExpansionBase;
ULONG ic_MemBase;
ULONG ic_gfxMem;
ULONG ic_gfxSize;
ULONG ic_gfxConfig;
ULONG ic_startBAT;
ULONG ic_sizeBAT;
ULONG ic_deviceID;
ULONG ic_env1;
ULONG ic_env2;
ULONG ic_env3;
UWORD ic_gfxType;
UWORD ic_gfxSubType;
UWORD ic_pciType;
};
struct InitData {
ULONG id_Reserved;
volatile ULONG id_Status;
ULONG id_MemBase;
ULONG id_MemSize;
ULONG id_GfxMemBase;
ULONG id_GfxMemSize;
UWORD id_GfxType;
UWORD id_GfxSubType;
ULONG id_GfxConfigBase;
ULONG id_Environment1;
ULONG id_Environment2;
ULONG id_Environment3;
ULONG id_DeviceID;
ULONG id_ConfigBase;
ULONG id_MsgsBase;
ULONG id_MPICBase;
ULONG id_StartBat;
ULONG id_SizeBat;
};
struct MemSettings {
ULONG ms_msar1;
ULONG ms_msar2;
ULONG ms_mear1;
ULONG ms_mear2;
ULONG ms_mesar1;
ULONG ms_mesar2;
ULONG ms_meear1;
ULONG ms_meear2;
ULONG ms_mben;
ULONG ms_mccr1;
ULONG ms_mccr1testhigh;
ULONG ms_mccr1testlow1;
ULONG ms_mccr1testlow2;
ULONG ms_mccr1testlow3;
ULONG ms_memsize;
};
struct BATArray {
ULONG ba_ibatu;
ULONG ba_ibatl;
ULONG ba_dbatu;
ULONG ba_dbatl;
};
struct LibSema {
struct SignalSemaphorePPC ls_Semaphore;
ULONG ls_Reserved[8];
};
struct PrivatePPCBase {
struct PPCBase pp_PowerPCBase;
struct MinList pp_MirrorList;
ULONG pp_DeviceID;
ULONG pp_BridgeConfig;
ULONG pp_BridgeMsgs;
ULONG pp_BridgeMPIC;
struct MsgPort* pp_MasterControl;
struct UtilityBase* pp_UtilityBase;
UBYTE pp_DebugLevel;
UBYTE pp_EnAlignExc;
UBYTE pp_EnDAccessExc;
UBYTE pp_Pad;
ULONG pp_TaskExitCode;
ULONG pp_PPCMemBase;
ULONG pp_PPCMemSize;
volatile ULONG pp_Mutex;
ULONG pp_L2Size;
ULONG pp_CurrentL2Size;
ULONG pp_L2State;
ULONG pp_CPUSDR1;
ULONG pp_CPUHID0;
ULONG pp_CPUSpeed;
ULONG pp_CPUInfo;
ULONG pp_PageTableSize;
ULONG pp_LowerLimit;
ULONG pp_UpperLimit;
struct TaskPPC* pp_ThisPPCProc;
struct TaskPPC* pp_TaskExcept;
struct MinList pp_WaitingTasks;
struct MinList pp_ReadyTasks;
struct MinList pp_NewTasks;
struct MinList pp_RemovedTasks;
struct MinList pp_AllTasks;
struct MinList pp_Snoop;
struct MinList pp_Semaphores;
struct MinList pp_RemovedExc;
struct MinList pp_ReadyExc;
struct MinList pp_InstalledExc;
struct MinList pp_ExcInterrupt;
struct MinList pp_ExcIABR;
struct MinList pp_ExcPerfMon;
struct MinList pp_ExcTrace;
struct MinList pp_ExcSystemCall;
struct MinList pp_ExcDecrementer;
struct MinList pp_ExcFPUn;
struct MinList pp_ExcProgram;
struct MinList pp_ExcAlign;
struct MinList pp_ExcIAccess;
struct MinList pp_ExcDAccess;
struct MinList pp_ExcMCheck;
struct MinList pp_ExcSysMan;
struct MinList pp_ExcTherMan;
struct MinList pp_WaitTime;
struct MinList pp_Ports;
struct MinList pp_MsgQueue;
struct LibSema pp_SemWaitList;
struct LibSema pp_SemTaskList;
struct LibSema pp_SemSemList;
struct LibSema pp_SemPortList;
struct LibSema pp_SemSnoopList;
struct LibSema pp_SemMemory;
ULONG pp_AlignmentExcHigh;
ULONG pp_AlignmentExcLow;
ULONG pp_DataExcHigh;
ULONG pp_DataExcLow;
struct MsgPortPPC* pp_CurrentPort;
UBYTE pp_EnAltivec;
volatile UBYTE pp_ExceptionMode;
UBYTE pp_CacheDisDFlushAll;
UBYTE pp_CacheDState;
UBYTE pp_CacheDLockState;
UBYTE pp_FlagReschedule;
UBYTE pp_FlagForbid;
UBYTE pp_FlagWait;
UBYTE pp_FlagPortInUse; //for nt_IntPort....not used
UBYTE pp_BusyCounter;
UBYTE pp_BytePad[2];
ULONG pp_NumAllTasks;
ULONG pp_StartTBL;
ULONG pp_CurrentTBL;
ULONG pp_SystemLoad;
ULONG pp_CPULoad;
ULONG pp_NICETable;
LONG pp_LowActivityPri;
ULONG pp_IdSysTasks;
ULONG pp_IdUsrTasks;
LONG pp_LowActivityPriOffset;
ULONG pp_ErrorStrings;
ULONG pp_BusClock;
ULONG pp_Quantum;
ULONG pp_StdQuantum;
ULONG pp_NumRun68k;
struct BATArray pp_ExceptionBATs[4];
struct BATArray pp_StoredBATs[4];
struct BATArray pp_SystemBATs[4];
ULONG pp_SystemSegs[16];
};
struct killFIFO {
ULONG kf_MIOFH;
ULONG kf_MIOPT;
ULONG kf_MIIFT;
ULONG kf_MIIPH;
ULONG kf_CreatePrevious;
ULONG kf_GetPrevious;
ULONG kf_CacheGap[2];
ULONG kf_MIOFT;
ULONG kf_MIOPH;
ULONG kf_MIIFH;
ULONG kf_MIIPT;
};
struct iframe {
struct EXCContext if_Context;
ULONG if_AlignStore[2];
ULONG if_VSCR[4];
ULONG if_regAltivec[32*4];
ULONG if_VRSAVE;
struct BATArray if_BATs[4];
ULONG if_Segments[16];
ULONG if_ExcNum;
};
struct poolHeader {
struct MinNode ph_Node;
ULONG ph_Requirements;
ULONG ph_PuddleSize;
ULONG ph_ThresholdSize;
struct MinList ph_PuddleList;
struct MinList ph_BlockList;
};
struct SemWait {
struct MinNode sw_Node;
struct TaskPPC* sw_Task;
ULONG sw_Pad[2];
struct SignalSemaphorePPC* sw_Semaphore;
};
struct TagItemPtr {
struct TagItem* tip_TagItem;
};
struct ExcData {
struct Node ed_Node;
APTR ed_Code;
ULONG ed_Data;
struct TaskPPC* ed_Task;
volatile ULONG ed_Flags;
ULONG ed_ExcID;
ULONG ed_RemovalTime;
ULONG ed_TimeBaseUpper;
ULONG ed_TimeBaseLower;
struct ExcData* ed_LastExc;
};
struct ExcInfo {
struct ExcData ei_ExcData;
struct Node* ei_MachineCheck;
struct Node* ei_DataAccess;
struct Node* ei_InstructionAccess;
struct Node* ei_Alignment;
struct Node* ei_Program;
struct Node* ei_FPUnavailable;
struct Node* ei_Decrementer;
struct Node* ei_SystemCall;
struct Node* ei_Trace;
struct Node* ei_PerfMon;
struct Node* ei_IABR;
struct Node* ei_Interrupt;
};
struct DataMsg {
ULONG dm_Type;
ULONG dm_Value;
ULONG dm_Address;
ULONG dm_LoadType;
ULONG dm_RegNumber;
ULONG dm_LoadFlag;
ULONG dm_IndexedFlag;
};
struct WaitTime {
struct Node wt_Node;
ULONG wt_TimeUpper;
ULONG wt_TimeLower;
struct TaskPPC* wt_Task;
};
struct UInt64 {
ULONG ui_High;
ULONG ui_Low;
};
struct SnoopData {
struct Node sd_Node;
APTR sd_Code;
ULONG sd_Data;
ULONG sd_Type;
};
struct RDFData {
APTR rd_DataStream;
UBYTE rd_Buffer[16];
STRPTR rd_BufPointer;
STRPTR rd_FormatString;
ULONG rd_TruncateNum;
APTR rd_PutChData;
};
struct PrivateTask {
struct TaskPPC pt_Task;
UWORD pt_Pad1;
struct Message* pt_StartMsg;
struct Task* pt_Mirror68K;
struct MsgPort* pt_MirrorPort;
};
struct NewTask {
struct PrivateTask nt_Task;
struct iframe nt_Context;
struct TaskPtr nt_TaskPtr;
UWORD nt_Pad2;
struct MsgPortPPC nt_Port;
ULONG nt_SSReserved1[8]; //Belongs to Semaphore of nt_Port
struct MsgPortPPC nt_IntPort; //Currently not used or set-up. Also removed from functions atm.
ULONG nt_SSReserved2[8]; //Belongs to Sempahore of nt_IntPort
struct BATArray nt_BatStore[4];
UBYTE nt_Name[256];
};