/*---------------------------------------------------------------------------* Project: PPC user-level register definitions. File: ppc_asm_user.h Copyright (C) 2010-2011 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef _PPC_ASM_USER_H_INCLUDED_ #define _PPC_ASM_USER_H_INCLUDED_ #if defined(__GNUC__) && !defined(__ghs__) #ifndef __ASSEMBLER__ __asm__ ( ".equ fp0, 0\n\t" ".equ fp1, 1\n\t" ".equ fp2, 2\n\t" ".equ fp3, 3\n\t" ".equ fp4, 4\n\t" ".equ fp5, 5\n\t" ".equ fp6, 6\n\t" ".equ fp7, 7\n\t" ".equ fp8, 8\n\t" ".equ fp9, 9\n\t" ".equ fp10, 10\n\t" ".equ fp11, 11\n\t" ".equ fp12, 12\n\t" ".equ fp13, 13\n\t" ".equ fp14, 14\n\t" ".equ fp15, 15\n\t" ".equ fp16, 16\n\t" ".equ fp17, 17\n\t" ".equ fp18, 18\n\t" ".equ fp19, 19\n\t" ".equ fp20, 20\n\t" ".equ fp21, 21\n\t" ".equ fp22, 22\n\t" ".equ fp23, 23\n\t" ".equ fp24, 24\n\t" ".equ fp25, 25\n\t" ".equ fp26, 26\n\t" ".equ fp27, 27\n\t" ".equ fp28, 28\n\t" ".equ fp29, 29\n\t" ".equ fp30, 30\n\t" ".equ fp31, 31\n\t" ".equ psr0, 0\n\t" ".equ psr1, 1\n\t" ".equ psr2, 2\n\t" ".equ psr3, 3\n\t" ".equ psr4, 4\n\t" ".equ psr5, 5\n\t" ".equ psr6, 6\n\t" ".equ psr7, 7\n\t" ".equ psr8, 8\n\t" ".equ psr9, 9\n\t" ".equ psr10, 10\n\t" ".equ psr11, 11\n\t" ".equ psr12, 12\n\t" ".equ psr13, 13\n\t" ".equ psr14, 14\n\t" ".equ psr15, 15\n\t" ".equ psr16, 16\n\t" ".equ psr17, 17\n\t" ".equ psr18, 18\n\t" ".equ psr19, 19\n\t" ".equ psr20, 20\n\t" ".equ psr21, 21\n\t" ".equ psr22, 22\n\t" ".equ psr23, 23\n\t" ".equ psr24, 24\n\t" ".equ psr25, 25\n\t" ".equ psr26, 26\n\t" ".equ psr27, 27\n\t" ".equ psr28, 28\n\t" ".equ psr29, 29\n\t" ".equ psr30, 30\n\t" ".equ psr31, 31\n\t" ".equ gqr0, 0\n\t" ".equ gqr1, 1\n\t" ".equ gqr2, 2\n\t" ".equ gqr3, 3\n\t" ".equ gqr4, 4\n\t" ".equ gqr5, 5\n\t" ".equ gqr6, 6\n\t" ".equ gqr7, 7\n\t" ); #endif // __GNUC__ #endif // __ASSEMBLER__ /*---------------------------------------------------------------------------* PIR - Processor Per-Core ID Register (Espresso Only) *---------------------------------------------------------------------------*/ #define PIR 1007 #define PIR_MASK 0x03 #define PIR_MASK_START 30 #define PIR_MASK_END 31 #define PIR_CORE0 0 #define PIR_CORE1 1 #define PIR_CORE2 2 #define CTR 9 // count register #define XER 1 #define LR 8 #define USIA 939 // sampled instruction addr #define UPMC1 937 // performance counters #define UPMC2 938 #define UPMC3 941 #define UPMC4 942 #define PMC1_OV 0x80000000 // Overflow #define PMC1_COUNTER 0x7FFFFFFF // Counter value #define PMC2_OV 0x80000000 // Overflow #define PMC2_COUNTER 0x7FFFFFFF // Counter value #define PMC3_OV 0x80000000 // Overflow #define PMC3_COUNTER 0x7FFFFFFF // Counter value #define PMC4_OV 0x80000000 // Overflow #define PMC4_COUNTER 0x7FFFFFFF // Counter value /*---------------------------------------------------------------------------* PMC1 Events *---------------------------------------------------------------------------*/ #define MMCR0_PMC1_HOLD 0x00000000 // Register holds current value #define MMCR0_PMC1_CYCLE 0x00000040 // Processor cycles #define MMCR0_PMC1_INSTRUCTION 0x00000080 // # of instructions completed. #define MMCR0_PMC1_TRANSITION 0x000000C0 // # of transitions for 0 to 1 #define MMCR0_PMC1_DISPATCHED 0x00000100 // # of instructions dispatched #define MMCR0_PMC1_EIEIO 0x00000140 // # of eieio instructions completed #define MMCR0_PMC1_ITLB_CYCLE 0x00000180 // # of cycles spent performing table search op. for the ITLB #define MMCR0_PMC1_L2_HIT 0x000001C0 // # of access that hit the L2. #define MMCR0_PMC1_EA 0x00000200 // # of valid instruction EAs delivered to the memory subsystem #define MMCR0_PMC1_IABR 0x00000240 // # of time the address of an instruction matches the IABR #define MMCR0_PMC1_L1_MISS 0x00000280 // # of loads that miss the L1 #define MMCR0_PMC1_Bx_UNRESOLVED 0x000002C0 // # of branches that are unresolved when processed #define MMCR0_PMC1_Bx_STALL_CYCLE 0x00000300 // # of cycles that dispatcher stalls due to a second #define MMCR0_PMC1_CIU_LOAD 0x00000500 // # load requests to CIU #define MMCR0_PMC1_BIU_ADDR_ONLY 0x00000540 // # address only requests it BIU #define MMCR0_PMC1_60X_DBEAT 0x000005C0 // # of data beats on bus /*---------------------------------------------------------------------------* PMC2 Events *---------------------------------------------------------------------------*/ #define MMCR0_PMC2_HOLD 0x00000000 // Register holds current value #define MMCR0_PMC2_CYCLE 0x00000001 // Processor cycles #define MMCR0_PMC2_INSTRUCTION 0x00000002 // # of instructions completed #define MMCR0_PMC2_TRANSITION 0x00000003 // # of time-base (lower) bit transitions #define MMCR0_PMC2_DISPATCHED 0x00000004 // # of instructions dispatched #define MMCR0_PMC2_IC_MISS 0x00000005 // # of L1 instruction cache misses #define MMCR0_PMC2_ITLB_MISS 0x00000006 // # of ITLB misses #define MMCR0_PMC2_L2_I_MISS 0x00000007 // # of L2 instruction misses #define MMCR0_PMC2_Bx_FALL_TROUGH 0x00000008 // # of fall-through branches #define MMCR0_PMC2_RESERVED_LOAD 0x0000000A // # of reserved loads completed #define MMCR0_PMC2_LOAD_STORE 0x0000000B // # of completed loads and stores #define MMCR0_PMC2_SNOOP 0x0000000C // # of snoops #define MMCR0_PMC2_L1_CASTOUT 0x0000000D // # of L1 castouts to L2 #define MMCR0_PMC2_SYSTEM 0x0000000E // # of completed system unit instructions #define MMCR0_PMC2_IC_FETCH_MISS 0x0000000F // # of instruction fetch misses in the L1 #define MMCR0_PMC2_Bx_OUT_OF_ORDER 0x00000010 // # of branches allowing out-of-order execution #define MMCR0_PMC2_CIU_STORE 0x00000014 // # store requests to CIU /*---------------------------------------------------------------------------* PMC3 Events *---------------------------------------------------------------------------*/ #define MMCR1_PMC3_HOLD 0x00000000 // Register holds current value #define MMCR1_PMC3_CYCLE 0x08000000 // Processor cycles #define MMCR1_PMC3_INSTRUCTION 0x10000000 // # of instructions completed #define MMCR1_PMC3_TRANSITION 0x18000000 // # of time-base (lower) bit transitions #define MMCR1_PMC3_DISPATCHED 0x20000000 // # of instructions dispatched #define MMCR1_PMC3_DC_MISS 0x28000000 // # of L1 data cache misses #define MMCR1_PMC3_DTLB_MISS 0x30000000 // # of DTLB misses #define MMCR1_PMC3_L2_D_MISS 0x38000000 // # of L2 data misses #define MMCR1_PMC3_Bx_TAKEN 0x40000000 // # predicted branches that were taken #define MMCR1_PMC3_COND_STORE 0x50000000 // # of store conditional instructions completed #define MMCR1_PMC3_FPU 0x58000000 // # of instructions completed from the FPU #define MMCR1_PMC3_L2_SNOOP_CASTOUT 0x60000000 // # of L2 castout caused by snoops to modified lines #define MMCR1_PMC3_L2_HIT 0x68000000 // # of cache operations that hit in the L2 cache #define MMCR1_PMC3_L1_MISS_CYCLE 0x78000000 // # of cycles generated by L1 load misses #define MMCR1_PMC3_Bx_SECOND 0x80000000 // # of branches in the second speculative branch resolved correctly #define MMCR1_PMC3_BPU_LR_CR 0x88000000 // # of cycles the BPU stalls due to LR or CR unresolved dependencies #define MMCR1_PMC3_CIU_ADDR_ONLY 0xa0000000 // # address-only requests to CIU #define MMCR1_PMC3_BIU_LOAD 0xa8000000 // # loads requests to BIU /*---------------------------------------------------------------------------* PMC4 Events *---------------------------------------------------------------------------*/ #define MMCR1_PMC4_HOLD 0x00000000 // Register holds current value #define MMCR1_PMC4_CYCLE 0x00400000 // Processor cycles #define MMCR1_PMC4_INSTRUCTION 0x00800000 // # of instructions completed #define MMCR1_PMC4_TRANSITION 0x00C00000 // # of time-base (lower) bit transitions #define MMCR1_PMC4_DISPATCHED 0x01000000 // # of instructions dispatched #define MMCR1_PMC4_L2_CASTOUT 0x01400000 // # of L2 castouts #define MMCR1_PMC4_DTLB_CYCLE 0x01800000 // # of cycles spent performing table searches for DTLB accesses #define MMCR1_PMC4_Bx_MISSED 0x02000000 // # of mispredicted branches #define MMCR1_PMC4_COND_STORE_INT 0x02800000 // # of store conditional instructions completed // with reservation intact #define MMCR1_PMC4_SYNC 0x02C00000 // # of completed sync instructions #define MMCR1_PMC4_SNOOP_RETRY 0x03000000 // # of snoop request retries #define MMCR1_PMC4_INTEGER 0x03400000 // # of completed integer operations #define MMCR1_PMC4_BPU_THIRD 0x03800000 // # of cycles the BPU cannot process new branches #define MMCR1_PMC4_L2_INTERV 0x04000000 // L2 interventions #define MMCR1_PMC4_TLB_SNOOP 0x04400000 // tlbie snoops #define MMCR1_PMC4_BIU_STORE 0x05400000 // BIU stores // due to having two unresolved branches #define UMMCR0 936 // monitor control #define UMMCR1 940 #define UTBU 269 // time base upper #define UTBL 268 // lower #define UGQR0 896 // quantization registers #define UGQR1 897 #define UGQR2 898 #define UGQR3 899 #define UGQR4 900 #define UGQR5 901 #define UGQR6 902 #define UGQR7 903 #define GQR_LOAD_SCALE_MASK 0x3F000000 // load scale field #define GQR_LOAD_TYPE_MASK 0x00070000 // load type field #define GQR_STORE_SCALE_MASK 0x00003F00 // store scale field #define GQR_STORE_TYPE_MASK 0x00000007 // store type field #define UHID2 904 // user HID2 #define UWPAR 905 // write gather pipe #define UDMAU 906 // user mode DMA registers #define UDMAL 907 #endif // _PPC_ASM_USER_H_INCLUDED_