cpu: add CPU_RESOLVING_TYPE macro
it will be used for providing to cpu name resolving class for parsing cpu model for system and user emulation code. Along with change add target to null-machine tests, so that when switch to CPU_RESOLVING_TYPE happens, it would ensure that null-machine usecase still works. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> (m68k) Acked-by: David Gibson <david@gibson.dropbear.id.au> (ppc) Acked-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> (tricore) Message-Id: <1518000027-274608-4-git-send-email-imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> [ehabkost: Added macro to riscv too] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
9c5a87e496
commit
0dacec874f
@ -470,6 +470,7 @@ void alpha_translate_init(void);
|
||||
|
||||
#define ALPHA_CPU_TYPE_SUFFIX "-" TYPE_ALPHA_CPU
|
||||
#define ALPHA_CPU_TYPE_NAME(model) model ALPHA_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_ALPHA_CPU
|
||||
|
||||
void alpha_cpu_list(FILE *f, fprintf_function cpu_fprintf);
|
||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
|
||||
|
@ -2306,6 +2306,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx,
|
||||
|
||||
#define ARM_CPU_TYPE_SUFFIX "-" TYPE_ARM_CPU
|
||||
#define ARM_CPU_TYPE_NAME(name) (name ARM_CPU_TYPE_SUFFIX)
|
||||
#define CPU_RESOLVING_TYPE TYPE_ARM_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_arm_signal_handler
|
||||
#define cpu_list arm_cpu_list
|
||||
|
@ -271,6 +271,7 @@ enum {
|
||||
|
||||
#define CRIS_CPU_TYPE_SUFFIX "-" TYPE_CRIS_CPU
|
||||
#define CRIS_CPU_TYPE_NAME(name) (name CRIS_CPU_TYPE_SUFFIX)
|
||||
#define CPU_RESOLVING_TYPE TYPE_CRIS_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_cris_signal_handler
|
||||
|
||||
|
@ -267,6 +267,7 @@ static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch)
|
||||
void hppa_translate_init(void);
|
||||
|
||||
#define cpu_init(cpu_model) cpu_generic_init(TYPE_HPPA_CPU, cpu_model)
|
||||
#define CPU_RESOLVING_TYPE TYPE_HPPA_CPU
|
||||
|
||||
void hppa_cpu_list(FILE *f, fprintf_function cpu_fprintf);
|
||||
|
||||
|
@ -1593,6 +1593,7 @@ uint64_t cpu_get_tsc(CPUX86State *env);
|
||||
|
||||
#define X86_CPU_TYPE_SUFFIX "-" TYPE_X86_CPU
|
||||
#define X86_CPU_TYPE_NAME(name) (name X86_CPU_TYPE_SUFFIX)
|
||||
#define CPU_RESOLVING_TYPE TYPE_X86_CPU
|
||||
|
||||
#ifdef TARGET_X86_64
|
||||
#define TARGET_DEFAULT_CPU_TYPE X86_CPU_TYPE_NAME("qemu64")
|
||||
|
@ -259,6 +259,7 @@ bool lm32_cpu_do_semihosting(CPUState *cs);
|
||||
|
||||
#define LM32_CPU_TYPE_SUFFIX "-" TYPE_LM32_CPU
|
||||
#define LM32_CPU_TYPE_NAME(model) model LM32_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_LM32_CPU
|
||||
|
||||
#define cpu_list lm32_cpu_list
|
||||
#define cpu_signal_handler cpu_lm32_signal_handler
|
||||
|
@ -531,6 +531,7 @@ enum {
|
||||
|
||||
#define M68K_CPU_TYPE_SUFFIX "-" TYPE_M68K_CPU
|
||||
#define M68K_CPU_TYPE_NAME(model) model M68K_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_M68K_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_m68k_signal_handler
|
||||
#define cpu_list m68k_cpu_list
|
||||
|
@ -344,6 +344,7 @@ int cpu_mb_signal_handler(int host_signum, void *pinfo,
|
||||
#define TARGET_VIRT_ADDR_SPACE_BITS 32
|
||||
|
||||
#define cpu_init(cpu_model) cpu_generic_init(TYPE_MICROBLAZE_CPU, cpu_model)
|
||||
#define CPU_RESOLVING_TYPE TYPE_MICROBLAZE_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_mb_signal_handler
|
||||
|
||||
|
@ -743,6 +743,7 @@ int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc);
|
||||
|
||||
#define MIPS_CPU_TYPE_SUFFIX "-" TYPE_MIPS_CPU
|
||||
#define MIPS_CPU_TYPE_NAME(model) model MIPS_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_MIPS_CPU
|
||||
|
||||
bool cpu_supports_cps_smp(const char *cpu_type);
|
||||
bool cpu_supports_isa(const char *cpu_type, unsigned int isa);
|
||||
|
@ -123,6 +123,7 @@ int cpu_moxie_signal_handler(int host_signum, void *pinfo,
|
||||
|
||||
#define MOXIE_CPU_TYPE_SUFFIX "-" TYPE_MOXIE_CPU
|
||||
#define MOXIE_CPU_TYPE_NAME(model) model MOXIE_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_MOXIE_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_moxie_signal_handler
|
||||
|
||||
|
@ -231,6 +231,7 @@ void nios2_check_interrupts(CPUNios2State *env);
|
||||
#endif
|
||||
|
||||
#define cpu_init(cpu_model) cpu_generic_init(TYPE_NIOS2_CPU, cpu_model)
|
||||
#define CPU_RESOLVING_TYPE TYPE_NIOS2_CPU
|
||||
|
||||
#define cpu_gen_code cpu_nios2_gen_code
|
||||
#define cpu_signal_handler cpu_nios2_signal_handler
|
||||
|
@ -393,6 +393,7 @@ int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu,
|
||||
|
||||
#define OPENRISC_CPU_TYPE_SUFFIX "-" TYPE_OPENRISC_CPU
|
||||
#define OPENRISC_CPU_TYPE_NAME(model) model OPENRISC_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_OPENRISC_CPU
|
||||
|
||||
#include "exec/cpu-all.h"
|
||||
|
||||
|
@ -1379,6 +1379,7 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t val);
|
||||
|
||||
#define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU
|
||||
#define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_ppc_signal_handler
|
||||
#define cpu_list ppc_cpu_list
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
#define RISCV_CPU_TYPE_SUFFIX "-" TYPE_RISCV_CPU
|
||||
#define RISCV_CPU_TYPE_NAME(name) (name RISCV_CPU_TYPE_SUFFIX)
|
||||
#define CPU_RESOLVING_TYPE TYPE_RISCV_CPU
|
||||
|
||||
#define TYPE_RISCV_CPU_ANY RISCV_CPU_TYPE_NAME("any")
|
||||
#define TYPE_RISCV_CPU_RV32GCSU_V1_09_1 RISCV_CPU_TYPE_NAME("rv32gcsu-v1.9.1")
|
||||
|
@ -723,6 +723,7 @@ void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
|
||||
|
||||
#define S390_CPU_TYPE_SUFFIX "-" TYPE_S390_CPU
|
||||
#define S390_CPU_TYPE_NAME(name) (name S390_CPU_TYPE_SUFFIX)
|
||||
#define CPU_RESOLVING_TYPE TYPE_S390_CPU
|
||||
|
||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
|
||||
signal handlers to inform the virtual CPU of exceptions. non zero
|
||||
|
@ -276,6 +276,7 @@ void cpu_load_tlb(CPUSH4State * env);
|
||||
|
||||
#define SUPERH_CPU_TYPE_SUFFIX "-" TYPE_SUPERH_CPU
|
||||
#define SUPERH_CPU_TYPE_NAME(model) model SUPERH_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_SUPERH_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_sh4_signal_handler
|
||||
#define cpu_list sh4_cpu_list
|
||||
|
@ -658,6 +658,7 @@ int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
|
||||
|
||||
#define SPARC_CPU_TYPE_SUFFIX "-" TYPE_SPARC_CPU
|
||||
#define SPARC_CPU_TYPE_NAME(model) model SPARC_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_SPARC_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_sparc_signal_handler
|
||||
#define cpu_list sparc_cpu_list
|
||||
|
@ -165,6 +165,7 @@ void tilegx_tcg_init(void);
|
||||
int cpu_tilegx_signal_handler(int host_signum, void *pinfo, void *puc);
|
||||
|
||||
#define cpu_init(cpu_model) cpu_generic_init(TYPE_TILEGX_CPU, cpu_model)
|
||||
#define CPU_RESOLVING_TYPE TYPE_TILEGX_CPU
|
||||
|
||||
#define cpu_signal_handler cpu_tilegx_signal_handler
|
||||
|
||||
|
@ -417,6 +417,7 @@ static inline void cpu_get_tb_cpu_state(CPUTriCoreState *env, target_ulong *pc,
|
||||
|
||||
#define TRICORE_CPU_TYPE_SUFFIX "-" TYPE_TRICORE_CPU
|
||||
#define TRICORE_CPU_TYPE_NAME(model) model TRICORE_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_TRICORE_CPU
|
||||
|
||||
/* helpers.c */
|
||||
int cpu_tricore_handle_mmu_fault(CPUState *cpu, target_ulong address,
|
||||
|
@ -168,6 +168,7 @@ static inline int cpu_mmu_index(CPUUniCore32State *env, bool ifetch)
|
||||
|
||||
#define UNICORE32_CPU_TYPE_SUFFIX "-" TYPE_UNICORE32_CPU
|
||||
#define UNICORE32_CPU_TYPE_NAME(model) model UNICORE32_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_UNICORE32_CPU
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUUniCore32State *env, target_ulong *pc,
|
||||
target_ulong *cs_base, uint32_t *flags)
|
||||
|
@ -513,6 +513,7 @@ void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
|
||||
|
||||
#define XTENSA_CPU_TYPE_SUFFIX "-" TYPE_XTENSA_CPU
|
||||
#define XTENSA_CPU_TYPE_NAME(model) model XTENSA_CPU_TYPE_SUFFIX
|
||||
#define CPU_RESOLVING_TYPE TYPE_XTENSA_CPU
|
||||
|
||||
#ifdef TARGET_WORDS_BIGENDIAN
|
||||
#define XTENSA_DEFAULT_CPU_MODEL "fsf"
|
||||
|
Loading…
Reference in New Issue
Block a user