Prepare for op.c removal and zero legacy ops
[qemu/mini2440.git] / target-sparc / exec.h
blob2f1169b3ae06442687c41e780d30e595828d653b
1 #ifndef EXEC_SPARC_H
2 #define EXEC_SPARC_H 1
3 #include "config.h"
4 #include "dyngen-exec.h"
6 register struct CPUSPARCState *env asm(AREG0);
8 #ifdef TARGET_SPARC64
9 #define T0 (env->t0)
10 #define T1 (env->t1)
11 #define T2 (env->t2)
12 #define REGWPTR env->regwptr
13 #else
14 register uint32_t T0 asm(AREG1);
15 register uint32_t T1 asm(AREG2);
17 #undef REG_REGWPTR // Broken
18 #ifdef REG_REGWPTR
19 #if defined(__sparc__)
20 register uint32_t *REGWPTR asm(AREG4);
21 #else
22 register uint32_t *REGWPTR asm(AREG3);
23 #endif
24 #define reg_REGWPTR
26 #ifdef AREG4
27 register uint32_t T2 asm(AREG4);
28 #define reg_T2
29 #else
30 #define T2 (env->t2)
31 #endif
33 #else
34 #define REGWPTR env->regwptr
35 register uint32_t T2 asm(AREG3);
36 #endif
37 #define reg_T2
38 #endif
40 #define FT0 (env->ft0)
41 #define FT1 (env->ft1)
42 #define DT0 (env->dt0)
43 #define DT1 (env->dt1)
44 #if defined(CONFIG_USER_ONLY)
45 #define QT0 (env->qt0)
46 #define QT1 (env->qt1)
47 #endif
49 #include "cpu.h"
50 #include "exec-all.h"
52 void cpu_lock(void);
53 void cpu_unlock(void);
54 void cpu_loop_exit(void);
55 void set_cwp(int new_cwp);
56 void do_fitos(void);
57 void do_fitod(void);
58 #if defined(CONFIG_USER_ONLY)
59 void do_fitoq(void);
60 #endif
61 #ifdef TARGET_SPARC64
62 void do_fxtos(void);
63 void do_fxtod(void);
64 #if defined(CONFIG_USER_ONLY)
65 void do_fxtoq(void);
66 #endif
67 #endif
68 void do_interrupt(int intno);
69 void memcpy32(target_ulong *dst, const target_ulong *src);
70 target_ulong mmu_probe(CPUState *env, target_ulong address, int mmulev);
71 void dump_mmu(CPUState *env);
73 /* XXX: move that to a generic header */
74 #if !defined(CONFIG_USER_ONLY)
75 #include "softmmu_exec.h"
76 #endif /* !defined(CONFIG_USER_ONLY) */
78 static inline void env_to_regs(void)
80 #if defined(reg_REGWPTR)
81 REGWPTR = env->regbase + (env->cwp * 16);
82 env->regwptr = REGWPTR;
83 #endif
86 static inline void regs_to_env(void)
90 int cpu_sparc_handle_mmu_fault(CPUState *env, target_ulong address, int rw,
91 int mmu_idx, int is_softmmu);
93 static inline int cpu_halted(CPUState *env) {
94 if (!env->halted)
95 return 0;
96 if ((env->interrupt_request & CPU_INTERRUPT_HARD) && (env->psret != 0)) {
97 env->halted = 0;
98 return 0;
100 return EXCP_HALTED;
103 #endif