1 #if !defined (__MIPS_CPU_H__)
4 #define TARGET_HAS_ICE 1
11 typedef union fpr_t fpr_t
;
18 #if defined(MIPS_USES_R4K_TLB)
19 typedef struct tlb_t tlb_t
;
36 typedef struct CPUMIPSState CPUMIPSState
;
38 /* General integer registers */
40 /* Special registers */
44 #if defined(MIPS_USES_FPU)
45 /* Floating point registers */
47 /* Floating point special purpose registers */
54 #if defined(MIPS_USES_R4K_TLB)
59 uint32_t CP0_EntryLo0
;
60 uint32_t CP0_EntryLo1
;
62 uint32_t CP0_PageMask
;
64 uint32_t CP0_BadVAddr
;
100 uint32_t CP0_Config1
;
114 uint32_t CP0_WatchLo
;
115 uint32_t CP0_WatchHi
;
119 #define CP0DB_LSNM 28
120 #define CP0DB_Doze 27
121 #define CP0DB_Halt 26
123 #define CP0DB_IBEP 24
124 #define CP0DB_DBEP 21
125 #define CP0DB_IEXI 20
138 uint32_t CP0_ErrorEPC
;
141 #if defined (USE_HOST_FLOAT_REGS) && defined(MIPS_USES_FPU)
142 double ft0
, ft1
, ft2
;
144 struct QEMUTimer
*timer
; /* Internal timer */
145 int interrupt_request
;
149 int user_mode_only
; /* user mode only simulation */
150 uint32_t hflags
; /* CPU State */
151 /* TMASK defines different execution modes */
152 #define MIPS_HFLAG_TMASK 0x007F
153 #define MIPS_HFLAG_MODE 0x001F /* execution modes */
154 #define MIPS_HFLAG_UM 0x0001 /* user mode */
155 #define MIPS_HFLAG_ERL 0x0002 /* Error mode */
156 #define MIPS_HFLAG_EXL 0x0004 /* Exception mode */
157 #define MIPS_HFLAG_DM 0x0008 /* Debug mode */
158 #define MIPS_HFLAG_SM 0x0010 /* Supervisor mode */
159 #define MIPS_HFLAG_RE 0x0040 /* Reversed endianness */
160 /* If translation is interrupted between the branch instruction and
161 * the delay slot, record what type of branch it is so that we can
162 * resume translation properly. It might be possible to reduce
163 * this from three bits to two. */
164 #define MIPS_HFLAG_BMASK 0x0380
165 #define MIPS_HFLAG_B 0x0080 /* Unconditional branch */
166 #define MIPS_HFLAG_BC 0x0100 /* Conditional branch */
167 #define MIPS_HFLAG_BL 0x0180 /* Likely branch */
168 #define MIPS_HFLAG_BR 0x0200 /* branch to register (can't link TB) */
169 target_ulong btarget
; /* Jump / branch target */
170 int bcond
; /* Branch condition (if needed) */
172 int halted
; /* TRUE if the CPU is in suspend state */
179 /* Memory access type :
180 * may be needed for precise access rights control and precise exceptions.
183 /* 1 bit to define user level / supervisor access */
186 /* 1 bit to indicate direction */
188 /* Type of instruction that generated the access */
189 ACCESS_CODE
= 0x10, /* Code fetch access */
190 ACCESS_INT
= 0x20, /* Integer load/store access */
191 ACCESS_FLOAT
= 0x30, /* floating point load/store access */
227 EXCP_MTCP0
= 0x104, /* mtmsr instruction: */
228 /* may change privilege level */
229 EXCP_BRANCH
= 0x108, /* branch instruction */
230 EXCP_ERET
= 0x10C, /* return from interrupt */
231 EXCP_SYSCALL_USER
= 0x110, /* System call in user mode only */
235 int cpu_mips_exec(CPUMIPSState
*s
);
236 CPUMIPSState
*cpu_mips_init(void);
237 uint32_t cpu_mips_get_clock (void);
239 #endif /* !defined (__MIPS_CPU_H__) */