Statistics
| Branch: | Revision:

root / target-mips / exec.h @ ea785922

History | View | Annotate | Download (4.5 kB)

1 6af0bf9c bellard
#if !defined(__QEMU_MIPS_EXEC_H__)
2 6af0bf9c bellard
#define __QEMU_MIPS_EXEC_H__
3 6af0bf9c bellard
4 01dbbdf1 bellard
//#define DEBUG_OP
5 6af0bf9c bellard
6 c570fd16 ths
#include "config.h"
7 6af0bf9c bellard
#include "mips-defs.h"
8 6af0bf9c bellard
#include "dyngen-exec.h"
9 6af0bf9c bellard
10 01d6a890 ths
#if defined(__sparc__)
11 01d6a890 ths
struct CPUMIPSState *env;
12 01d6a890 ths
#else
13 6af0bf9c bellard
register struct CPUMIPSState *env asm(AREG0);
14 01d6a890 ths
#endif
15 6af0bf9c bellard
16 6af0bf9c bellard
#if defined (USE_64BITS_REGS)
17 6af0bf9c bellard
typedef int64_t host_int_t;
18 6af0bf9c bellard
typedef uint64_t host_uint_t;
19 6af0bf9c bellard
#else
20 6af0bf9c bellard
typedef int32_t host_int_t;
21 6af0bf9c bellard
typedef uint32_t host_uint_t;
22 6af0bf9c bellard
#endif
23 6af0bf9c bellard
24 01d6a890 ths
#if defined(__sparc__)
25 01d6a890 ths
host_uint_t T0;
26 01d6a890 ths
host_uint_t T1;
27 01d6a890 ths
host_uint_t T2;
28 01d6a890 ths
#else
29 c570fd16 ths
#if TARGET_LONG_BITS > HOST_LONG_BITS
30 c570fd16 ths
#define T0 (env->t0)
31 c570fd16 ths
#define T1 (env->t1)
32 c570fd16 ths
#define T2 (env->t2)
33 c570fd16 ths
#else
34 6af0bf9c bellard
register host_uint_t T0 asm(AREG1);
35 6af0bf9c bellard
register host_uint_t T1 asm(AREG2);
36 6af0bf9c bellard
register host_uint_t T2 asm(AREG3);
37 c570fd16 ths
#endif
38 01d6a890 ths
#endif
39 6af0bf9c bellard
40 6af0bf9c bellard
#if defined (USE_HOST_FLOAT_REGS)
41 6ea83fed bellard
#error "implement me."
42 6af0bf9c bellard
#else
43 6ea83fed bellard
#define FDT0 (env->ft0.fd)
44 6ea83fed bellard
#define FDT1 (env->ft1.fd)
45 6ea83fed bellard
#define FDT2 (env->ft2.fd)
46 6ea83fed bellard
#define FST0 (env->ft0.fs[FP_ENDIAN_IDX])
47 6ea83fed bellard
#define FST1 (env->ft1.fs[FP_ENDIAN_IDX])
48 6ea83fed bellard
#define FST2 (env->ft2.fs[FP_ENDIAN_IDX])
49 6ea83fed bellard
#define DT0 (env->ft0.d)
50 6ea83fed bellard
#define DT1 (env->ft1.d)
51 6ea83fed bellard
#define DT2 (env->ft2.d)
52 6ea83fed bellard
#define WT0 (env->ft0.w[FP_ENDIAN_IDX])
53 6ea83fed bellard
#define WT1 (env->ft1.w[FP_ENDIAN_IDX])
54 6ea83fed bellard
#define WT2 (env->ft2.w[FP_ENDIAN_IDX])
55 6af0bf9c bellard
#endif
56 6af0bf9c bellard
57 6af0bf9c bellard
#if defined (DEBUG_OP)
58 70ead434 ths
# define RETURN() __asm__ __volatile__("nop" : : : "memory");
59 6af0bf9c bellard
#else
60 70ead434 ths
# define RETURN() __asm__ __volatile__("" : : : "memory");
61 6af0bf9c bellard
#endif
62 6af0bf9c bellard
63 6af0bf9c bellard
#include "cpu.h"
64 6af0bf9c bellard
#include "exec-all.h"
65 6af0bf9c bellard
66 6af0bf9c bellard
#if !defined(CONFIG_USER_ONLY)
67 a9049a07 bellard
#include "softmmu_exec.h"
68 6af0bf9c bellard
#endif /* !defined(CONFIG_USER_ONLY) */
69 6af0bf9c bellard
70 6af0bf9c bellard
static inline void env_to_regs(void)
71 6af0bf9c bellard
{
72 6af0bf9c bellard
}
73 6af0bf9c bellard
74 6af0bf9c bellard
static inline void regs_to_env(void)
75 6af0bf9c bellard
{
76 6af0bf9c bellard
}
77 6af0bf9c bellard
78 c570fd16 ths
#ifdef MIPS_HAS_MIPS64
79 c570fd16 ths
#if TARGET_LONG_BITS > HOST_LONG_BITS
80 c570fd16 ths
void do_dsll (void);
81 c570fd16 ths
void do_dsll32 (void);
82 c570fd16 ths
void do_dsra (void);
83 c570fd16 ths
void do_dsra32 (void);
84 c570fd16 ths
void do_dsrl (void);
85 c570fd16 ths
void do_dsrl32 (void);
86 c570fd16 ths
void do_drotr (void);
87 c570fd16 ths
void do_drotr32 (void);
88 c570fd16 ths
void do_dsllv (void);
89 c570fd16 ths
void do_dsrav (void);
90 c570fd16 ths
void do_dsrlv (void);
91 c570fd16 ths
void do_drotrv (void);
92 c570fd16 ths
#endif
93 c570fd16 ths
#endif
94 c570fd16 ths
95 c570fd16 ths
#if TARGET_LONG_BITS > HOST_LONG_BITS
96 6af0bf9c bellard
void do_mult (void);
97 6af0bf9c bellard
void do_multu (void);
98 6af0bf9c bellard
void do_madd (void);
99 6af0bf9c bellard
void do_maddu (void);
100 6af0bf9c bellard
void do_msub (void);
101 6af0bf9c bellard
void do_msubu (void);
102 c570fd16 ths
void do_ddiv (void);
103 c570fd16 ths
void do_ddivu (void);
104 c570fd16 ths
#endif
105 c570fd16 ths
#ifdef MIPS_HAS_MIPS64
106 c570fd16 ths
void do_dmult (void);
107 c570fd16 ths
void do_dmultu (void);
108 6af0bf9c bellard
#endif
109 873eb012 ths
void do_mfc0_random(void);
110 873eb012 ths
void do_mfc0_count(void);
111 7a387fff ths
void do_mtc0_entryhi(uint32_t in);
112 8c0fdd85 ths
void do_mtc0_status_debug(uint32_t old, uint32_t val);
113 8c0fdd85 ths
void do_mtc0_status_irqraise_debug(void);
114 6af0bf9c bellard
void do_tlbwi (void);
115 6af0bf9c bellard
void do_tlbwr (void);
116 6af0bf9c bellard
void do_tlbp (void);
117 6af0bf9c bellard
void do_tlbr (void);
118 6ea83fed bellard
#ifdef MIPS_USES_FPU
119 6ea83fed bellard
void dump_fpu(CPUState *env);
120 6ea83fed bellard
void fpu_dump_state(CPUState *env, FILE *f, 
121 6ea83fed bellard
                    int (*fpu_fprintf)(FILE *f, const char *fmt, ...),
122 6ea83fed bellard
                    int flags);
