@samitouri / QOSamiQemu / commits / a045f6a8e8

hw/riscv: Register generic riscv[32|64] QOM interfaces

Defines generic 32- and 64-bit riscv machine interfaces for machines to implement. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Anton Johansson <anjo@rev.ng> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20260520-hw-riscv-cpu-int-v3-1-d1123ea63d9c@rev.ng> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Anton Johansson committed Apr 30, 2025 at 13:34 UTC a045f6a8e819dcc0e80d13fbd1cedf60c85cef79
2 files changed +29
include/hw/riscv/machines-qom.h new
+20
@@ -0,0 +1,20 @@
1 +/*
2 + * QOM type definitions for riscv32 / riscv64 machines
3 + *
4 + * Copyright (c) rev.ng Labs Srl.
5 + *
6 + * SPDX-License-Identifier: GPL-2.0-or-later
7 + */
8 +
9 +#ifndef HW_RISCV_MACHINES_QOM_H
10 +#define HW_RISCV_MACHINES_QOM_H
11 +
12 +#include "hw/core/boards.h"
13 +
14 +#define TYPE_TARGET_RISCV32_MACHINE \
15 + "target-info-riscv32-machine"
16 +
17 +#define TYPE_TARGET_RISCV64_MACHINE \
18 + "target-info-riscv64-machine"
19 +
20 +#endif
target-info-qom.c
+9
@@ -13,6 +13,7 @@
13 #include "qemu/target-info-init.h"
14 #include "qemu/target-info-qom.h"
15 #include "hw/arm/machines-qom.h"
16 +#include "hw/riscv/machines-qom.h"
17
18 static const TypeInfo target_info_types[] = {
19 {
@@ -23,6 +24,14 @@ static const TypeInfo target_info_types[] = {
24 .name = TYPE_TARGET_AARCH64_MACHINE,
25 .parent = TYPE_INTERFACE,
26 },
27 + {
28 + .name = TYPE_TARGET_RISCV32_MACHINE,
29 + .parent = TYPE_INTERFACE,
30 + },
31 + {
32 + .name = TYPE_TARGET_RISCV64_MACHINE,
33 + .parent = TYPE_INTERFACE,
34 + },
35 };
36
37 DEFINE_TYPES(target_info_types)