0.8.0-alt1
[qemu] / qemu / target-sparc / exec.h
1 #ifndef EXEC_SPARC_H
2 #define EXEC_SPARC_H 1
3 #include "dyngen-exec.h"
4 #include "config.h"
5
6 register struct CPUSPARCState *env asm(AREG0);
7 #ifdef TARGET_SPARC64
8 #define T0 (env->t0)
9 #define T1 (env->t1)
10 #define T2 (env->t2)
11 #define REGWPTR env->regwptr
12 #else
13 register uint32_t T0 asm(AREG1);
14 register uint32_t T1 asm(AREG2);
15
16 #undef REG_REGWPTR // Broken
17 #ifdef REG_REGWPTR
18 register uint32_t *REGWPTR asm(AREG3);
19 #define reg_REGWPTR
20
21 #ifdef AREG4
22 register uint32_t T2 asm(AREG4);
23 #define reg_T2
24 #else
25 #define T2 (env->t2)
26 #endif
27
28 #else
29 #define REGWPTR env->regwptr
30 register uint32_t T2 asm(AREG3);
31 #define reg_T2
32 #endif
33 #endif
34
35 #define FT0 (env->ft0)
36 #define FT1 (env->ft1)
37 #define DT0 (env->dt0)
38 #define DT1 (env->dt1)
39
40 #include "cpu.h"
41 #include "exec-all.h"
42
43 void cpu_lock(void);
44 void cpu_unlock(void);
45 void cpu_loop_exit(void);
46 void helper_flush(target_ulong addr);
47 void helper_ld_asi(int asi, int size, int sign);
48 void helper_st_asi(int asi, int size, int sign);
49 void helper_rett(void);
50 void helper_ldfsr(void);
51 void set_cwp(int new_cwp);
52 void do_fitos(void);
53 void do_fitod(void);
54 void do_fabss(void);
55 void do_fsqrts(void);
56 void do_fsqrtd(void);
57 void do_fcmps(void);
58 void do_fcmpd(void);
59 #ifdef TARGET_SPARC64
60 void do_fabsd(void);
61 void do_fcmps_fcc1(void);
62 void do_fcmpd_fcc1(void);
63 void do_fcmps_fcc2(void);
64 void do_fcmpd_fcc2(void);
65 void do_fcmps_fcc3(void);
66 void do_fcmpd_fcc3(void);
67 void do_popc();
68 void do_wrpstate();
69 void do_done();
70 void do_retry();
71 #endif
72 void do_ldd_kernel(target_ulong addr);
73 void do_ldd_user(target_ulong addr);
74 void do_ldd_raw(target_ulong addr);
75 void do_interrupt(int intno);
76 void raise_exception(int tt);
77 void memcpy32(target_ulong *dst, const target_ulong *src);
78 target_ulong mmu_probe(CPUState *env, target_ulong address, int mmulev);
79 void dump_mmu(CPUState *env);
80 void helper_debug();
81 void do_wrpsr();
82 void do_rdpsr();
83
84 /* XXX: move that to a generic header */
85 #if !defined(CONFIG_USER_ONLY)
86 #include "softmmu_exec.h"
87 #endif /* !defined(CONFIG_USER_ONLY) */
88
89 static inline void env_to_regs(void)
90 {
91 #if defined(reg_REGWPTR)
92     REGWPTR = env->regbase + (env->cwp * 16);
93     env->regwptr = REGWPTR;
94 #endif
95 }
96
97 static inline void regs_to_env(void)
98 {
99 }
100
101 int cpu_sparc_handle_mmu_fault(CPUState *env, target_ulong address, int rw,
102                                int is_user, int is_softmmu);
103
104 #endif