123 6ea83fed bellard
#endif
124 6ea83fed bellard
void dump_sc (void);
125 4ad40f36 bellard
void do_lwl_raw (uint32_t);
126 4ad40f36 bellard
void do_lwr_raw (uint32_t);
127 4ad40f36 bellard
uint32_t do_swl_raw (uint32_t);
128 4ad40f36 bellard
uint32_t do_swr_raw (uint32_t);
129 c570fd16 ths
#ifdef MIPS_HAS_MIPS64
130 c570fd16 ths
void do_ldl_raw (uint64_t);
131 c570fd16 ths
void do_ldr_raw (uint64_t);
132 c570fd16 ths
uint64_t do_sdl_raw (uint64_t);
133 c570fd16 ths
uint64_t do_sdr_raw (uint64_t);
134 c570fd16 ths
#endif
135 6af0bf9c bellard
#if !defined(CONFIG_USER_ONLY)
136 4ad40f36 bellard
void do_lwl_user (uint32_t);
137 4ad40f36 bellard
void do_lwl_kernel (uint32_t);
138 4ad40f36 bellard
void do_lwr_user (uint32_t);
139 4ad40f36 bellard
void do_lwr_kernel (uint32_t);
140 4ad40f36 bellard
uint32_t do_swl_user (uint32_t);
141 4ad40f36 bellard
uint32_t do_swl_kernel (uint32_t);
142 4ad40f36 bellard
uint32_t do_swr_user (uint32_t);
143 4ad40f36 bellard
uint32_t do_swr_kernel (uint32_t);
144 c570fd16 ths
#ifdef MIPS_HAS_MIPS64
145 c570fd16 ths
void do_ldl_user (uint64_t);
146 c570fd16 ths
void do_ldl_kernel (uint64_t);
147 c570fd16 ths
void do_ldr_user (uint64_t);
148 c570fd16 ths
void do_ldr_kernel (uint64_t);
149 c570fd16 ths
uint64_t do_sdl_user (uint64_t);
150 c570fd16 ths
uint64_t do_sdl_kernel (uint64_t);
151 c570fd16 ths
uint64_t do_sdr_user (uint64_t);
152 c570fd16 ths
uint64_t do_sdr_kernel (uint64_t);
153 c570fd16 ths
#endif
154 6af0bf9c bellard
#endif
155 6af0bf9c bellard
void do_pmon (int function);
156 6af0bf9c bellard
157 d2ec1774 pbrook
void dump_sc (void);
158 d2ec1774 pbrook
159 6af0bf9c bellard
int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
160 6af0bf9c bellard
                               int is_user, int is_softmmu);
