diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-05-26 16:52:21 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-05-26 16:52:21 +0000 |
commit | 0402f767b5f11ec0efaf6abe50a11487801fc2ef (patch) | |
tree | 39ace1abcc9a63c262d419f8b5e1fb8044ae86e1 /target-m68k/helper.c | |
parent | 6b3a45ccea29d5e87a1ffa2506b847b5ba96f983 (diff) | |
download | qemu-0402f767b5f11ec0efaf6abe50a11487801fc2ef.tar.gz qemu-0402f767b5f11ec0efaf6abe50a11487801fc2ef.tar.bz2 qemu-0402f767b5f11ec0efaf6abe50a11487801fc2ef.zip |
Rework m68k cpu feature flags.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2865 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-m68k/helper.c')
-rw-r--r-- | target-m68k/helper.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/target-m68k/helper.c b/target-m68k/helper.c index 640fe4fb8f..12e3f78676 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -20,11 +20,74 @@ */ #include <stdio.h> +#include <string.h> #include "config.h" #include "cpu.h" #include "exec-all.h" +enum m68k_cpuid { + M68K_CPUID_M5206, + M68K_CPUID_CFV4E, + M68K_CPUID_ANY, +}; + +struct m68k_def_t { + const char * name; + enum m68k_cpuid id; +}; + +static m68k_def_t m68k_cpu_defs[] = { + {"m5206", M68K_CPUID_M5206}, + {"cfv4e", M68K_CPUID_CFV4E}, + {"any", M68K_CPUID_ANY}, + {NULL, 0}, +}; + +static void m68k_set_feature(CPUM68KState *env, int feature) +{ + env->features |= (1u << feature); +} + +int cpu_m68k_set_model(CPUM68KState *env, const char * name) +{ + m68k_def_t *def; + + for (def = m68k_cpu_defs; def->name; def++) { + if (strcmp(def->name, name) == 0) + break; + } + if (!def->name) + return 1; + + switch (def->id) { + case M68K_CPUID_M5206: + m68k_set_feature(env, M68K_FEATURE_CF_ISA_A); + break; + case M68K_CPUID_CFV4E: + m68k_set_feature(env, M68K_FEATURE_CF_ISA_A); + m68k_set_feature(env, M68K_FEATURE_CF_ISA_B); + m68k_set_feature(env, M68K_FEATURE_CF_ISA_C); + m68k_set_feature(env, M68K_FEATURE_CF_FPU); + m68k_set_feature(env, M68K_FEATURE_CF_MAC); + m68k_set_feature(env, M68K_FEATURE_CF_EMAC); + break; + case M68K_CPUID_ANY: + m68k_set_feature(env, M68K_FEATURE_CF_ISA_A); + m68k_set_feature(env, M68K_FEATURE_CF_ISA_B); + m68k_set_feature(env, M68K_FEATURE_CF_ISA_C); + m68k_set_feature(env, M68K_FEATURE_CF_FPU); + m68k_set_feature(env, M68K_FEATURE_CF_MAC); + m68k_set_feature(env, M68K_FEATURE_CF_EMAC); + m68k_set_feature(env, M68K_FEATURE_EXT_FULL); + break; + } + + register_m68k_insns(env); + + return 0; +} + void cpu_m68k_flush_flags(CPUM68KState *env, int cc_op) { int flags; |