Drop qemu-kvm.h from e1000.c
[qemu-kvm/fedora.git] / target-mips / exec.h
blob18765f967945a4adbf155e7874e64de9d48a2059
1 #if !defined(__QEMU_MIPS_EXEC_H__)
2 #define __QEMU_MIPS_EXEC_H__
4 //#define DEBUG_OP
6 #include "config.h"
7 #include "mips-defs.h"
8 #include "dyngen-exec.h"
9 #include "cpu-defs.h"
11 register struct CPUMIPSState *env asm(AREG0);
13 #include "cpu.h"
14 #include "exec-all.h"
16 #if !defined(CONFIG_USER_ONLY)
17 #include "softmmu_exec.h"
18 #endif /* !defined(CONFIG_USER_ONLY) */
20 void dump_fpu(CPUState *env);
21 void fpu_dump_state(CPUState *env, FILE *f,
22 int (*fpu_fprintf)(FILE *f, const char *fmt, ...),
23 int flags);
25 void cpu_mips_clock_init (CPUState *env);
26 void cpu_mips_tlb_flush (CPUState *env, int flush_global);
28 static inline void env_to_regs(void)
32 static inline void regs_to_env(void)
36 static inline int cpu_halted(CPUState *env)
38 if (!env->halted)
39 return 0;
40 if (env->interrupt_request &
41 (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER)) {
42 env->halted = 0;
43 return 0;
45 return EXCP_HALTED;
48 static inline void compute_hflags(CPUState *env)
50 env->hflags &= ~(MIPS_HFLAG_COP1X | MIPS_HFLAG_64 | MIPS_HFLAG_CP0 |
51 MIPS_HFLAG_F64 | MIPS_HFLAG_FPU | MIPS_HFLAG_KSU |
52 MIPS_HFLAG_UX);
53 if (!(env->CP0_Status & (1 << CP0St_EXL)) &&
54 !(env->CP0_Status & (1 << CP0St_ERL)) &&
55 !(env->hflags & MIPS_HFLAG_DM)) {
56 env->hflags |= (env->CP0_Status >> CP0St_KSU) & MIPS_HFLAG_KSU;
58 #if defined(TARGET_MIPS64)
59 if (((env->hflags & MIPS_HFLAG_KSU) != MIPS_HFLAG_UM) ||
60 (env->CP0_Status & (1 << CP0St_PX)) ||
61 (env->CP0_Status & (1 << CP0St_UX)))
62 env->hflags |= MIPS_HFLAG_64;
63 if (env->CP0_Status & (1 << CP0St_UX))
64 env->hflags |= MIPS_HFLAG_UX;
65 #endif
66 if ((env->CP0_Status & (1 << CP0St_CU0)) ||
67 !(env->hflags & MIPS_HFLAG_KSU))
68 env->hflags |= MIPS_HFLAG_CP0;
69 if (env->CP0_Status & (1 << CP0St_CU1))
70 env->hflags |= MIPS_HFLAG_FPU;
71 if (env->CP0_Status & (1 << CP0St_FR))
72 env->hflags |= MIPS_HFLAG_F64;
73 if (env->insn_flags & ISA_MIPS32R2) {
74 if (env->active_fpu.fcr0 & (1 << FCR0_F64))
75 env->hflags |= MIPS_HFLAG_COP1X;
76 } else if (env->insn_flags & ISA_MIPS32) {
77 if (env->hflags & MIPS_HFLAG_64)
78 env->hflags |= MIPS_HFLAG_COP1X;
79 } else if (env->insn_flags & ISA_MIPS4) {
80 /* All supported MIPS IV CPUs use the XX (CU3) to enable
81 and disable the MIPS IV extensions to the MIPS III ISA.
82 Some other MIPS IV CPUs ignore the bit, so the check here
83 would be too restrictive for them. */
84 if (env->CP0_Status & (1 << CP0St_CU3))
85 env->hflags |= MIPS_HFLAG_COP1X;
89 #endif /* !defined(__QEMU_MIPS_EXEC_H__) */