diff mbox series

[RFC,RESEND,02/42] accel/split: Define SplitAccelState

Message ID 20250620172751.94231-3-philmd@linaro.org
State New
Headers show
Series accel/split/arm: Run EL2 using TCG and EL1/EL0 in hardware with HVF | expand

Commit Message

Philippe Mathieu-Daudé June 20, 2025, 5:27 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/split/split-accel.h | 38 ++++++++++++++++++++++++++++++++++++++
 accel/split/split-all.c   |  5 ++++-
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 accel/split/split-accel.h

Comments

Richard Henderson June 22, 2025, 2:19 a.m. UTC | #1
On 6/20/25 10:27, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   accel/split/split-accel.h | 38 ++++++++++++++++++++++++++++++++++++++
>   accel/split/split-all.c   |  5 ++++-
>   2 files changed, 42 insertions(+), 1 deletion(-)
>   create mode 100644 accel/split/split-accel.h

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/accel/split/split-accel.h b/accel/split/split-accel.h
new file mode 100644
index 00000000000..cc825a92a6d
--- /dev/null
+++ b/accel/split/split-accel.h
@@ -0,0 +1,38 @@ 
+/*
+ * QEMU "split" accelerator (HW + SW) state
+ *
+ * Copyright (c) 2025 Linaro Ltd.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef SPLIT_ACCEL_H
+#define SPLIT_ACCEL_H
+
+#include "qemu/accel.h"
+#include "qom/object.h"
+
+#define TYPE_SPLIT_ACCEL ACCEL_CLASS_NAME("split")
+
+typedef struct SplitAccelClass SplitAccelClass;
+DECLARE_CLASS_CHECKERS(SplitAccelClass, SPLIT_ACCEL, TYPE_SPLIT_ACCEL)
+
+typedef struct SplitAccelState SplitAccelState;
+DECLARE_INSTANCE_CHECKER(SplitAccelState, SPLIT_ACCEL,
+                         TYPE_SPLIT_ACCEL)
+
+struct SplitAccelClass {
+    AccelClass parent_obj;
+
+    AccelClass *hw;
+    AccelClass *sw;
+};
+
+struct SplitAccelState {
+    AccelState parent_obj;
+
+    AccelState *hw;
+    AccelState *sw;
+};
+
+#endif /* SPLIT_ACCEL_H */
diff --git a/accel/split/split-all.c b/accel/split/split-all.c
index 7e308f3c1e7..6bc95c7a7c8 100644
--- a/accel/split/split-all.c
+++ b/accel/split/split-all.c
@@ -8,6 +8,7 @@ 
 
 #include "qemu/osdep.h"
 #include "qemu/accel.h"
+#include "split-accel.h"
 
 bool split_allowed;
 
@@ -64,8 +65,10 @@  static void split_accel_class_init(ObjectClass *oc, const void *data)
 }
 
 static const TypeInfo split_accel_type = {
-    .name = ACCEL_CLASS_NAME("split"),
+    .name = TYPE_SPLIT_ACCEL,
     .parent = TYPE_ACCEL,
+    .instance_size = sizeof(SplitAccelState),
+    .class_size = sizeof(SplitAccelClass),
     .class_init = split_accel_class_init,
 };