blob: 6e0515f6e9ca50096fd6975e7bcce7ae09cc6ac3 [file] [log] [blame]
bellard7a3f1942003-09-30 20:36:07 +00001#ifndef EXEC_SPARC_H
2#define EXEC_SPARC_H 1
3#include "dyngen-exec.h"
bellard34751872005-07-02 14:31:34 +00004#include "config.h"
bellard7a3f1942003-09-30 20:36:07 +00005
ths01d6a892007-02-02 01:03:34 +00006#if defined(__sparc__)
7struct CPUSPARCState *env;
8#else
bellard7a3f1942003-09-30 20:36:07 +00009register struct CPUSPARCState *env asm(AREG0);
ths01d6a892007-02-02 01:03:34 +000010#endif
11
bellardaf7bf892005-01-30 22:39:04 +000012#ifdef TARGET_SPARC64
13#define T0 (env->t0)
14#define T1 (env->t1)
15#define T2 (env->t2)
bellard34751872005-07-02 14:31:34 +000016#define REGWPTR env->regwptr
bellardaf7bf892005-01-30 22:39:04 +000017#else
ths01d6a892007-02-02 01:03:34 +000018#if defined(__sparc__)
19register uint32_t T0 asm(AREG3);
20register uint32_t T1 asm(AREG2);
21#else
bellard7a3f1942003-09-30 20:36:07 +000022register uint32_t T0 asm(AREG1);
23register uint32_t T1 asm(AREG2);
ths01d6a892007-02-02 01:03:34 +000024#endif
bellard34751872005-07-02 14:31:34 +000025
26#undef REG_REGWPTR // Broken
27#ifdef REG_REGWPTR
ths01d6a892007-02-02 01:03:34 +000028#if defined(__sparc__)
29register uint32_t *REGWPTR asm(AREG4);
30#else
bellard34751872005-07-02 14:31:34 +000031register uint32_t *REGWPTR asm(AREG3);
ths01d6a892007-02-02 01:03:34 +000032#endif
bellard34751872005-07-02 14:31:34 +000033#define reg_REGWPTR
34
35#ifdef AREG4
ths01d6a892007-02-02 01:03:34 +000036#if defined(__sparc__)
37register uint32_t T2 asm(AREG0);
38#else
bellard34751872005-07-02 14:31:34 +000039register uint32_t T2 asm(AREG4);
ths01d6a892007-02-02 01:03:34 +000040#endif
bellard34751872005-07-02 14:31:34 +000041#define reg_T2
42#else
43#define T2 (env->t2)
bellardaf7bf892005-01-30 22:39:04 +000044#endif
bellard34751872005-07-02 14:31:34 +000045
46#else
47#define REGWPTR env->regwptr
ths01d6a892007-02-02 01:03:34 +000048#if defined(__sparc__)
49register uint32_t T2 asm(AREG0);
50#else
bellard34751872005-07-02 14:31:34 +000051register uint32_t T2 asm(AREG3);
ths01d6a892007-02-02 01:03:34 +000052#endif
bellard34751872005-07-02 14:31:34 +000053#define reg_T2
54#endif
55#endif
56
bellarde8af50a2004-09-30 21:55:55 +000057#define FT0 (env->ft0)
58#define FT1 (env->ft1)
bellarde8af50a2004-09-30 21:55:55 +000059#define DT0 (env->dt0)
60#define DT1 (env->dt1)
bellard7a3f1942003-09-30 20:36:07 +000061
62#include "cpu.h"
63#include "exec-all.h"
64
65void cpu_lock(void);
66void cpu_unlock(void);
67void cpu_loop_exit(void);
bellard658138b2004-04-25 17:56:08 +000068void helper_flush(target_ulong addr);
bellarde8af50a2004-09-30 21:55:55 +000069void helper_ld_asi(int asi, int size, int sign);
70void helper_st_asi(int asi, int size, int sign);
71void helper_rett(void);
bellard8d5f07f2004-10-04 21:23:09 +000072void helper_ldfsr(void);
bellarde8af50a2004-09-30 21:55:55 +000073void set_cwp(int new_cwp);
bellarda0c4cb42004-10-10 17:46:24 +000074void do_fitos(void);
75void do_fitod(void);
bellarde8af50a2004-09-30 21:55:55 +000076void do_fabss(void);
77void do_fsqrts(void);
78void do_fsqrtd(void);
79void do_fcmps(void);
80void do_fcmpd(void);
bellard34751872005-07-02 14:31:34 +000081#ifdef TARGET_SPARC64
82void do_fabsd(void);
83void do_fcmps_fcc1(void);
84void do_fcmpd_fcc1(void);
85void do_fcmps_fcc2(void);
86void do_fcmpd_fcc2(void);
87void do_fcmps_fcc3(void);
88void do_fcmpd_fcc3(void);
89void do_popc();
bellard83469012005-07-23 14:27:54 +000090void do_wrpstate();
91void do_done();
92void do_retry();
bellard34751872005-07-02 14:31:34 +000093#endif
bellardaf7bf892005-01-30 22:39:04 +000094void do_ldd_kernel(target_ulong addr);
95void do_ldd_user(target_ulong addr);
96void do_ldd_raw(target_ulong addr);
bellard878d3092005-02-13 19:02:42 +000097void do_interrupt(int intno);
bellarde8af50a2004-09-30 21:55:55 +000098void raise_exception(int tt);
bellardaf7bf892005-01-30 22:39:04 +000099void memcpy32(target_ulong *dst, const target_ulong *src);
bellardee5bbe32005-07-04 22:18:23 +0000100target_ulong mmu_probe(CPUState *env, target_ulong address, int mmulev);
101void dump_mmu(CPUState *env);
bellarde80cfcf2004-12-19 23:18:01 +0000102void helper_debug();
bellardaf7bf892005-01-30 22:39:04 +0000103void do_wrpsr();
104void do_rdpsr();
bellarde8af50a2004-09-30 21:55:55 +0000105
106/* XXX: move that to a generic header */
107#if !defined(CONFIG_USER_ONLY)
bellarda9049a02005-10-30 18:16:26 +0000108#include "softmmu_exec.h"
bellarde8af50a2004-09-30 21:55:55 +0000109#endif /* !defined(CONFIG_USER_ONLY) */
bellard0d1a29f2004-10-12 22:01:28 +0000110
111static inline void env_to_regs(void)
112{
bellardaea3ce42005-10-30 17:06:11 +0000113#if defined(reg_REGWPTR)
114 REGWPTR = env->regbase + (env->cwp * 16);
115 env->regwptr = REGWPTR;
116#endif
bellard0d1a29f2004-10-12 22:01:28 +0000117}
118
119static inline void regs_to_env(void)
120{
121}
122
bellard9d893302005-02-07 23:10:53 +0000123int cpu_sparc_handle_mmu_fault(CPUState *env, target_ulong address, int rw,
124 int is_user, int is_softmmu);
125
bellard7a3f1942003-09-30 20:36:07 +0000126#endif