[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/28] target-arm: Implement qmp query-cpu-definition
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 05/28] target-arm: Implement qmp query-cpu-definitions |
Date: |
Tue, 10 Sep 2013 19:51:59 +0100 |
From: Cole Robinson <address@hidden>
Libvirt uses this to introspect available CPU models.
Signed-off-by: Cole Robinson <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
target-arm/helper.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index c1a68c7..2a98be7 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -2,6 +2,7 @@
#include "exec/gdbstub.h"
#include "helper.h"
#include "qemu/host-utils.h"
+#include "sysemu/arch_init.h"
#include "sysemu/sysemu.h"
#include "qemu/bitops.h"
@@ -1829,6 +1830,37 @@ void arm_cpu_list(FILE *f, fprintf_function cpu_fprintf)
g_slist_free(list);
}
+static void arm_cpu_add_definition(gpointer data, gpointer user_data)
+{
+ ObjectClass *oc = data;
+ CpuDefinitionInfoList **cpu_list = user_data;
+ CpuDefinitionInfoList *entry;
+ CpuDefinitionInfo *info;
+ const char *typename;
+
+ typename = object_class_get_name(oc);
+ info = g_malloc0(sizeof(*info));
+ info->name = g_strndup(typename,
+ strlen(typename) - strlen("-" TYPE_ARM_CPU));
+
+ entry = g_malloc0(sizeof(*entry));
+ entry->value = info;
+ entry->next = *cpu_list;
+ *cpu_list = entry;
+}
+
+CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
+{
+ CpuDefinitionInfoList *cpu_list = NULL;
+ GSList *list;
+
+ list = object_class_get_list(TYPE_ARM_CPU, false);
+ g_slist_foreach(list, arm_cpu_add_definition, &cpu_list);
+ g_slist_free(list);
+
+ return cpu_list;
+}
+
void define_one_arm_cp_reg_with_opaque(ARMCPU *cpu,
const ARMCPRegInfo *r, void *opaque)
{
--
1.7.9.5
- [Qemu-devel] [PULL 22/28] linux-user: Add signal handling for AArch64, (continued)
- [Qemu-devel] [PULL 22/28] linux-user: Add signal handling for AArch64, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 16/28] target-arm: Add AArch64 translation stub, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 03/28] target-arm: Avoid "1 << 31" undefined behaviour, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 01/28] target-arm: Make '-cpu any' available in linux-user mode only, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 13/28] target-arm: Add new AArch64CPUInfo base class and subclasses, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 09/28] target-arm: Extract the disas struct to a header file, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 11/28] target-arm: Fix target_ulong/uint32_t confusions, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 02/28] target-arm: Use sextract32() in branch decode, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 12/28] target-arm: Pass DisasContext* to gen_set_pc_im(), Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 17/28] target-arm: Add AArch64 gdbstub support, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 05/28] target-arm: Implement qmp query-cpu-definitions,
Peter Maydell <=
- [Qemu-devel] [PULL 04/28] target-arm: fix ARMv7M stack alignment on reset, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 08/28] target-arm: Abstract out load/store from a vaddr in AArch32, Peter Maydell, 2013/09/10
- [Qemu-devel] [PULL 15/28] target-arm: Prepare translation for AArch64 code, Peter Maydell, 2013/09/10