root / target-mips / cpu.h @ 388bb21a
History | View | Annotate | Download (10.7 kB)
1 | 6af0bf9c | bellard | #if !defined (__MIPS_CPU_H__)
|
---|---|---|---|
2 | 6af0bf9c | bellard | #define __MIPS_CPU_H__
|
3 | 6af0bf9c | bellard | |
4 | 4ad40f36 | bellard | #define TARGET_HAS_ICE 1 |
5 | 4ad40f36 | bellard | |
6 | 9042c0e2 | ths | #define ELF_MACHINE EM_MIPS
|
7 | 9042c0e2 | ths | |
8 | c5d6edc3 | bellard | #include "config.h" |
9 | 6af0bf9c | bellard | #include "mips-defs.h" |
10 | 6af0bf9c | bellard | #include "cpu-defs.h" |
11 | 6af0bf9c | bellard | #include "softfloat.h" |
12 | 6af0bf9c | bellard | |
13 | fdbb4691 | bellard | // uint_fast8_t and uint_fast16_t not in <sys/int_types.h>
|
14 | fdbb4691 | bellard | // XXX: move that elsewhere
|
15 | 36bb244b | ths | #if defined(HOST_SOLARIS) && HOST_SOLARIS < 10 |
16 | fdbb4691 | bellard | typedef unsigned char uint_fast8_t; |
17 | fdbb4691 | bellard | typedef unsigned int uint_fast16_t; |
18 | fdbb4691 | bellard | #endif
|
19 | fdbb4691 | bellard | |
20 | 6af0bf9c | bellard | typedef union fpr_t fpr_t; |
21 | 6af0bf9c | bellard | union fpr_t {
|
22 | 6ea83fed | bellard | float64 fd; /* ieee double precision */
|
23 | 6ea83fed | bellard | float32 fs[2];/* ieee single precision */ |
24 | 5a5012ec | ths | uint64_t d; /* binary double fixed-point */
|
25 | 6ea83fed | bellard | uint32_t w[2]; /* binary single fixed-point */ |
26 | 6af0bf9c | bellard | }; |
27 | 6ea83fed | bellard | /* define FP_ENDIAN_IDX to access the same location
|
28 | 6ea83fed | bellard | * in the fpr_t union regardless of the host endianess
|
29 | 6ea83fed | bellard | */
|
30 | 6ea83fed | bellard | #if defined(WORDS_BIGENDIAN)
|
31 | 6ea83fed | bellard | # define FP_ENDIAN_IDX 1 |
32 | 6ea83fed | bellard | #else
|
33 | 6ea83fed | bellard | # define FP_ENDIAN_IDX 0 |
34 | 6ea83fed | bellard | #endif
|
35 | 6af0bf9c | bellard | |
36 | 29929e34 | ths | typedef struct r4k_tlb_t r4k_tlb_t; |
37 | 29929e34 | ths | struct r4k_tlb_t {
|
38 | 6af0bf9c | bellard | target_ulong VPN; |
39 | 9c2149c8 | ths | uint32_t PageMask; |
40 | 98c1b82b | pbrook | uint_fast8_t ASID; |
41 | 98c1b82b | pbrook | uint_fast16_t G:1;
|
42 | 98c1b82b | pbrook | uint_fast16_t C0:3;
|
43 | 98c1b82b | pbrook | uint_fast16_t C1:3;
|
44 | 98c1b82b | pbrook | uint_fast16_t V0:1;
|
45 | 98c1b82b | pbrook | uint_fast16_t V1:1;
|
46 | 98c1b82b | pbrook | uint_fast16_t D0:1;
|
47 | 98c1b82b | pbrook | uint_fast16_t D1:1;
|
48 | 6af0bf9c | bellard | target_ulong PFN[2];
|
49 | 6af0bf9c | bellard | }; |
50 | 6af0bf9c | bellard | |
51 | 6af0bf9c | bellard | typedef struct CPUMIPSState CPUMIPSState; |
52 | 6af0bf9c | bellard | struct CPUMIPSState {
|
53 | 6af0bf9c | bellard | /* General integer registers */
|
54 | 6af0bf9c | bellard | target_ulong gpr[32];
|
55 | 6af0bf9c | bellard | /* Special registers */
|
56 | 6af0bf9c | bellard | target_ulong PC; |
57 | c570fd16 | ths | #if TARGET_LONG_BITS > HOST_LONG_BITS
|
58 | c570fd16 | ths | target_ulong t0; |
59 | c570fd16 | ths | target_ulong t1; |
60 | c570fd16 | ths | target_ulong t2; |
61 | c570fd16 | ths | #endif
|
62 | c570fd16 | ths | target_ulong HI, LO; |
63 | 6af0bf9c | bellard | /* Floating point registers */
|
64 | f7cfb2a1 | ths | fpr_t fpr[32];
|
65 | 6ea83fed | bellard | #ifndef USE_HOST_FLOAT_REGS
|
66 | 6ea83fed | bellard | fpr_t ft0; |
67 | 6ea83fed | bellard | fpr_t ft1; |
68 | 6ea83fed | bellard | fpr_t ft2; |
69 | 6ea83fed | bellard | #endif
|
70 | 6ea83fed | bellard | float_status fp_status; |
71 | 5a5012ec | ths | /* fpu implementation/revision register (fir) */
|
72 | 6af0bf9c | bellard | uint32_t fcr0; |
73 | 5a5012ec | ths | #define FCR0_F64 22 |
74 | 5a5012ec | ths | #define FCR0_L 21 |
75 | 5a5012ec | ths | #define FCR0_W 20 |
76 | 5a5012ec | ths | #define FCR0_3D 19 |
77 | 5a5012ec | ths | #define FCR0_PS 18 |
78 | 5a5012ec | ths | #define FCR0_D 17 |
79 | 5a5012ec | ths | #define FCR0_S 16 |
80 | 5a5012ec | ths | #define FCR0_PRID 8 |
81 | 5a5012ec | ths | #define FCR0_REV 0 |
82 | 6ea83fed | bellard | /* fcsr */
|
83 | 6ea83fed | bellard | uint32_t fcr31; |
84 | 5a5012ec | ths | #define SET_FP_COND(num,env) do { (env->fcr31) |= ((num) ? (1 << ((num) + 24)) : (1 << ((num) + 23))); } while(0) |
85 | 5a5012ec | ths | #define CLEAR_FP_COND(num,env) do { (env->fcr31) &= ~((num) ? (1 << ((num) + 24)) : (1 << ((num) + 23))); } while(0) |
86 | 5a5012ec | ths | #define IS_FP_COND_SET(num,env) (((env->fcr31) & ((num) ? (1 << ((num) + 24)) : (1 << ((num) + 23)))) != 0) |
87 | 5a5012ec | ths | #define GET_FP_CAUSE(reg) (((reg) >> 12) & 0x3f) |
88 | 5a5012ec | ths | #define GET_FP_ENABLE(reg) (((reg) >> 7) & 0x1f) |
89 | 5a5012ec | ths | #define GET_FP_FLAGS(reg) (((reg) >> 2) & 0x1f) |
90 | 5a5012ec | ths | #define SET_FP_CAUSE(reg,v) do { (reg) = ((reg) & ~(0x3f << 12)) | ((v & 0x3f) << 12); } while(0) |
91 | 5a5012ec | ths | #define SET_FP_ENABLE(reg,v) do { (reg) = ((reg) & ~(0x1f << 7)) | ((v & 0x1f) << 7); } while(0) |
92 | 5a5012ec | ths | #define SET_FP_FLAGS(reg,v) do { (reg) = ((reg) & ~(0x1f << 2)) | ((v & 0x1f) << 2); } while(0) |
93 | 5a5012ec | ths | #define UPDATE_FP_FLAGS(reg,v) do { (reg) |= ((v & 0x1f) << 2); } while(0) |
94 | 6ea83fed | bellard | #define FP_INEXACT 1 |
95 | 6ea83fed | bellard | #define FP_UNDERFLOW 2 |
96 | 6ea83fed | bellard | #define FP_OVERFLOW 4 |
97 | 6ea83fed | bellard | #define FP_DIV0 8 |
98 | 6ea83fed | bellard | #define FP_INVALID 16 |
99 | 6ea83fed | bellard | #define FP_UNIMPLEMENTED 32 |
100 | 36d23958 | ths | |
101 | fcb4a419 | ths | uint32_t nb_tlb; |
102 | 29929e34 | ths | uint32_t tlb_in_use; |
103 | 29929e34 | ths | int (*map_address) (CPUMIPSState *env, target_ulong *physical, int *prot, target_ulong address, int rw, int access_type); |
104 | 29929e34 | ths | void (*do_tlbwi) (void); |
105 | 29929e34 | ths | void (*do_tlbwr) (void); |
106 | 29929e34 | ths | void (*do_tlbp) (void); |
107 | 29929e34 | ths | void (*do_tlbr) (void); |
108 | 29929e34 | ths | union {
|
109 | 29929e34 | ths | struct {
|
110 | 29929e34 | ths | r4k_tlb_t tlb[MIPS_TLB_MAX]; |
111 | 29929e34 | ths | } r4k; |
112 | 29929e34 | ths | } mmu; |
113 | 29929e34 | ths | |
114 | 9c2149c8 | ths | int32_t CP0_Index; |
115 | 9c2149c8 | ths | int32_t CP0_Random; |
116 | 9c2149c8 | ths | target_ulong CP0_EntryLo0; |
117 | 9c2149c8 | ths | target_ulong CP0_EntryLo1; |
118 | 9c2149c8 | ths | target_ulong CP0_Context; |
119 | 9c2149c8 | ths | int32_t CP0_PageMask; |
120 | 9c2149c8 | ths | int32_t CP0_PageGrain; |
121 | 9c2149c8 | ths | int32_t CP0_Wired; |
122 | 9c2149c8 | ths | int32_t CP0_HWREna; |
123 | c570fd16 | ths | target_ulong CP0_BadVAddr; |
124 | 9c2149c8 | ths | int32_t CP0_Count; |
125 | 9c2149c8 | ths | target_ulong CP0_EntryHi; |
126 | 9c2149c8 | ths | int32_t CP0_Compare; |
127 | 9c2149c8 | ths | int32_t CP0_Status; |
128 | 6af0bf9c | bellard | #define CP0St_CU3 31 |
129 | 6af0bf9c | bellard | #define CP0St_CU2 30 |
130 | 6af0bf9c | bellard | #define CP0St_CU1 29 |
131 | 6af0bf9c | bellard | #define CP0St_CU0 28 |
132 | 6af0bf9c | bellard | #define CP0St_RP 27 |
133 | 6ea83fed | bellard | #define CP0St_FR 26 |
134 | 6af0bf9c | bellard | #define CP0St_RE 25 |
135 | 7a387fff | ths | #define CP0St_MX 24 |
136 | 7a387fff | ths | #define CP0St_PX 23 |
137 | 6af0bf9c | bellard | #define CP0St_BEV 22 |
138 | 6af0bf9c | bellard | #define CP0St_TS 21 |
139 | 6af0bf9c | bellard | #define CP0St_SR 20 |
140 | 6af0bf9c | bellard | #define CP0St_NMI 19 |
141 | 6af0bf9c | bellard | #define CP0St_IM 8 |
142 | 7a387fff | ths | #define CP0St_KX 7 |
143 | 7a387fff | ths | #define CP0St_SX 6 |
144 | 7a387fff | ths | #define CP0St_UX 5 |
145 | 6af0bf9c | bellard | #define CP0St_UM 4 |
146 | 7a387fff | ths | #define CP0St_R0 3 |
147 | 6af0bf9c | bellard | #define CP0St_ERL 2 |
148 | 6af0bf9c | bellard | #define CP0St_EXL 1 |
149 | 6af0bf9c | bellard | #define CP0St_IE 0 |
150 | 9c2149c8 | ths | int32_t CP0_IntCtl; |
151 | 9c2149c8 | ths | int32_t CP0_SRSCtl; |
152 | 9c2149c8 | ths | int32_t CP0_SRSMap; |
153 | 9c2149c8 | ths | int32_t CP0_Cause; |
154 | 7a387fff | ths | #define CP0Ca_BD 31 |
155 | 7a387fff | ths | #define CP0Ca_TI 30 |
156 | 7a387fff | ths | #define CP0Ca_CE 28 |
157 | 7a387fff | ths | #define CP0Ca_DC 27 |
158 | 7a387fff | ths | #define CP0Ca_PCI 26 |
159 | 6af0bf9c | bellard | #define CP0Ca_IV 23 |
160 | 7a387fff | ths | #define CP0Ca_WP 22 |
161 | 7a387fff | ths | #define CP0Ca_IP 8 |
162 | 4de9b249 | ths | #define CP0Ca_IP_mask 0x0000FF00 |
163 | 7a387fff | ths | #define CP0Ca_EC 2 |
164 | c570fd16 | ths | target_ulong CP0_EPC; |
165 | 9c2149c8 | ths | int32_t CP0_PRid; |
166 | b29a0341 | ths | int32_t CP0_EBase; |
167 | 9c2149c8 | ths | int32_t CP0_Config0; |
168 | 6af0bf9c | bellard | #define CP0C0_M 31 |
169 | 6af0bf9c | bellard | #define CP0C0_K23 28 |
170 | 6af0bf9c | bellard | #define CP0C0_KU 25 |
171 | 6af0bf9c | bellard | #define CP0C0_MDU 20 |
172 | 6af0bf9c | bellard | #define CP0C0_MM 17 |
173 | 6af0bf9c | bellard | #define CP0C0_BM 16 |
174 | 6af0bf9c | bellard | #define CP0C0_BE 15 |
175 | 6af0bf9c | bellard | #define CP0C0_AT 13 |
176 | 6af0bf9c | bellard | #define CP0C0_AR 10 |
177 | 6af0bf9c | bellard | #define CP0C0_MT 7 |
178 | 7a387fff | ths | #define CP0C0_VI 3 |
179 | 6af0bf9c | bellard | #define CP0C0_K0 0 |
180 | 9c2149c8 | ths | int32_t CP0_Config1; |
181 | 7a387fff | ths | #define CP0C1_M 31 |
182 | 6af0bf9c | bellard | #define CP0C1_MMU 25 |
183 | 6af0bf9c | bellard | #define CP0C1_IS 22 |
184 | 6af0bf9c | bellard | #define CP0C1_IL 19 |
185 | 6af0bf9c | bellard | #define CP0C1_IA 16 |
186 | 6af0bf9c | bellard | #define CP0C1_DS 13 |
187 | 6af0bf9c | bellard | #define CP0C1_DL 10 |
188 | 6af0bf9c | bellard | #define CP0C1_DA 7 |
189 | 7a387fff | ths | #define CP0C1_C2 6 |
190 | 7a387fff | ths | #define CP0C1_MD 5 |
191 | 6af0bf9c | bellard | #define CP0C1_PC 4 |
192 | 6af0bf9c | bellard | #define CP0C1_WR 3 |
193 | 6af0bf9c | bellard | #define CP0C1_CA 2 |
194 | 6af0bf9c | bellard | #define CP0C1_EP 1 |
195 | 6af0bf9c | bellard | #define CP0C1_FP 0 |
196 | 9c2149c8 | ths | int32_t CP0_Config2; |
197 | 7a387fff | ths | #define CP0C2_M 31 |
198 | 7a387fff | ths | #define CP0C2_TU 28 |
199 | 7a387fff | ths | #define CP0C2_TS 24 |
200 | 7a387fff | ths | #define CP0C2_TL 20 |
201 | 7a387fff | ths | #define CP0C2_TA 16 |
202 | 7a387fff | ths | #define CP0C2_SU 12 |
203 | 7a387fff | ths | #define CP0C2_SS 8 |
204 | 7a387fff | ths | #define CP0C2_SL 4 |
205 | 7a387fff | ths | #define CP0C2_SA 0 |
206 | 9c2149c8 | ths | int32_t CP0_Config3; |
207 | 7a387fff | ths | #define CP0C3_M 31 |
208 | 7a387fff | ths | #define CP0C3_DSPP 10 |
209 | 7a387fff | ths | #define CP0C3_LPA 7 |
210 | 7a387fff | ths | #define CP0C3_VEIC 6 |
211 | 7a387fff | ths | #define CP0C3_VInt 5 |
212 | 7a387fff | ths | #define CP0C3_SP 4 |
213 | 7a387fff | ths | #define CP0C3_MT 2 |
214 | 7a387fff | ths | #define CP0C3_SM 1 |
215 | 7a387fff | ths | #define CP0C3_TL 0 |
216 | e397ee33 | ths | int32_t CP0_Config6; |
217 | e397ee33 | ths | int32_t CP0_Config7; |
218 | c570fd16 | ths | target_ulong CP0_LLAddr; |
219 | 9c2149c8 | ths | target_ulong CP0_WatchLo; |
220 | 9c2149c8 | ths | int32_t CP0_WatchHi; |
221 | 9c2149c8 | ths | target_ulong CP0_XContext; |
222 | 9c2149c8 | ths | int32_t CP0_Framemask; |
223 | 9c2149c8 | ths | int32_t CP0_Debug; |
224 | 6af0bf9c | bellard | #define CPDB_DBD 31 |
225 | 6af0bf9c | bellard | #define CP0DB_DM 30 |
226 | 6af0bf9c | bellard | #define CP0DB_LSNM 28 |
227 | 6af0bf9c | bellard | #define CP0DB_Doze 27 |
228 | 6af0bf9c | bellard | #define CP0DB_Halt 26 |
229 | 6af0bf9c | bellard | #define CP0DB_CNT 25 |
230 | 6af0bf9c | bellard | #define CP0DB_IBEP 24 |
231 | 6af0bf9c | bellard | #define CP0DB_DBEP 21 |
232 | 6af0bf9c | bellard | #define CP0DB_IEXI 20 |
233 | 6af0bf9c | bellard | #define CP0DB_VER 15 |
234 | 6af0bf9c | bellard | #define CP0DB_DEC 10 |
235 | 6af0bf9c | bellard | #define CP0DB_SSt 8 |
236 | 6af0bf9c | bellard | #define CP0DB_DINT 5 |
237 | 6af0bf9c | bellard | #define CP0DB_DIB 4 |
238 | 6af0bf9c | bellard | #define CP0DB_DDBS 3 |
239 | 6af0bf9c | bellard | #define CP0DB_DDBL 2 |
240 | 6af0bf9c | bellard | #define CP0DB_DBp 1 |
241 | 6af0bf9c | bellard | #define CP0DB_DSS 0 |
242 | c570fd16 | ths | target_ulong CP0_DEPC; |
243 | 9c2149c8 | ths | int32_t CP0_Performance0; |
244 | 9c2149c8 | ths | int32_t CP0_TagLo; |
245 | 9c2149c8 | ths | int32_t CP0_DataLo; |
246 | 9c2149c8 | ths | int32_t CP0_TagHi; |
247 | 9c2149c8 | ths | int32_t CP0_DataHi; |
248 | c570fd16 | ths | target_ulong CP0_ErrorEPC; |
249 | 9c2149c8 | ths | int32_t CP0_DESAVE; |
250 | 6af0bf9c | bellard | /* Qemu */
|
251 | 6af0bf9c | bellard | int interrupt_request;
|
252 | 6af0bf9c | bellard | jmp_buf jmp_env; |
253 | 6af0bf9c | bellard | int exception_index;
|
254 | 6af0bf9c | bellard | int error_code;
|
255 | 6af0bf9c | bellard | int user_mode_only; /* user mode only simulation */ |
256 | 6af0bf9c | bellard | uint32_t hflags; /* CPU State */
|
257 | 6af0bf9c | bellard | /* TMASK defines different execution modes */
|
258 | 56b19403 | pbrook | #define MIPS_HFLAG_TMASK 0x007F |
259 | 6af0bf9c | bellard | #define MIPS_HFLAG_MODE 0x001F /* execution modes */ |
260 | 6af0bf9c | bellard | #define MIPS_HFLAG_UM 0x0001 /* user mode */ |
261 | 6af0bf9c | bellard | #define MIPS_HFLAG_DM 0x0008 /* Debug mode */ |
262 | 6af0bf9c | bellard | #define MIPS_HFLAG_SM 0x0010 /* Supervisor mode */ |
263 | 6af0bf9c | bellard | #define MIPS_HFLAG_RE 0x0040 /* Reversed endianness */ |
264 | 4ad40f36 | bellard | /* If translation is interrupted between the branch instruction and
|
265 | 4ad40f36 | bellard | * the delay slot, record what type of branch it is so that we can
|
266 | 4ad40f36 | bellard | * resume translation properly. It might be possible to reduce
|
267 | 4ad40f36 | bellard | * this from three bits to two. */
|
268 | 4ad40f36 | bellard | #define MIPS_HFLAG_BMASK 0x0380 |
269 | 4ad40f36 | bellard | #define MIPS_HFLAG_B 0x0080 /* Unconditional branch */ |
270 | 4ad40f36 | bellard | #define MIPS_HFLAG_BC 0x0100 /* Conditional branch */ |
271 | 4ad40f36 | bellard | #define MIPS_HFLAG_BL 0x0180 /* Likely branch */ |
272 | 4ad40f36 | bellard | #define MIPS_HFLAG_BR 0x0200 /* branch to register (can't link TB) */ |
273 | 6af0bf9c | bellard | target_ulong btarget; /* Jump / branch target */
|
274 | 6af0bf9c | bellard | int bcond; /* Branch condition (if needed) */ |
275 | a316d335 | bellard | |
276 | 4ad40f36 | bellard | int halted; /* TRUE if the CPU is in suspend state */ |
277 | 4ad40f36 | bellard | |
278 | 7a387fff | ths | int SYNCI_Step; /* Address step size for SYNCI */ |
279 | 7a387fff | ths | int CCRes; /* Cycle count resolution/divisor */ |
280 | 5a5012ec | ths | int Status_rw_bitmask; /* Read/write bits in CP0_Status */ |
281 | 7a387fff | ths | |
282 | 6f5b89a0 | ths | #if defined(CONFIG_USER_ONLY)
|
283 | 6f5b89a0 | ths | target_ulong tls_value; |
284 | d537cf6c | pbrook | #else
|
285 | d537cf6c | pbrook | void *irq[8]; |
286 | 6f5b89a0 | ths | #endif
|
287 | 6f5b89a0 | ths | |
288 | a316d335 | bellard | CPU_COMMON |
289 | 6ae81775 | ths | |
290 | 6ae81775 | ths | int ram_size;
|
291 | 6ae81775 | ths | const char *kernel_filename; |
292 | 6ae81775 | ths | const char *kernel_cmdline; |
293 | 6ae81775 | ths | const char *initrd_filename; |
294 | 6ae81775 | ths | |
295 | 6ae81775 | ths | struct QEMUTimer *timer; /* Internal timer */ |
296 | 6af0bf9c | bellard | }; |
297 | 6af0bf9c | bellard | |
298 | 29929e34 | ths | int no_mmu_map_address (CPUMIPSState *env, target_ulong *physical, int *prot, |
299 | 29929e34 | ths | target_ulong address, int rw, int access_type); |
300 | 29929e34 | ths | int fixed_mmu_map_address (CPUMIPSState *env, target_ulong *physical, int *prot, |
301 | 29929e34 | ths | target_ulong address, int rw, int access_type); |
302 | 29929e34 | ths | int r4k_map_address (CPUMIPSState *env, target_ulong *physical, int *prot, |
303 | 29929e34 | ths | target_ulong address, int rw, int access_type); |
304 | 29929e34 | ths | void r4k_do_tlbwi (void); |
305 | 29929e34 | ths | void r4k_do_tlbwr (void); |
306 | 29929e34 | ths | void r4k_do_tlbp (void); |
307 | 29929e34 | ths | void r4k_do_tlbr (void); |
308 | 33d68b5f | ths | typedef struct mips_def_t mips_def_t; |
309 | 33d68b5f | ths | int mips_find_by_name (const unsigned char *name, mips_def_t **def); |
310 | 33d68b5f | ths | void mips_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)); |
311 | 33d68b5f | ths | int cpu_mips_register (CPUMIPSState *env, mips_def_t *def);
|
312 | 33d68b5f | ths | |
313 | 6af0bf9c | bellard | #include "cpu-all.h" |
314 | 6af0bf9c | bellard | |
315 | 6af0bf9c | bellard | /* Memory access type :
|
316 | 6af0bf9c | bellard | * may be needed for precise access rights control and precise exceptions.
|
317 | 6af0bf9c | bellard | */
|
318 | 6af0bf9c | bellard | enum {
|
319 | 6af0bf9c | bellard | /* 1 bit to define user level / supervisor access */
|
320 | 6af0bf9c | bellard | ACCESS_USER = 0x00,
|
321 | 6af0bf9c | bellard | ACCESS_SUPER = 0x01,
|
322 | 6af0bf9c | bellard | /* 1 bit to indicate direction */
|
323 | 6af0bf9c | bellard | ACCESS_STORE = 0x02,
|
324 | 6af0bf9c | bellard | /* Type of instruction that generated the access */
|
325 | 6af0bf9c | bellard | ACCESS_CODE = 0x10, /* Code fetch access */ |
326 | 6af0bf9c | bellard | ACCESS_INT = 0x20, /* Integer load/store access */ |
327 | 6af0bf9c | bellard | ACCESS_FLOAT = 0x30, /* floating point load/store access */ |
328 | 6af0bf9c | bellard | }; |
329 | 6af0bf9c | bellard | |
330 | 6af0bf9c | bellard | /* Exceptions */
|
331 | 6af0bf9c | bellard | enum {
|
332 | 6af0bf9c | bellard | EXCP_NONE = -1,
|
333 | 6af0bf9c | bellard | EXCP_RESET = 0,
|
334 | 6af0bf9c | bellard | EXCP_SRESET, |
335 | 6af0bf9c | bellard | EXCP_DSS, |
336 | 6af0bf9c | bellard | EXCP_DINT, |
337 | 6af0bf9c | bellard | EXCP_NMI, |
338 | 6af0bf9c | bellard | EXCP_MCHECK, |
339 | 6af0bf9c | bellard | EXCP_EXT_INTERRUPT, |
340 | 6af0bf9c | bellard | EXCP_DFWATCH, |
341 | 6af0bf9c | bellard | EXCP_DIB, /* 8 */
|
342 | 6af0bf9c | bellard | EXCP_IWATCH, |
343 | 6af0bf9c | bellard | EXCP_AdEL, |
344 | 6af0bf9c | bellard | EXCP_AdES, |
345 | 6af0bf9c | bellard | EXCP_TLBF, |
346 | 6af0bf9c | bellard | EXCP_IBE, |
347 | 6af0bf9c | bellard | EXCP_DBp, |
348 | 6af0bf9c | bellard | EXCP_SYSCALL, |
349 | 4ad40f36 | bellard | EXCP_BREAK, /* 16 */
|
350 | 4ad40f36 | bellard | EXCP_CpU, |
351 | 6af0bf9c | bellard | EXCP_RI, |
352 | 6af0bf9c | bellard | EXCP_OVERFLOW, |
353 | 6af0bf9c | bellard | EXCP_TRAP, |
354 | 5a5012ec | ths | EXCP_FPE, |
355 | 6af0bf9c | bellard | EXCP_DDBS, |
356 | 6af0bf9c | bellard | EXCP_DWATCH, |
357 | 5a5012ec | ths | EXCP_LAE, /* 24 */
|
358 | 5a5012ec | ths | EXCP_SAE, |
359 | 6af0bf9c | bellard | EXCP_LTLBL, |
360 | 6af0bf9c | bellard | EXCP_TLBL, |
361 | 6af0bf9c | bellard | EXCP_TLBS, |
362 | 6af0bf9c | bellard | EXCP_DBE, |
363 | 6af0bf9c | bellard | EXCP_DDBL, |
364 | 6af0bf9c | bellard | EXCP_MTCP0 = 0x104, /* mtmsr instruction: */ |
365 | 6af0bf9c | bellard | /* may change privilege level */
|
366 | 6af0bf9c | bellard | EXCP_BRANCH = 0x108, /* branch instruction */ |
367 | 6af0bf9c | bellard | EXCP_ERET = 0x10C, /* return from interrupt */ |
368 | 6af0bf9c | bellard | EXCP_SYSCALL_USER = 0x110, /* System call in user mode only */ |
369 | 6af0bf9c | bellard | EXCP_FLUSH = 0x109,
|
370 | 6af0bf9c | bellard | }; |
371 | 6af0bf9c | bellard | |
372 | 6af0bf9c | bellard | int cpu_mips_exec(CPUMIPSState *s);
|
373 | 6af0bf9c | bellard | CPUMIPSState *cpu_mips_init(void);
|
374 | 6af0bf9c | bellard | uint32_t cpu_mips_get_clock (void);
|
375 | 388bb21a | ths | int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc); |
376 | 6af0bf9c | bellard | |
377 | 6af0bf9c | bellard | #endif /* !defined (__MIPS_CPU_H__) */ |