From f86355f82c13b28a6af550b36850f6df63bbcc31 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Tue, 20 Mar 2018 11:28:06 -0400 Subject: [PATCH] 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. Backports commit 0dacec874fa3b3fd34b0d0670fa257efdcbbebd0 from qemu --- qemu/target/arm/cpu.h | 1 + qemu/target/i386/cpu.h | 1 + qemu/target/m68k/cpu.h | 1 + qemu/target/mips/cpu.h | 1 + qemu/target/sparc/cpu.h | 1 + 5 files changed, 5 insertions(+) diff --git a/qemu/target/arm/cpu.h b/qemu/target/arm/cpu.h index 33335d1b..b779be00 100644 --- a/qemu/target/arm/cpu.h +++ b/qemu/target/arm/cpu.h @@ -2273,6 +2273,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 diff --git a/qemu/target/i386/cpu.h b/qemu/target/i386/cpu.h index d74233c4..6c49ba84 100644 --- a/qemu/target/i386/cpu.h +++ b/qemu/target/i386/cpu.h @@ -1525,6 +1525,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 #define cpu_signal_handler cpu_x86_signal_handler #endif diff --git a/qemu/target/m68k/cpu.h b/qemu/target/m68k/cpu.h index 8b725a83..25f5889a 100644 --- a/qemu/target/m68k/cpu.h +++ b/qemu/target/m68k/cpu.h @@ -525,6 +525,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 diff --git a/qemu/target/mips/cpu.h b/qemu/target/mips/cpu.h index 279382fc..0cb5dc51 100644 --- a/qemu/target/mips/cpu.h +++ b/qemu/target/mips/cpu.h @@ -747,6 +747,7 @@ enum { #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 int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc); bool cpu_supports_isa(struct uc_struct *uc, const char *cpu_model, unsigned int isa); diff --git a/qemu/target/sparc/cpu.h b/qemu/target/sparc/cpu.h index 4361020b..9f0b571c 100644 --- a/qemu/target/sparc/cpu.h +++ b/qemu/target/sparc/cpu.h @@ -647,6 +647,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