[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 64/68] hw/nios2: Introduce Nios2MachineState
From: |
Richard Henderson |
Subject: |
[PULL 64/68] hw/nios2: Introduce Nios2MachineState |
Date: |
Tue, 26 Apr 2022 11:19:03 -0700 |
We want to move data from the heap into Nios2MachineState,
which is not possible with DEFINE_MACHINE.
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220421151735.31996-61-richard.henderson@linaro.org>
---
hw/nios2/10m50_devboard.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c
index 3d1205b8bd..bdc3ffd50d 100644
--- a/hw/nios2/10m50_devboard.c
+++ b/hw/nios2/10m50_devboard.c
@@ -36,6 +36,13 @@
#include "boot.h"
+struct Nios2MachineState {
+ MachineState parent_obj;
+};
+
+#define TYPE_NIOS2_MACHINE MACHINE_TYPE_NAME("10m50-ghrd")
+OBJECT_DECLARE_TYPE(Nios2MachineState, MachineClass, NIOS2_MACHINE)
+
#define BINARY_DEVICE_TREE_FILE "10m50-devboard.dtb"
static void nios2_10m50_ghrd_init(MachineState *machine)
@@ -105,11 +112,24 @@ static void nios2_10m50_ghrd_init(MachineState *machine)
BINARY_DEVICE_TREE_FILE, NULL);
}
-static void nios2_10m50_ghrd_machine_init(struct MachineClass *mc)
+static void nios2_10m50_ghrd_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Altera 10M50 GHRD Nios II design";
mc->init = nios2_10m50_ghrd_init;
mc->is_default = true;
}
-DEFINE_MACHINE("10m50-ghrd", nios2_10m50_ghrd_machine_init);
+static const TypeInfo nios2_10m50_ghrd_type_info = {
+ .name = TYPE_NIOS2_MACHINE,
+ .parent = TYPE_MACHINE,
+ .instance_size = sizeof(Nios2MachineState),
+ .class_init = nios2_10m50_ghrd_class_init,
+};
+
+static void nios2_10m50_ghrd_type_init(void)
+{
+ type_register_static(&nios2_10m50_ghrd_type_info);
+}
+type_init(nios2_10m50_ghrd_type_init);
--
2.34.1
- [PULL 43/68] target/nios2: Split out named structs for [IRJ]_TYPE, (continued)
- [PULL 43/68] target/nios2: Split out named structs for [IRJ]_TYPE, Richard Henderson, 2022/04/26
- [PULL 46/68] target/nios2: Split out helpers for gen_r_math_logic, Richard Henderson, 2022/04/26
- [PULL 44/68] target/nios2: Split out helpers for gen_i_cmpxx, Richard Henderson, 2022/04/26
- [PULL 49/68] target/nios2: Introduce dest_gpr, Richard Henderson, 2022/04/26
- [PULL 51/68] target/nios2: Enable unaligned traps for system mode, Richard Henderson, 2022/04/26
- [PULL 56/68] target/nios2: Implement Misaligned destination exception, Richard Henderson, 2022/04/26
- [PULL 53/68] target/nios2: Hoist set of is_jmp into gen_goto_tb, Richard Henderson, 2022/04/26
- [PULL 41/68] target/nios2: Support division error exception, Richard Henderson, 2022/04/26
- [PULL 42/68] target/nios2: Use tcg_constant_tl, Richard Henderson, 2022/04/26
- [PULL 54/68] target/nios2: Use gen_goto_tb for DISAS_TOO_MANY, Richard Henderson, 2022/04/26
- [PULL 64/68] hw/nios2: Introduce Nios2MachineState,
Richard Henderson <=
- [PULL 45/68] target/nios2: Split out helpers for gen_i_math_logic, Richard Henderson, 2022/04/26
- [PULL 50/68] target/nios2: Drop CR_STATUS_EH from tb->flags, Richard Henderson, 2022/04/26
- [PULL 52/68] target/nios2: Create gen_jumpr, Richard Henderson, 2022/04/26
- [PULL 57/68] target/nios2: Introduce shadow register sets, Richard Henderson, 2022/04/26
- [PULL 55/68] target/nios2: Use tcg_gen_lookup_and_goto_ptr, Richard Henderson, 2022/04/26
- [PULL 59/68] target/nios2: Update helper_eret for shadow registers, Richard Henderson, 2022/04/26
- [PULL 60/68] target/nios2: Implement EIC interrupt processing, Richard Henderson, 2022/04/26
- [PULL 61/68] target/nios2: Advance pc when raising exceptions, Richard Henderson, 2022/04/26
- [PULL 62/68] linux-user/nios2: Handle various SIGILL exceptions, Richard Henderson, 2022/04/26
- [PULL 65/68] hw/nios2: Move memory regions into Nios2Machine, Richard Henderson, 2022/04/26