aboutsummaryrefslogtreecommitdiff
path: root/target/xtensa/helper.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-02-09 20:43:58 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2019-02-18 21:29:08 -0800
commit0e7c887919e44f25491a4eb86403e947d9d54937 (patch)
tree266b0c66b28675598bc506415130c6deb1144839 /target/xtensa/helper.c
parent2012f47e2371537bf41a9347af6db1d3d675a1a4 (diff)
target/xtensa: move xtensa_finalize_config to xtensa_core_class_init
Don't run xtensa_finalize_config at the time of core registration, instead run it at the CPU class initialization. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target/xtensa/helper.c')
-rw-r--r--target/xtensa/helper.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c
index 6cf1dbb8a6..321ca42955 100644
--- a/target/xtensa/helper.c
+++ b/target/xtensa/helper.c
@@ -34,22 +34,6 @@
static struct XtensaConfigList *xtensa_cores;
-static void xtensa_core_class_init(ObjectClass *oc, void *data)
-{
- CPUClass *cc = CPU_CLASS(oc);
- XtensaCPUClass *xcc = XTENSA_CPU_CLASS(oc);
- const XtensaConfig *config = data;
-
- xcc->config = config;
-
- /* Use num_core_regs to see only non-privileged registers in an unmodified
- * gdb. Use num_regs to see all registers. gdb modification is required
- * for that: reset bit 0 in the 'flags' field of the registers definitions
- * in the gdb/xtensa-config.c inside gdb source tree or inside gdb overlay.
- */
- cc->gdb_num_core_regs = config->gdb_regmap.num_regs;
-}
-
static void init_libisa(XtensaConfig *config)
{
unsigned i, j;
@@ -91,7 +75,7 @@ static void init_libisa(XtensaConfig *config)
config->a_regfile = xtensa_regfile_lookup(config->isa, "AR");
}
-void xtensa_finalize_config(XtensaConfig *config)
+static void xtensa_finalize_config(XtensaConfig *config)
{
if (config->isa_internal) {
init_libisa(config);
@@ -112,6 +96,24 @@ void xtensa_finalize_config(XtensaConfig *config)
}
}
+static void xtensa_core_class_init(ObjectClass *oc, void *data)
+{
+ CPUClass *cc = CPU_CLASS(oc);
+ XtensaCPUClass *xcc = XTENSA_CPU_CLASS(oc);
+ XtensaConfig *config = data;
+
+ xtensa_finalize_config(config);
+ xcc->config = config;
+
+ /*
+ * Use num_core_regs to see only non-privileged registers in an unmodified
+ * gdb. Use num_regs to see all registers. gdb modification is required
+ * for that: reset bit 0 in the 'flags' field of the registers definitions
+ * in the gdb/xtensa-config.c inside gdb source tree or inside gdb overlay.
+ */
+ cc->gdb_num_core_regs = config->gdb_regmap.num_regs;
+}
+
void xtensa_register_core(XtensaConfigList *node)
{
TypeInfo type = {