1#ifndef _DOLPHIN_PPCARCH
2#define _DOLPHIN_PPCARCH
4#ifdef __REVOLUTION_SDK__
108#define MSR_POW 0x00040000
109#define MSR_ILE 0x00010000
110#define MSR_EE 0x00008000
111#define MSR_PR 0x00004000
112#define MSR_FP 0x00002000
113#define MSR_ME 0x00001000
114#define MSR_FE0 0x00000800
115#define MSR_SE 0x00000400
116#define MSR_BE 0x00000200
117#define MSR_FE1 0x00000100
118#define MSR_IP 0x00000040
119#define MSR_IR 0x00000020
120#define MSR_DR 0x00000010
121#define MSR_PM 0x00000004
122#define MSR_RI 0x00000002
123#define MSR_LE 0x00000001
125#define MSR_POW_BIT 13
126#define MSR_ILE_BIT 15
131#define MSR_FE0_BIT 20
134#define MSR_FE1_BIT 23
145#define HID0_EMCP 0x80000000u
146#define HID0_DBP 0x40000000u
147#define HID0_EBA 0x20000000u
148#define HID0_EBD 0x10000000u
149#define HID0_BCLK 0x08000000u
150#define HID0_ECLK 0x02000000u
151#define HID0_PAR 0x01000000u
152#define HID0_DOZE 0x00800000u
153#define HID0_NAP 0x00400000u
154#define HID0_SLEEP 0x00200000u
155#define HID0_DPM 0x00100000u
156#define HID0_NHR 0x00010000u
157#define HID0_ICE 0x00008000u
158#define HID0_DCE 0x00004000u
159#define HID0_ILOCK 0x00002000u
160#define HID0_DLOCK 0x00001000u
161#define HID0_ICFI 0x00000800u
162#define HID0_DCFI 0x00000400u
163#define HID0_SPD 0x00000200u
164#define HID0_IFEM 0x00000100u
165#define HID0_SGE 0x00000080u
166#define HID0_DCFA 0x00000040u
167#define HID0_BTIC 0x00000020u
168#define HID0_ABE 0x00000008u
169#define HID0_BHT 0x00000004u
170#define HID0_NOOPTI 0x00000001u
172#define HID0_ICE_BIT 16
173#define HID0_DCE_BIT 17
174#define HID0_ILOCK_BIT 18
175#define HID0_DLOCK_BIT 19
177#define HID2_LSQE 0x80000000
178#define HID2_WPE 0x40000000
179#define HID2_PSE 0x20000000
180#define HID2_LCE 0x10000000
182#define HID2_DCHERR 0x00800000
183#define HID2_DNCERR 0x00400000
184#define HID2_DCMERR 0x00200000
185#define HID2_DQOERR 0x00100000
186#define HID2_DCHEE 0x00080000
187#define HID2_DNCEE 0x00040000
188#define HID2_DCMEE 0x00020000
189#define HID2_DQOEE 0x00010000
191#define HID2_DMAQL_MASK 0x0F000000
192#define HID2_DMAQL_SHIFT 24
194#define HID2_LSQE_BIT 0
195#define HID2_WPE_BIT 1
196#define HID2_PSE_BIT 2
197#define HID2_LCE_BIT 3
199#define HID2_DCHERR_BIT 8
200#define HID2_DNCERR_BIT 9
201#define HID2_DCMERR_BIT 10
202#define HID2_DQOERR_BIT 11
203#define HID2_DCHEE_BIT 12
204#define HID2_DNCEE_BIT 13
205#define HID2_DCMEE_BIT 14
206#define HID2_DQOEE_BIT 15
208#define GQR_LOAD_SCALE_MASK 0x3F000000
209#define GQR_LOAD_TYPE_MASK 0x00070000
210#define GQR_STORE_SCALE_MASK 0x00003F00
211#define GQR_STORE_TYPE_MASK 0x00000007
232#define DMA_U_ADDR_MASK 0xFFFFFFE0
233#define DMA_U_LEN_U_MASK 0x0000001F
235#define DMA_L_LC_ADDR_MASK 0xFFFFFFE0
236#define DMA_L_LOAD 0x00000010
237#define DMA_L_STORE 0x00000000
238#define DMA_L_LEN_MASK 0x0000000C
239#define DMA_L_TRIGGER 0x00000002
240#define DMA_L_FLUSH 0x00000001
272#define WPAR_ADDR 0xFFFFFFE0
273#define WPAR_BNE 0x00000001
275#define SRR1_DMA_BIT 0x00200000
276#define SRR1_L2DP_BIT 0x00100000
278#define L2CR_L2E 0x80000000
279#define L2CR_L2PE 0x40000000
281#define L2CR_L2SIZ_256K 0x10000000
282#define L2CR_L2SIZ_512K 0x20000000
283#define L2CR_L2SIZ_1M 0x30000000
285#define L2CR_L2CLK_1_0 0x02000000
286#define L2CR_L2CLK_1_5 0x04000000
287#define L2CR_L2CLK_2_0 0x08000000
288#define L2CR_L2CLK_2_5 0x0A000000
289#define L2CR_L2CLK_3_0 0x0C000000
291#define L2CR_RAM_FLOW_THRU_BURST 0x00000000
292#define L2CR_RAM_PIPELINE_BURST 0x01000000
293#define L2CR_RAM_PIPELINE_LATE 0x01800000
295#define L2CR_L2DO 0x00400000
296#define L2CR_L2I 0x00200000
297#define L2CR_L2CTL 0x00100000
298#define L2CR_L2WT 0x00080000
299#define L2CR_L2TS 0x00040000
301#define L2CR_L2OH_0_5 0x00000000
302#define L2CR_L2OH_1_0 0x00010000
304#define L2CR_L2SL 0x00008000
305#define L2CR_L2DF 0x00004000
306#define L2CR_L2BYP 0x00002000
307#define L2CR_L2CS 0x00000200
308#define L2CR_L2DRO 0x00000100
309#define L2CR_L2CTR_MASK 0x000000FE
310#define L2CR_L2IP 0x00000001
312#define MMCR0_DIS 0x80000000
313#define MMCR0_DP 0x40000000
314#define MMCR0_DU 0x20000000
315#define MMCR0_DMS 0x10000000
316#define MMCR0_DMR 0x08000000
317#define MMCR0_ENINT 0x04000000
318#define MMCR0_DISCOUNT 0x02000000
319#define MMCR0_RTCSELECT_MASK 0x01800000
320#define MMCR0_RTCSELECT_63 0x00000000
321#define MMCR0_RTCSELECT_55 0x00800000
322#define MMCR0_RTCSELECT_51 0x01000000
323#define MMCR0_RTCSELECT_47 0x01800000
324#define MMCR0_INTONBITTRANS 0x00400000
325#define MMCR0_THRESHOLD_MASK 0x003F0000
326#define MMCR0_THRESHOLD(n) ((n) << 16)
327#define MMCR0_PMC1INTCONTROL 0x00008000
328#define MMCR0_PMC2INTCONTROL 0x00004000
329#define MMCR0_PMCTRIGGER 0x00002000
330#define MMCR0_PMC1SELECT_MASK 0x00001FC0
331#define MMCR0_PMC2SELECT_MASK 0x0000003F
333#define MMCR1_PMC3SELECT_MASK 0xF8000000
334#define MMCR1_PMC4SELECT_MASK 0x07C00000
336#define PMC1_OV 0x80000000
337#define PMC1_COUNTER 0x7FFFFFFF
338#define PMC2_OV 0x80000000
339#define PMC2_COUNTER 0x7FFFFFFF
340#define PMC3_OV 0x80000000
341#define PMC3_COUNTER 0x7FFFFFFF
342#define PMC4_OV 0x80000000
343#define PMC4_COUNTER 0x7FFFFFFF
348#define MMCR0_PMC1_HOLD 0x00000000
349#define MMCR0_PMC1_CYCLE 0x00000040
350#define MMCR0_PMC1_INSTRUCTION 0x00000080
351#define MMCR0_PMC1_TRANSITION 0x000000C0
352#define MMCR0_PMC1_DISPATCHED 0x00000100
353#define MMCR0_PMC1_EIEIO 0x00000140
354#define MMCR0_PMC1_ITLB_CYCLE 0x00000180
355#define MMCR0_PMC1_L2_HIT 0x000001C0
356#define MMCR0_PMC1_EA 0x00000200
357#define MMCR0_PMC1_IABR 0x00000240
358#define MMCR0_PMC1_L1_MISS 0x00000280
359#define MMCR0_PMC1_Bx_UNRESOLVED 0x000002C0
360#define MMCR0_PMC1_Bx_STALL_CYCLE 0x00000300
362#define MMCR0_PMC1_IC_FETCH_MISS 0x00000340
363#define MMCR0_PMC2_HOLD 0x00000000
364#define MMCR0_PMC2_CYCLE 0x00000001
365#define MMCR0_PMC2_INSTRUCTION 0x00000002
366#define MMCR0_PMC2_TRANSITION 0x00000003
367#define MMCR0_PMC2_DISPATCHED 0x00000004
368#define MMCR0_PMC2_IC_MISS 0x00000005
369#define MMCR0_PMC2_ITLB_MISS 0x00000006
370#define MMCR0_PMC2_L2_I_MISS 0x00000007
371#define MMCR0_PMC2_Bx_FALL_TROUGH 0x00000008
372#define MMCR0_PMC2_PR_SWITCH 0x00000009
373#define MMCR0_PMC2_RESERVED_LOAD 0x0000000A
374#define MMCR0_PMC2_LOAD_STORE 0x0000000B
375#define MMCR0_PMC2_SNOOP 0x0000000C
376#define MMCR0_PMC2_L1_CASTOUT 0x0000000D
377#define MMCR0_PMC2_SYSTEM 0x0000000E
378#define MMCR0_PMC2_IC_FETCH_MISS 0x0000000F
379#define MMCR0_PMC2_Bx_OUT_OF_ORDER 0x00000010
384#define MMCR1_PMC3_HOLD 0x00000000
385#define MMCR1_PMC3_CYCLE 0x08000000
386#define MMCR1_PMC3_INSTRUCTION 0x10000000
387#define MMCR1_PMC3_TRANSITION 0x18000000
388#define MMCR1_PMC3_DISPATCHED 0x20000000
389#define MMCR1_PMC3_DC_MISS 0x28000000
390#define MMCR1_PMC3_DTLB_MISS 0x30000000
391#define MMCR1_PMC3_L2_D_MISS 0x38000000
392#define MMCR1_PMC3_Bx_TAKEN 0x40000000
393#define MMCR1_PMC3_PM_SWITCH 0x48000000
394#define MMCR1_PMC3_COND_STORE 0x50000000
395#define MMCR1_PMC3_FPU 0x58000000
396#define MMCR1_PMC3_L2_SNOOP_CASTOUT 0x60000000
397#define MMCR1_PMC3_L2_HIT 0x68000000
398#define MMCR1_PMC3_L1_MISS_CYCLE 0x78000000
399#define MMCR1_PMC3_Bx_SECOND 0x80000000
401#define MMCR1_PMC3_BPU_LR_CR 0x88000000
404#define MMCR1_PMC4_HOLD 0x00000000
405#define MMCR1_PMC4_CYCLE 0x00400000
406#define MMCR1_PMC4_INSTRUCTION 0x00800000
407#define MMCR1_PMC4_TRANSITION 0x00C00000
408#define MMCR1_PMC4_DISPATCHED 0x01000000
409#define MMCR1_PMC4_L2_CASTOUT 0x01400000
410#define MMCR1_PMC4_DTLB_CYCLE 0x01800000
411#define MMCR1_PMC4_Bx_MISSED 0x02000000
412#define MMCR1_PMC4_COND_STORE_INT 0x02800000
414#define MMCR1_PMC4_SYNC 0x02C00000
415#define MMCR1_PMC4_SNOOP_RETRY 0x03000000
416#define MMCR1_PMC4_INTEGER 0x03400000
417#define MMCR1_PMC4_BPU_THIRD 0x03800000
419#define MMCR1_PMC4_DC_MISS 0x07C00000
425#define FPSCR_FX 0x80000000
426#define FPSCR_FEX 0x40000000
427#define FPSCR_VX 0x20000000
428#define FPSCR_OX 0x10000000
429#define FPSCR_UX 0x08000000
430#define FPSCR_ZX 0x04000000
431#define FPSCR_XX 0x02000000
432#define FPSCR_VXSNAN 0x01000000
433#define FPSCR_VXISI 0x00800000
434#define FPSCR_VXIDI 0x00400000
435#define FPSCR_VXZDZ 0x00200000
436#define FPSCR_VXIMZ 0x00100000
437#define FPSCR_VXVC 0x00080000
438#define FPSCR_FR 0x00040000
439#define FPSCR_FI 0x00020000
440#define FPSCR_VXSOFT 0x00000400
441#define FPSCR_VXSQRT 0x00000200
442#define FPSCR_VXCVI 0x00000100
443#define FPSCR_VE 0x00000080
444#define FPSCR_OE 0x00000040
445#define FPSCR_UE 0x00000020
446#define FPSCR_ZE 0x00000010
447#define FPSCR_XE 0x00000008
448#define FPSCR_NI 0x00000004
452#define FPSCR_FX_BIT 0
453#define FPSCR_FEX_BIT 1
454#define FPSCR_VX_BIT 2
455#define FPSCR_OX_BIT 3
456#define FPSCR_UX_BIT 4
457#define FPSCR_ZX_BIT 5
458#define FPSCR_XX_BIT 6
459#define FPSCR_VXSNAN_BIT 7
460#define FPSCR_VXISI_BIT 8
461#define FPSCR_VXIDI_BIT 9
462#define FPSCR_VXZDZ_BIT 10
463#define FPSCR_VXIMZ_BIT 11
464#define FPSCR_VXVC_BIT 12
465#define FPSCR_FR_BIT 13
466#define FPSCR_FI_BIT 14
467#define FPSCR_VXSOFT_BIT 21
468#define FPSCR_VXSQRT_BIT 22
469#define FPSCR_VXCVI_BIT 23
470#define FPSCR_VE_BIT 24
471#define FPSCR_OE_BIT 25
472#define FPSCR_UE_BIT 26
473#define FPSCR_ZE_BIT 27
474#define FPSCR_XE_BIT 28
475#define FPSCR_NI_BIT 29
void PPCMtfpscr(u32 newFPSCR)
u32 PPCMfpmc1()
Definition PPCArch.c:136
void PPCDisableSpeculation()
Definition PPCArch.c:278
u32 PPCMffpscr()
Definition PPCArch.c:196
void PMInstructions(void)
Definition PPCPm.c:32
u32 PPCMfl2cr()
Definition PPCArch.c:55
u32 PPCMfpmc2(void)
Definition PPCArch.c:148
u32 PPCMfsia()
Definition PPCArch.c:184
void PPCMtdec(u32 newDec)
u32 PPCAndCMsr(u32 value)
void PPCMtmsr(u32 newMSR)
void PPCMtmmcr1(u32 newMmcr0)
void PMEnd(void)
Definition PPCPm.c:15
u32 PPCMfdec(void)
Definition PPCArch.c:73
void PPCMtwpar(u32 newwpar)
u32 PPCMfwpar()
Definition PPCArch.c:231
void PMBegin(void)
Definition PPCPm.c:4
void PPCMtpmc4(u32 newPmc1)
u32 PPCMfdmaU()
Definition PPCArch.c:244
u32 PPCMfhid2()
Definition PPCArch.c:219
void PMCycles(void)
Definition PPCPm.c:20
void PML1FetchMisses(void)
Definition PPCPm.c:24
void PML1MissCycles(void)
Definition PPCPm.c:28
u32 PPCMfdmaL()
Definition PPCArch.c:250
u32 PPCMfpmc3()
Definition PPCArch.c:160
u32 PPCMfpmc4()
Definition PPCArch.c:172
u32 PPCMfmmcr0()
Definition PPCArch.c:112
u32 PPCMfhid0()
Definition PPCArch.c:37
void PPCMthid0(u32 newHID0)
void PPCMtpmc2(u32 newPmc1)
void PPCSync()
Definition PPCArch.c:79
void PPCMtpmc3(u32 newPmc1)
void PPCEieio()
Definition PPCArch.c:85
void PPCMtmmcr0(u32 newMmcr0)
u32 PPCMfmsr()
Definition PPCArch.c:4
u32 PPCMfpvr()
Definition PPCArch.c:268
void PPCMtsia(u32 newSia)
void PPCSetFpIEEEMode()
Definition PPCArch.c:282
void PPCSetFpNonIEEEMode()
Definition PPCArch.c:288
void PPCHalt()
Definition PPCArch.c:102
u32 PPCMfhid1()
Definition PPCArch.c:49
void PPCMthid2(u32 newhid2)
void PPCMtdmaL(u32 newdmal)
void PPCMtpmc1(u32 newPmc1)
u32 PPCMfmmcr1()
Definition PPCArch.c:124
void PPCEnableSpeculation()
Definition PPCArch.c:274
void PPCMtdmaU(u32 newdmau)
void PPCMtl2cr(u32 newL2cr)
unsigned long u32
Definition types.h:12
double f64
Definition types.h:26
u32 dmaFlush
Definition PPCArch.h:261
u32 dmaTrigger
Definition PPCArch.h:260
u32 lcAddr
Definition PPCArch.h:257
u32 dmaLenL
Definition PPCArch.h:259
u32 dmaLd
Definition PPCArch.h:258
u32 dmaLenU
Definition PPCArch.h:245
u32 memAddr
Definition PPCArch.h:244
u32 loadType
Definition PPCArch.h:218
u32 storeType
Definition PPCArch.h:222
u32 storeScale
Definition PPCArch.h:220
u32 _pad1
Definition PPCArch.h:217
u32 _pad2
Definition PPCArch.h:219
u32 _pad0
Definition PPCArch.h:215
u32 loadScale
Definition PPCArch.h:216
u32 _pad3
Definition PPCArch.h:221
struct FpscrUnion::@129 u
f64 f
Definition PPCArch.h:479
u32 fpscr
Definition PPCArch.h:482
u32 fpscr_pad
Definition PPCArch.h:481
u32 val
Definition PPCArch.h:267
PPC_DMA_L_t f
Definition PPCArch.h:268
PPC_DMA_U_t f
Definition PPCArch.h:251
u32 val
Definition PPCArch.h:250
u32 val
Definition PPCArch.h:227
PPC_GQR_t f
Definition PPCArch.h:228