mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07: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:
@@ -285,6 +285,11 @@ typedef struct XtensaConfig {
|
||||
xtensa_tlb dtlb;
|
||||
} XtensaConfig;
|
||||
|
||||
typedef struct XtensaConfigList {
|
||||
const XtensaConfig *config;
|
||||
struct XtensaConfigList *next;
|
||||
} XtensaConfigList;
|
||||
|
||||
typedef struct CPUXtensaState {
|
||||
const XtensaConfig *config;
|
||||
uint32_t regs[16];
|
||||
@@ -317,6 +322,7 @@ typedef struct CPUXtensaState {
|
||||
CPUXtensaState *cpu_xtensa_init(const char *cpu_model);
|
||||
void xtensa_translate_init(void);
|
||||
int cpu_xtensa_exec(CPUXtensaState *s);
|
||||
void xtensa_register_core(XtensaConfigList *node);
|
||||
void do_interrupt(CPUXtensaState *s);
|
||||
void check_interrupts(CPUXtensaState *s);
|
||||
void xtensa_irq_init(CPUState *env);
|
||||
|
||||
+14
-13
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user