root / target-sh4 / exec.h @ 5d794885
History | View | Annotate | Download (2.4 kB)
1 | fdf9b3e8 | bellard | /*
|
---|---|---|---|
2 | fdf9b3e8 | bellard | * SH4 emulation
|
3 | 5fafdf24 | ths | *
|
4 | fdf9b3e8 | bellard | * Copyright (c) 2005 Samuel Tardieu
|
5 | fdf9b3e8 | bellard | *
|
6 | fdf9b3e8 | bellard | * This library is free software; you can redistribute it and/or
|
7 | fdf9b3e8 | bellard | * modify it under the terms of the GNU Lesser General Public
|
8 | fdf9b3e8 | bellard | * License as published by the Free Software Foundation; either
|
9 | fdf9b3e8 | bellard | * version 2 of the License, or (at your option) any later version.
|
10 | fdf9b3e8 | bellard | *
|
11 | fdf9b3e8 | bellard | * This library is distributed in the hope that it will be useful,
|
12 | fdf9b3e8 | bellard | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | fdf9b3e8 | bellard | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | fdf9b3e8 | bellard | * Lesser General Public License for more details.
|
15 | fdf9b3e8 | bellard | *
|
16 | fdf9b3e8 | bellard | * You should have received a copy of the GNU Lesser General Public
|
17 | fdf9b3e8 | bellard | * License along with this library; if not, write to the Free Software
|
18 | fdf9b3e8 | bellard | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 | fdf9b3e8 | bellard | */
|
20 | fdf9b3e8 | bellard | #ifndef _EXEC_SH4_H
|
21 | fdf9b3e8 | bellard | #define _EXEC_SH4_H
|
22 | fdf9b3e8 | bellard | |
23 | fdf9b3e8 | bellard | #include "config.h" |
24 | fdf9b3e8 | bellard | #include "dyngen-exec.h" |
25 | fdf9b3e8 | bellard | |
26 | fdf9b3e8 | bellard | register struct CPUSH4State *env asm(AREG0); |
27 | fdf9b3e8 | bellard | register uint32_t T0 asm(AREG1); |
28 | fdf9b3e8 | bellard | register uint32_t T1 asm(AREG2); |
29 | 9c2a9ea1 | pbrook | //register uint32_t T2 asm(AREG3);
|
30 | fdf9b3e8 | bellard | |
31 | eda9b09b | bellard | #define FT0 (env->ft0)
|
32 | eda9b09b | bellard | #define FT1 (env->ft1)
|
33 | eda9b09b | bellard | #define DT0 (env->dt0)
|
34 | eda9b09b | bellard | #define DT1 (env->dt1)
|
35 | eda9b09b | bellard | |
36 | fdf9b3e8 | bellard | #include "cpu.h" |
37 | fdf9b3e8 | bellard | #include "exec-all.h" |
38 | fdf9b3e8 | bellard | |
39 | d10927f8 | ths | static inline int cpu_halted(CPUState *env) { |
40 | d10927f8 | ths | if (!env->halted)
|
41 | d10927f8 | ths | return 0; |
42 | d10927f8 | ths | if (env->interrupt_request & CPU_INTERRUPT_HARD) {
|
43 | d10927f8 | ths | env->halted = 0;
|
44 | d10927f8 | ths | return 0; |
45 | d10927f8 | ths | } |
46 | d10927f8 | ths | return EXCP_HALTED;
|
47 | d10927f8 | ths | } |
48 | d10927f8 | ths | |
49 | fdf9b3e8 | bellard | #ifndef CONFIG_USER_ONLY
|
50 | fdf9b3e8 | bellard | #include "softmmu_exec.h" |
51 | fdf9b3e8 | bellard | #endif
|
52 | fdf9b3e8 | bellard | |
53 | fdf9b3e8 | bellard | #define RETURN() __asm__ __volatile__("") |
54 | fdf9b3e8 | bellard | |
55 | fdf9b3e8 | bellard | static inline void regs_to_env(void) |
56 | fdf9b3e8 | bellard | { |
57 | fdf9b3e8 | bellard | /* XXXXX */
|
58 | fdf9b3e8 | bellard | } |
59 | fdf9b3e8 | bellard | |
60 | fdf9b3e8 | bellard | static inline void env_to_regs(void) |
61 | fdf9b3e8 | bellard | { |
62 | fdf9b3e8 | bellard | /* XXXXX */
|
63 | fdf9b3e8 | bellard | } |
64 | fdf9b3e8 | bellard | |
65 | fdf9b3e8 | bellard | int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw, |
66 | 6ebbf390 | j_mayer | int mmu_idx, int is_softmmu); |
67 | ea2b542a | aurel32 | void cpu_load_tlb(CPUState * env);
|
68 | fdf9b3e8 | bellard | |
69 | fdf9b3e8 | bellard | int find_itlb_entry(CPUState * env, target_ulong address,
|
70 | fdf9b3e8 | bellard | int use_asid, int update); |
71 | fdf9b3e8 | bellard | int find_utlb_entry(CPUState * env, target_ulong address, int use_asid); |
72 | fdf9b3e8 | bellard | |
73 | fdf9b3e8 | bellard | void helper_addc_T0_T1(void); |
74 | fdf9b3e8 | bellard | void helper_addv_T0_T1(void); |
75 | fdf9b3e8 | bellard | void helper_div1_T0_T1(void); |
76 | fdf9b3e8 | bellard | void helper_dmulsl_T0_T1(void); |
77 | fdf9b3e8 | bellard | void helper_dmulul_T0_T1(void); |
78 | fdf9b3e8 | bellard | void helper_macl_T0_T1(void); |
79 | fdf9b3e8 | bellard | void helper_macw_T0_T1(void); |
80 | fdf9b3e8 | bellard | void helper_negc_T0(void); |
81 | fdf9b3e8 | bellard | void helper_subc_T0_T1(void); |
82 | fdf9b3e8 | bellard | void helper_subv_T0_T1(void); |
83 | fdf9b3e8 | bellard | void helper_rotcl(uint32_t * addr);
|
84 | fdf9b3e8 | bellard | void helper_rotcr(uint32_t * addr);
|
85 | ea2b542a | aurel32 | void helper_ldtlb(void); |
86 | fdf9b3e8 | bellard | |
87 | fdf9b3e8 | bellard | void do_interrupt(CPUState * env);
|
88 | fdf9b3e8 | bellard | |
89 | fdf9b3e8 | bellard | void cpu_loop_exit(void); |
90 | fdf9b3e8 | bellard | void do_raise_exception(void); |
91 | fdf9b3e8 | bellard | |
92 | fdf9b3e8 | bellard | #endif /* _EXEC_SH4_H */ |