Revision 14ce26e7 target-i386/exec.h
b/target-i386/exec.h | ||
---|---|---|
20 | 20 |
#include "config.h" |
21 | 21 |
#include "dyngen-exec.h" |
22 | 22 |
|
23 |
/* XXX: factorize this mess */ |
|
24 |
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__) |
|
25 |
#define HOST_LONG_BITS 64 |
|
26 |
#else |
|
27 |
#define HOST_LONG_BITS 32 |
|
28 |
#endif |
|
29 |
|
|
30 |
#ifdef TARGET_X86_64 |
|
31 |
#define TARGET_LONG_BITS 64 |
|
32 |
#else |
|
33 |
#define TARGET_LONG_BITS 32 |
|
34 |
#endif |
|
35 |
|
|
23 | 36 |
/* at least 4 register variables are defined */ |
24 | 37 |
register struct CPUX86State *env asm(AREG0); |
38 |
|
|
39 |
/* XXX: use 64 bit regs if HOST_LONG_BITS == 64 */ |
|
40 |
#if TARGET_LONG_BITS == 32 |
|
41 |
|
|
25 | 42 |
register uint32_t T0 asm(AREG1); |
26 | 43 |
register uint32_t T1 asm(AREG2); |
27 | 44 |
register uint32_t T2 asm(AREG3); |
28 | 45 |
|
29 |
#define A0 T2 |
|
30 |
|
|
31 | 46 |
/* if more registers are available, we define some registers too */ |
32 | 47 |
#ifdef AREG4 |
33 | 48 |
register uint32_t EAX asm(AREG4); |
... | ... | |
69 | 84 |
#define reg_EDI |
70 | 85 |
#endif |
71 | 86 |
|
87 |
#else |
|
88 |
|
|
89 |
/* no registers can be used */ |
|
90 |
#define T0 (env->t0) |
|
91 |
#define T1 (env->t1) |
|
92 |
#define T2 (env->t2) |
|
93 |
|
|
94 |
#endif |
|
95 |
|
|
96 |
#define A0 T2 |
|
97 |
|
|
72 | 98 |
extern FILE *logfile; |
73 | 99 |
extern int loglevel; |
74 | 100 |
|
... | ... | |
136 | 162 |
void helper_movl_drN_T0(int reg); |
137 | 163 |
void helper_invlpg(unsigned int addr); |
138 | 164 |
void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_cr0); |
139 |
void cpu_x86_update_cr3(CPUX86State *env, uint32_t new_cr3);
|
|
165 |
void cpu_x86_update_cr3(CPUX86State *env, target_ulong new_cr3);
|
|
140 | 166 |
void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_cr4); |
141 | 167 |
void cpu_x86_flush_tlb(CPUX86State *env, uint32_t addr); |
142 |
int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr,
|
|
168 |
int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr,
|
|
143 | 169 |
int is_write, int is_user, int is_softmmu); |
144 |
void tlb_fill(unsigned long addr, int is_write, int is_user,
|
|
170 |
void tlb_fill(target_ulong addr, int is_write, int is_user,
|
|
145 | 171 |
void *retaddr); |
146 | 172 |
void __hidden cpu_lock(void); |
147 | 173 |
void __hidden cpu_unlock(void); |
148 | 174 |
void do_interrupt(int intno, int is_int, int error_code, |
149 |
unsigned int next_eip, int is_hw);
|
|
175 |
target_ulong next_eip, int is_hw);
|
|
150 | 176 |
void do_interrupt_user(int intno, int is_int, int error_code, |
151 |
unsigned int next_eip);
|
|
177 |
target_ulong next_eip);
|
|
152 | 178 |
void raise_interrupt(int intno, int is_int, int error_code, |
153 | 179 |
unsigned int next_eip); |
154 | 180 |
void raise_exception_err(int exception_index, int error_code); |
155 | 181 |
void raise_exception(int exception_index); |
156 | 182 |
void __hidden cpu_loop_exit(void); |
157 |
void helper_fsave(uint8_t *ptr, int data32); |
|
158 |
void helper_frstor(uint8_t *ptr, int data32); |
|
159 | 183 |
|
160 | 184 |
void OPPROTO op_movl_eflags_T0(void); |
161 | 185 |
void OPPROTO op_movl_T0_eflags(void); |
... | ... | |
163 | 187 |
unsigned int next_eip); |
164 | 188 |
void raise_exception_err(int exception_index, int error_code); |
165 | 189 |
void raise_exception(int exception_index); |
166 |
void helper_divl_EAX_T0(uint32_t eip); |
|
167 |
void helper_idivl_EAX_T0(uint32_t eip); |
|
190 |
void helper_divl_EAX_T0(void); |
|
191 |
void helper_idivl_EAX_T0(void); |
|
192 |
void helper_mulq_EAX_T0(void); |
|
193 |
void helper_imulq_EAX_T0(void); |
|
194 |
void helper_imulq_T0_T1(void); |
|
195 |
void helper_divq_EAX_T0(void); |
|
196 |
void helper_idivq_EAX_T0(void); |
|
168 | 197 |
void helper_cmpxchg8b(void); |
169 | 198 |
void helper_cpuid(void); |
170 | 199 |
void helper_enter_level(int level, int data32); |
171 | 200 |
void helper_sysenter(void); |
172 | 201 |
void helper_sysexit(void); |
202 |
void helper_syscall(void); |
|
203 |
void helper_sysret(int dflag); |
|
173 | 204 |
void helper_rdtsc(void); |
174 | 205 |
void helper_rdmsr(void); |
175 | 206 |
void helper_wrmsr(void); |
... | ... | |
252 | 283 |
#define stl(p, v) stl_data(p, v) |
253 | 284 |
#define stq(p, v) stq_data(p, v) |
254 | 285 |
|
255 |
static inline double ldfq(void *ptr)
|
|
286 |
static inline double ldfq(target_ulong ptr)
|
|
256 | 287 |
{ |
257 | 288 |
union { |
258 | 289 |
double d; |
... | ... | |
262 | 293 |
return u.d; |
263 | 294 |
} |
264 | 295 |
|
265 |
static inline void stfq(void *ptr, double v)
|
|
296 |
static inline void stfq(target_ulong ptr, double v)
|
|
266 | 297 |
{ |
267 | 298 |
union { |
268 | 299 |
double d; |
... | ... | |
272 | 303 |
stq(ptr, u.i); |
273 | 304 |
} |
274 | 305 |
|
275 |
static inline float ldfl(void *ptr)
|
|
306 |
static inline float ldfl(target_ulong ptr)
|
|
276 | 307 |
{ |
277 | 308 |
union { |
278 | 309 |
float f; |
... | ... | |
282 | 313 |
return u.f; |
283 | 314 |
} |
284 | 315 |
|
285 |
static inline void stfl(void *ptr, float v)
|
|
316 |
static inline void stfl(target_ulong ptr, float v)
|
|
286 | 317 |
{ |
287 | 318 |
union { |
288 | 319 |
float f; |
... | ... | |
411 | 442 |
} |
412 | 443 |
|
413 | 444 |
#ifndef USE_X86LDOUBLE |
414 |
static inline CPU86_LDouble helper_fldt(uint8_t *ptr)
|
|
445 |
static inline CPU86_LDouble helper_fldt(target_ulong ptr)
|
|
415 | 446 |
{ |
416 | 447 |
CPU86_LDoubleU temp; |
417 | 448 |
int upper, e; |
... | ... | |
451 | 482 |
|
452 | 483 |
#ifdef CONFIG_USER_ONLY |
453 | 484 |
|
454 |
static inline CPU86_LDouble helper_fldt(uint8_t *ptr)
|
|
485 |
static inline CPU86_LDouble helper_fldt(target_ulong ptr)
|
|
455 | 486 |
{ |
456 | 487 |
return *(CPU86_LDouble *)ptr; |
457 | 488 |
} |
458 | 489 |
|
459 |
static inline void helper_fstt(CPU86_LDouble f, uint8_t *ptr)
|
|
490 |
static inline void helper_fstt(CPU86_LDouble f, target_ulong ptr)
|
|
460 | 491 |
{ |
461 | 492 |
*(CPU86_LDouble *)ptr = f; |
462 | 493 |
} |
... | ... | |
465 | 496 |
|
466 | 497 |
/* we use memory access macros */ |
467 | 498 |
|
468 |
static inline CPU86_LDouble helper_fldt(uint8_t *ptr)
|
|
499 |
static inline CPU86_LDouble helper_fldt(target_ulong ptr)
|
|
469 | 500 |
{ |
470 | 501 |
CPU86_LDoubleU temp; |
471 | 502 |
|
... | ... | |
474 | 505 |
return temp.d; |
475 | 506 |
} |
476 | 507 |
|
477 |
static inline void helper_fstt(CPU86_LDouble f, uint8_t *ptr)
|
|
508 |
static inline void helper_fstt(CPU86_LDouble f, target_ulong ptr)
|
|
478 | 509 |
{ |
479 | 510 |
CPU86_LDoubleU temp; |
480 | 511 |
|
... | ... | |
522 | 553 |
void helper_fsin(void); |
523 | 554 |
void helper_fcos(void); |
524 | 555 |
void helper_fxam_ST0(void); |
525 |
void helper_fstenv(uint8_t *ptr, int data32); |
|
526 |
void helper_fldenv(uint8_t *ptr, int data32); |
|
527 |
void helper_fsave(uint8_t *ptr, int data32); |
|
528 |
void helper_frstor(uint8_t *ptr, int data32); |
|
556 |
void helper_fstenv(target_ulong ptr, int data32); |
|
557 |
void helper_fldenv(target_ulong ptr, int data32); |
|
558 |
void helper_fsave(target_ulong ptr, int data32); |
|
559 |
void helper_frstor(target_ulong ptr, int data32); |
|
560 |
void helper_fxsave(target_ulong ptr, int data64); |
|
561 |
void helper_fxrstor(target_ulong ptr, int data64); |
|
529 | 562 |
void restore_native_fp_state(CPUState *env); |
530 | 563 |
void save_native_fp_state(CPUState *env); |
531 | 564 |
|
Also available in: Unified diff