161 6af0bf9c bellard
void do_interrupt (CPUState *env);
162 2ee4aed8 bellard
void invalidate_tlb (CPUState *env, int idx, int use_extra);
163 6af0bf9c bellard
164 6af0bf9c bellard
void cpu_loop_exit(void);
165 6af0bf9c bellard
void do_raise_exception_err (uint32_t exception, int error_code);
166 6af0bf9c bellard
void do_raise_exception (uint32_t exception);
167 4ad40f36 bellard
void do_raise_exception_direct (uint32_t exception);
168 6af0bf9c bellard
169 6af0bf9c bellard
void cpu_dump_state(CPUState *env, FILE *f, 
170 6af0bf9c bellard
                    int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
171 6af0bf9c bellard
                    int flags);
172 6af0bf9c bellard
void cpu_mips_irqctrl_init (void);
173 6af0bf9c bellard
uint32_t cpu_mips_get_random (CPUState *env);
174 6af0bf9c bellard
uint32_t cpu_mips_get_count (CPUState *env);
175 6af0bf9c bellard
void cpu_mips_store_count (CPUState *env, uint32_t value);
176 6af0bf9c bellard
void cpu_mips_store_compare (CPUState *env, uint32_t value);
177 4de9b249 ths
void cpu_mips_update_irq(CPUState *env);
178 6af0bf9c bellard
void cpu_mips_clock_init (CPUState *env);
179 814b9a47 ths
void cpu_mips_tlb_flush (CPUState *env, int flush_global);
180 6af0bf9c bellard
181 6af0bf9c bellard
#endif /* !defined(__QEMU_MIPS_EXEC_H__) */