diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-04-13 10:47:10 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-05-02 16:49:35 +0200 |
commit | a2b0a27d33e9b1079698cee04ff029a0555b5ea5 (patch) | |
tree | 25d812498da93beddf8910ce957141066ce30daa /target/mips | |
parent | 5679479b9a1b0dd4772904c3af0d02bb3c9e635f (diff) |
target/mips: Move TCG source files under tcg/ sub directory
To ease maintenance, move all TCG specific files under the tcg/
sub-directory. Adapt the Meson machinery.
The following prototypes:
- mips_tcg_init()
- mips_cpu_do_unaligned_access()
- mips_cpu_do_transaction_failed()
can now be restricted to the "tcg-internal.h" header.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210428170410.479308-29-f4bug@amsat.org>
Diffstat (limited to 'target/mips')
-rw-r--r-- | target/mips/helper.h | 2 | ||||
-rw-r--r-- | target/mips/internal.h | 11 | ||||
-rw-r--r-- | target/mips/meson.build | 31 | ||||
-rw-r--r-- | target/mips/tcg/dsp_helper.c (renamed from target/mips/dsp_helper.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/exception.c (renamed from target/mips/exception.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/fpu_helper.c (renamed from target/mips/fpu_helper.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/ldst_helper.c (renamed from target/mips/ldst_helper.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/lmmi_helper.c (renamed from target/mips/lmmi_helper.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/meson.build | 29 | ||||
-rw-r--r-- | target/mips/tcg/mips32r6.decode (renamed from target/mips/mips32r6.decode) | 0 | ||||
-rw-r--r-- | target/mips/tcg/mips64r6.decode (renamed from target/mips/mips64r6.decode) | 0 | ||||
-rw-r--r-- | target/mips/tcg/msa32.decode (renamed from target/mips/msa32.decode) | 0 | ||||
-rw-r--r-- | target/mips/tcg/msa64.decode (renamed from target/mips/msa64.decode) | 0 | ||||
-rw-r--r-- | target/mips/tcg/msa_helper.c (renamed from target/mips/msa_helper.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/msa_helper.h.inc (renamed from target/mips/msa_helper.h.inc) | 0 | ||||
-rw-r--r-- | target/mips/tcg/msa_translate.c (renamed from target/mips/msa_translate.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/mxu_translate.c (renamed from target/mips/mxu_translate.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/op_helper.c (renamed from target/mips/op_helper.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/rel6_translate.c (renamed from target/mips/rel6_translate.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/tcg-internal.h | 11 | ||||
-rw-r--r-- | target/mips/tcg/translate.c (renamed from target/mips/translate.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/translate_addr_const.c (renamed from target/mips/translate_addr_const.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/tx79.decode (renamed from target/mips/tx79.decode) | 0 | ||||
-rw-r--r-- | target/mips/tcg/tx79_translate.c (renamed from target/mips/tx79_translate.c) | 0 | ||||
-rw-r--r-- | target/mips/tcg/txx9_translate.c (renamed from target/mips/txx9_translate.c) | 0 |
25 files changed, 41 insertions, 43 deletions
diff --git a/target/mips/helper.h b/target/mips/helper.h index ba301ae160..a9c6c7d1a3 100644 --- a/target/mips/helper.h +++ b/target/mips/helper.h @@ -608,4 +608,4 @@ DEF_HELPER_FLAGS_2(rddsp, 0, tl, tl, env) #include "tcg/sysemu_helper.h.inc" #endif /* !CONFIG_USER_ONLY */ -#include "msa_helper.h.inc" +#include "tcg/msa_helper.h.inc" diff --git a/target/mips/internal.h b/target/mips/internal.h index dd332b4dce..18d5da64a5 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -82,9 +82,6 @@ extern const int mips_defs_number; int mips_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int mips_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr); #define USEG_LIMIT ((target_ulong)(int32_t)0x7FFFFFFFUL) #define KSEG0_BASE ((target_ulong)(int32_t)0x80000000UL) @@ -151,12 +148,6 @@ struct CPUMIPSTLBContext { } mmu; }; -void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, - vaddr addr, unsigned size, - MMUAccessType access_type, - int mmu_idx, MemTxAttrs attrs, - MemTxResult response, uintptr_t retaddr); - void sync_c0_status(CPUMIPSState *env, CPUMIPSState *cpu, int tc); void cpu_mips_store_status(CPUMIPSState *env, target_ulong val); void cpu_mips_store_cause(CPUMIPSState *env, target_ulong val); @@ -209,8 +200,6 @@ static inline bool cpu_mips_hw_interrupts_pending(CPUMIPSState *env) return r; } -void mips_tcg_init(void); - void msa_reset(CPUMIPSState *env); /* cp0_timer.c */ diff --git a/target/mips/meson.build b/target/mips/meson.build index e08077bfc1..2407a05d4c 100644 --- a/target/mips/meson.build +++ b/target/mips/meson.build @@ -1,11 +1,3 @@ -gen = [ - decodetree.process('mips32r6.decode', extra_args: '--static-decode=decode_mips32r6'), - decodetree.process('mips64r6.decode', extra_args: '--static-decode=decode_mips64r6'), - decodetree.process('msa32.decode', extra_args: '--static-decode=decode_msa32'), - decodetree.process('msa64.decode', extra_args: '--static-decode=decode_msa64'), - decodetree.process('tx79.decode', extra_args: '--static-decode=decode_tx79'), -] - mips_user_ss = ss.source_set() mips_softmmu_ss = ss.source_set() mips_ss = ss.source_set() @@ -20,35 +12,12 @@ if have_system subdir('sysemu') endif -mips_tcg_ss = ss.source_set() -mips_tcg_ss.add(gen) -mips_tcg_ss.add(files( - 'dsp_helper.c', - 'exception.c', - 'fpu_helper.c', - 'ldst_helper.c', - 'lmmi_helper.c', - 'msa_helper.c', - 'msa_translate.c', - 'op_helper.c', - 'rel6_translate.c', - 'translate.c', - 'translate_addr_const.c', - 'txx9_translate.c', -)) -mips_tcg_ss.add(when: 'TARGET_MIPS64', if_true: files( - 'tx79_translate.c', -), if_false: files( - 'mxu_translate.c', -)) if 'CONFIG_TCG' in config_all subdir('tcg') endif mips_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) -mips_ss.add_all(when: 'CONFIG_TCG', if_true: [mips_tcg_ss]) - target_arch += {'mips': mips_ss} target_softmmu_arch += {'mips': mips_softmmu_ss} target_user_arch += {'mips': mips_user_ss} diff --git a/target/mips/dsp_helper.c b/target/mips/tcg/dsp_helper.c index 09b6e5fb15..09b6e5fb15 100644 --- a/target/mips/dsp_helper.c +++ b/target/mips/tcg/dsp_helper.c diff --git a/target/mips/exception.c b/target/mips/tcg/exception.c index 4fb8b00711..4fb8b00711 100644 --- a/target/mips/exception.c +++ b/target/mips/tcg/exception.c diff --git a/target/mips/fpu_helper.c b/target/mips/tcg/fpu_helper.c index 8ce56ed7c8..8ce56ed7c8 100644 --- a/target/mips/fpu_helper.c +++ b/target/mips/tcg/fpu_helper.c diff --git a/target/mips/ldst_helper.c b/target/mips/tcg/ldst_helper.c index d42812b8a6..d42812b8a6 100644 --- a/target/mips/ldst_helper.c +++ b/target/mips/tcg/ldst_helper.c diff --git a/target/mips/lmmi_helper.c b/target/mips/tcg/lmmi_helper.c index abeb7736ae..abeb7736ae 100644 --- a/target/mips/lmmi_helper.c +++ b/target/mips/tcg/lmmi_helper.c diff --git a/target/mips/tcg/meson.build b/target/mips/tcg/meson.build index 2cffc5a5ac..5d8acbaf0d 100644 --- a/target/mips/tcg/meson.build +++ b/target/mips/tcg/meson.build @@ -1,3 +1,32 @@ +gen = [ + decodetree.process('mips32r6.decode', extra_args: '--static-decode=decode_mips32r6'), + decodetree.process('mips64r6.decode', extra_args: '--static-decode=decode_mips64r6'), + decodetree.process('msa32.decode', extra_args: '--static-decode=decode_msa32'), + decodetree.process('msa64.decode', extra_args: '--static-decode=decode_msa64'), + decodetree.process('tx79.decode', extra_args: '--static-decode=decode_tx79'), +] + +mips_ss.add(gen) +mips_ss.add(files( + 'dsp_helper.c', + 'exception.c', + 'fpu_helper.c', + 'ldst_helper.c', + 'lmmi_helper.c', + 'msa_helper.c', + 'msa_translate.c', + 'op_helper.c', + 'rel6_translate.c', + 'translate.c', + 'translate_addr_const.c', + 'txx9_translate.c', +)) +mips_ss.add(when: 'TARGET_MIPS64', if_true: files( + 'tx79_translate.c', +), if_false: files( + 'mxu_translate.c', +)) + if have_user subdir('user') endif diff --git a/target/mips/mips32r6.decode b/target/mips/tcg/mips32r6.decode index 837c991edc..837c991edc 100644 --- a/target/mips/mips32r6.decode +++ b/target/mips/tcg/mips32r6.decode diff --git a/target/mips/mips64r6.decode b/target/mips/tcg/mips64r6.decode index b58d8009cc..b58d8009cc 100644 --- a/target/mips/mips64r6.decode +++ b/target/mips/tcg/mips64r6.decode diff --git a/target/mips/msa32.decode b/target/mips/tcg/msa32.decode index ca200e373b..ca200e373b 100644 --- a/target/mips/msa32.decode +++ b/target/mips/tcg/msa32.decode diff --git a/target/mips/msa64.decode b/target/mips/tcg/msa64.decode index d2442474d0..d2442474d0 100644 --- a/target/mips/msa64.decode +++ b/target/mips/tcg/msa64.decode diff --git a/target/mips/msa_helper.c b/target/mips/tcg/msa_helper.c index 04af54f66d..04af54f66d 100644 --- a/target/mips/msa_helper.c +++ b/target/mips/tcg/msa_helper.c diff --git a/target/mips/msa_helper.h.inc b/target/mips/tcg/msa_helper.h.inc index 4963d1553a..4963d1553a 100644 --- a/target/mips/msa_helper.h.inc +++ b/target/mips/tcg/msa_helper.h.inc diff --git a/target/mips/msa_translate.c b/target/mips/tcg/msa_translate.c index ae6587edf6..ae6587edf6 100644 --- a/target/mips/msa_translate.c +++ b/target/mips/tcg/msa_translate.c diff --git a/target/mips/mxu_translate.c b/target/mips/tcg/mxu_translate.c index fb0a811af6..fb0a811af6 100644 --- a/target/mips/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c diff --git a/target/mips/op_helper.c b/target/mips/tcg/op_helper.c index ce1549c985..ce1549c985 100644 --- a/target/mips/op_helper.c +++ b/target/mips/tcg/op_helper.c diff --git a/target/mips/rel6_translate.c b/target/mips/tcg/rel6_translate.c index 0354370927..0354370927 100644 --- a/target/mips/rel6_translate.c +++ b/target/mips/tcg/rel6_translate.c diff --git a/target/mips/tcg/tcg-internal.h b/target/mips/tcg/tcg-internal.h index 75aa3ef98e..81b14eb219 100644 --- a/target/mips/tcg/tcg-internal.h +++ b/target/mips/tcg/tcg-internal.h @@ -11,15 +11,21 @@ #define MIPS_TCG_INTERNAL_H #include "tcg/tcg.h" +#include "exec/memattrs.h" #include "hw/core/cpu.h" #include "cpu.h" +void mips_tcg_init(void); + void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); void mips_cpu_do_interrupt(CPUState *cpu); bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req); bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); +void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr); const char *mips_exception_name(int32_t exception); @@ -46,6 +52,11 @@ bool mips_io_recompile_replay_branch(CPUState *cs, const TranslationBlock *tb); hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address, MMUAccessType access_type, uintptr_t retaddr); +void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, + vaddr addr, unsigned size, + MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr); void cpu_mips_tlb_flush(CPUMIPSState *env); #endif /* !CONFIG_USER_ONLY */ diff --git a/target/mips/translate.c b/target/mips/tcg/translate.c index c03a8ae1fe..c03a8ae1fe 100644 --- a/target/mips/translate.c +++ b/target/mips/tcg/translate.c diff --git a/target/mips/translate_addr_const.c b/target/mips/tcg/translate_addr_const.c index 96f483418e..96f483418e 100644 --- a/target/mips/translate_addr_const.c +++ b/target/mips/tcg/translate_addr_const.c diff --git a/target/mips/tx79.decode b/target/mips/tcg/tx79.decode index 0f748b53a6..0f748b53a6 100644 --- a/target/mips/tx79.decode +++ b/target/mips/tcg/tx79.decode diff --git a/target/mips/tx79_translate.c b/target/mips/tcg/tx79_translate.c index ad83774b97..ad83774b97 100644 --- a/target/mips/tx79_translate.c +++ b/target/mips/tcg/tx79_translate.c diff --git a/target/mips/txx9_translate.c b/target/mips/tcg/txx9_translate.c index 8a2c0b766b..8a2c0b766b 100644 --- a/target/mips/txx9_translate.c +++ b/target/mips/tcg/txx9_translate.c |