mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
target-xtensa: extract core configuration from overlay
Introduce overlay_tool.h that defines core configuration blocks from data available in the linux architecture variant overlay. Overlay data is automatically generated in the core configuration process by Tensilica tools and can be directly converted to qemu xtensa core description by overlay_tool.h Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
b8929a549f
commit
ac8b7db493
3 changed files with 554 additions and 13 deletions
|
@ -34,12 +34,6 @@
|
|||
#include "hw/loader.h"
|
||||
#endif
|
||||
|
||||
#define XTREG(idx, ofs, bi, sz, al, no, flags, cp, typ, grp, name, \
|
||||
a1, a2, a3, a4, a5, a6) \
|
||||
{ .targno = (no), .type = (typ), .group = (grp) },
|
||||
|
||||
static const XtensaConfig core_config[0];
|
||||
|
||||
static void reset_mmu(CPUState *env);
|
||||
|
||||
void cpu_reset(CPUXtensaState *env)
|
||||
|
@ -55,17 +49,24 @@ void cpu_reset(CPUXtensaState *env)
|
|||
reset_mmu(env);
|
||||
}
|
||||
|
||||
static struct XtensaConfigList *xtensa_cores;
|
||||
|
||||
void xtensa_register_core(XtensaConfigList *node)
|
||||
{
|
||||
node->next = xtensa_cores;
|
||||
xtensa_cores = node;
|
||||
}
|
||||
|
||||
CPUXtensaState *cpu_xtensa_init(const char *cpu_model)
|
||||
{
|
||||
static int tcg_inited;
|
||||
CPUXtensaState *env;
|
||||
const XtensaConfig *config = NULL;
|
||||
int i;
|
||||
XtensaConfigList *core = xtensa_cores;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(core_config); ++i)
|
||||
if (strcmp(core_config[i].name, cpu_model) == 0) {
|
||||
config = core_config + i;
|
||||
for (; core; core = core->next)
|
||||
if (strcmp(core->config->name, cpu_model) == 0) {
|
||||
config = core->config;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -90,10 +91,10 @@ CPUXtensaState *cpu_xtensa_init(const char *cpu_model)
|
|||
|
||||
void xtensa_cpu_list(FILE *f, fprintf_function cpu_fprintf)
|
||||
{
|
||||
int i;
|
||||
XtensaConfigList *core = xtensa_cores;
|
||||
cpu_fprintf(f, "Available CPUs:\n");
|
||||
for (i = 0; i < ARRAY_SIZE(core_config); ++i) {
|
||||
cpu_fprintf(f, " %s\n", core_config[i].name);
|
||||
for (; core; core = core->next) {
|
||||
cpu_fprintf(f, " %s\n", core->config->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue