diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2011-09-06 03:55:27 +0400 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-09-10 16:57:36 +0000 |
commit | dedc5eae2324b3c4a6d25af2138396aa5dc3d9e0 (patch) | |
tree | bf35ca79f9216521142c8679f0713b69a6c5c093 /target-xtensa/helper.c | |
parent | cfa550c6acc6718c3f932e858366e3e1e81266d6 (diff) |
target-xtensa: implement disas_xtensa_insn
Set up disas_xtensa_insn switch structure, mark required options on high
level groups. Implement arithmetic/bit logic/jump/call0.
Implement code generation loop with single step/breakpoint checking.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-xtensa/helper.c')
-rw-r--r-- | target-xtensa/helper.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/target-xtensa/helper.c b/target-xtensa/helper.c index dc30e00481..c119fd0dff 100644 --- a/target-xtensa/helper.c +++ b/target-xtensa/helper.c @@ -39,12 +39,32 @@ void cpu_reset(CPUXtensaState *env) env->pc = 0; } +static const XtensaConfig core_config[] = { + { + .name = "sample-xtensa-core", + .options = -1, + }, +}; + CPUXtensaState *cpu_xtensa_init(const char *cpu_model) { static int tcg_inited; CPUXtensaState *env; + const XtensaConfig *config = NULL; + int i; + + for (i = 0; i < ARRAY_SIZE(core_config); ++i) + if (strcmp(core_config[i].name, cpu_model) == 0) { + config = core_config + i; + break; + } + + if (config == NULL) { + return NULL; + } env = g_malloc0(sizeof(*env)); + env->config = config; cpu_exec_init(env); if (!tcg_inited) { @@ -59,8 +79,11 @@ CPUXtensaState *cpu_xtensa_init(const char *cpu_model) void xtensa_cpu_list(FILE *f, fprintf_function cpu_fprintf) { - cpu_fprintf(f, "Available CPUs:\n" - " Xtensa core\n"); + int i; + cpu_fprintf(f, "Available CPUs:\n"); + for (i = 0; i < ARRAY_SIZE(core_config); ++i) { + cpu_fprintf(f, " %s\n", core_config[i].name); + } } target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) |