PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ee_cop0_defs.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright (c) 2009 PS2DEV.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __EE_COP0_DEFS_H__
17#define __EE_COP0_DEFS_H__
18
19#define M_EE_GET_CAUSE_EXCODE(__cause) (((__cause) >> 2) & 0x1F)
20#define M_EE_GET_CAUSE_EXC2(__cause) (((__cause) >> 16) & 0x7)
21
22// EE COP0 Register name defs
23#define EE_COP0_Index $0
24#define EE_COP0_Random $1
25#define EE_COP0_EntryLo0 $2
26#define EE_COP0_EntryLo1 $3
27#define EE_COP0_Context $4
28#define EE_COP0_Wired $5
29#define EE_COP0_BadVAddr $8
30#define EE_COP0_Count $9
31#define EE_COP0_EntryHi $10
32#define EE_COP0_Compare $11
33#define EE_COP0_Status $12
34#define EE_COP0_Cause $13
35#define EE_COP0_EPC $14
36#define EE_COP0_PRId $15
37#define EE_COP0_Config $16
38#define EE_COP0_BadPAddr $23
39#define EE_COP0_TagLo $28
40#define EE_COP0_TagHi $29
41#define EE_COP0_ErrorEPC $30
42
43// Bits for COP0 "Status" register.
44#define EE_STATUS_IE (1 << 0)
45#define EE_STATUS_EXL (1 << 1)
46#define EE_STATUS_ERL (1 << 2)
47
48#define EE_EXC2_RST (0)
49#define EE_EXC2_NMI (1)
50#define EE_EXC2_PERF (2)
51#define EE_EXC2_DBG (3)
52
53// Bits for COP0 "Cause" register.
54#define EE_CAUSE_BD (1 << 31)
55#define EE_CAUSE_BD2 (1 << 30)
56
58#define EE_CAUSE_SIO (1 << 12)
59
60// Bits in EE Cop0 Breakpoint Control(BPC)
61
62/* Instruction Address breakpoint Enable */
63#define EE_BPC_IAE (1 << 31)
64
65/* Data Read breakpoint Enable */
66#define EE_BPC_DRE (1 << 30)
67
68/* Data Write breakpoint Enable */
69#define EE_BPC_DWE (1 << 29)
70
71/* Data Value breakpoint Enable */
72#define EE_BPC_DVE (1 << 28)
73
74/* Instruction address breakpoint - User mode Enable */
75#define EE_BPC_IUE (1 << 26)
76
77/* Instruction address breakpoint - Supervisor mode Enable */
78#define EE_BPC_ISE (1 << 25)
79
80/* Instruction address breakpoint - Kernel mode Enable */
81#define EE_BPC_IKE (1 << 24)
82
83/* Instruction address breakpoint - EXL mode Enable */
84#define EE_BPC_IXE (1 << 23)
85
86/* Data breakpoint - User mode Enable */
87#define EE_BPC_DUE (1 << 21)
88
89/* Data breakpoint - Supervisor mode Enable */
90#define EE_BPC_DSE (1 << 20)
91
92/* Data breakpoint - Kernel mode Enable */
93#define EE_BPC_DKE (1 << 19)
94
95/* Data breakpoint - EXL mode Enable */
96#define EE_BPC_DXE (1 << 18)
97
98/* Instruction address breakpoint - Trigger generation Enable */
99#define EE_BPC_ITE (1 << 17)
100
101/* Data breakpoint - Trigger generation Enable */
102#define EE_BPC_DTE (1 << 16)
103
104/* Breakpoint Exception Disable */
105#define EE_BPC_BED (1 << 15)
106
107/* Data Write Breakpoint establishment flag */
108#define EE_BPC_DWB (1 << 2)
109
110/* Data Read Breakpoint establishment flag */
111#define EE_BPC_DRB (1 << 1)
112
113/* Instruction Address Breakpoint */
114#define EE_BPC_IAB (1 << 0)
115
116#endif /* __EE_COP0_DEFS_H__ */