root / target-mips / exec.h @ 79383c9c
History | View | Annotate | Download (3.4 kB)
1 |
#if !defined(__QEMU_MIPS_EXEC_H__)
|
---|---|
2 |
#define __QEMU_MIPS_EXEC_H__
|
3 |
|
4 |
//#define DEBUG_OP
|
5 |
|
6 |
#include "config.h" |
7 |
#include "mips-defs.h" |
8 |
#include "dyngen-exec.h" |
9 |
#include "cpu-defs.h" |
10 |
|
11 |
register struct CPUMIPSState *env asm(AREG0); |
12 |
|
13 |
#include "cpu.h" |
14 |
#include "exec-all.h" |
15 |
|
16 |
#if !defined(CONFIG_USER_ONLY)
|
17 |
#include "softmmu_exec.h" |
18 |
#endif /* !defined(CONFIG_USER_ONLY) */ |
19 |
|
20 |
void do_mtc0_status_debug(uint32_t old, uint32_t val);
|
21 |
void do_mtc0_status_irqraise_debug(void); |
22 |
void dump_fpu(CPUState *env);
|
23 |
void fpu_dump_state(CPUState *env, FILE *f,
|
24 |
int (*fpu_fprintf)(FILE *f, const char *fmt, ...), |
25 |
int flags);
|
26 |
|
27 |
int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, |
28 |
int mmu_idx, int is_softmmu); |
29 |
void do_interrupt (CPUState *env);
|
30 |
void r4k_invalidate_tlb (CPUState *env, int idx, int use_extra); |
31 |
|
32 |
void cpu_loop_exit(void); |
33 |
void do_raise_exception_err (uint32_t exception, int error_code); |
34 |
void do_raise_exception (uint32_t exception);
|
35 |
|
36 |
void cpu_mips_irqctrl_init (void); |
37 |
uint32_t cpu_mips_get_random (CPUState *env); |
38 |
uint32_t cpu_mips_get_count (CPUState *env); |
39 |
void cpu_mips_store_count (CPUState *env, uint32_t value);
|
40 |
void cpu_mips_store_compare (CPUState *env, uint32_t value);
|
41 |
void cpu_mips_start_count(CPUState *env);
|
42 |
void cpu_mips_stop_count(CPUState *env);
|
43 |
void cpu_mips_update_irq (CPUState *env);
|
44 |
void cpu_mips_clock_init (CPUState *env);
|
45 |
void cpu_mips_tlb_flush (CPUState *env, int flush_global); |
46 |
|
47 |
static inline void env_to_regs(void) |
48 |
{ |
49 |
} |
50 |
|
51 |
static inline void regs_to_env(void) |
52 |
{ |
53 |
} |
54 |
|
55 |
static inline int cpu_halted(CPUState *env) |
56 |
{ |
57 |
if (!env->halted)
|
58 |
return 0; |
59 |
if (env->interrupt_request &
|
60 |
(CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER)) { |
61 |
env->halted = 0;
|
62 |
return 0; |
63 |
} |
64 |
return EXCP_HALTED;
|
65 |
} |
66 |
|
67 |
static inline void compute_hflags(CPUState *env) |
68 |
{ |
69 |
env->hflags &= ~(MIPS_HFLAG_COP1X | MIPS_HFLAG_64 | MIPS_HFLAG_CP0 | |
70 |
MIPS_HFLAG_F64 | MIPS_HFLAG_FPU | MIPS_HFLAG_KSU); |
71 |
if (!(env->CP0_Status & (1 << CP0St_EXL)) && |
72 |
!(env->CP0_Status & (1 << CP0St_ERL)) &&
|
73 |
!(env->hflags & MIPS_HFLAG_DM)) { |
74 |
env->hflags |= (env->CP0_Status >> CP0St_KSU) & MIPS_HFLAG_KSU; |
75 |
} |
76 |
#if defined(TARGET_MIPS64)
|
77 |
if (((env->hflags & MIPS_HFLAG_KSU) != MIPS_HFLAG_UM) ||
|
78 |
(env->CP0_Status & (1 << CP0St_PX)) ||
|
79 |
(env->CP0_Status & (1 << CP0St_UX)))
|
80 |
env->hflags |= MIPS_HFLAG_64; |
81 |
#endif
|
82 |
if ((env->CP0_Status & (1 << CP0St_CU0)) || |
83 |
!(env->hflags & MIPS_HFLAG_KSU)) |
84 |
env->hflags |= MIPS_HFLAG_CP0; |
85 |
if (env->CP0_Status & (1 << CP0St_CU1)) |
86 |
env->hflags |= MIPS_HFLAG_FPU; |
87 |
if (env->CP0_Status & (1 << CP0St_FR)) |
88 |
env->hflags |= MIPS_HFLAG_F64; |
89 |
if (env->insn_flags & ISA_MIPS32R2) {
|
90 |
if (env->fpu->fcr0 & (1 << FCR0_F64)) |
91 |
env->hflags |= MIPS_HFLAG_COP1X; |
92 |
} else if (env->insn_flags & ISA_MIPS32) { |
93 |
if (env->hflags & MIPS_HFLAG_64)
|
94 |
env->hflags |= MIPS_HFLAG_COP1X; |
95 |
} else if (env->insn_flags & ISA_MIPS4) { |
96 |
/* All supported MIPS IV CPUs use the XX (CU3) to enable
|
97 |
and disable the MIPS IV extensions to the MIPS III ISA.
|
98 |
Some other MIPS IV CPUs ignore the bit, so the check here
|
99 |
would be too restrictive for them. */
|
100 |
if (env->CP0_Status & (1 << CP0St_CU3)) |
101 |
env->hflags |= MIPS_HFLAG_COP1X; |
102 |
} |
103 |
} |
104 |
|
105 |
#endif /* !defined(__QEMU_MIPS_EXEC_H__) */ |