[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/7] target-ppc: add implementation of query-cpu-def
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 7/7] target-ppc: add implementation of query-cpu-definitions (v2) |
Date: |
Fri, 10 Aug 2012 11:04:15 -0500 |
Signed-off-by: Anthony Liguori <address@hidden>
---
v1 -> v2
- rename query-cpudefs -> query-cpu-definitions
---
target-ppc/translate_init.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 5742229..6fe4168 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -27,6 +27,7 @@
#include "gdbstub.h"
#include <kvm.h>
#include "kvm_ppc.h"
+#include "qmp-commands.h"
//#define PPC_DUMP_CPU
//#define PPC_DEBUG_SPR
@@ -10345,6 +10346,31 @@ void ppc_cpu_list (FILE *f, fprintf_function
cpu_fprintf)
}
}
+CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
+{
+ CpuDefinitionInfoList *cpu_list = NULL;
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(ppc_defs); i++) {
+ CpuDefinitionInfoList *entry;
+ CpuDefinitionInfo *info;
+
+ if (!ppc_cpu_usable(&ppc_defs[i])) {
+ continue;
+ }
+
+ info = g_malloc0(sizeof(*info));
+ info->name = g_strdup(ppc_defs[i].name);
+
+ entry = g_malloc0(sizeof(*entry));
+ entry->value = info;
+ entry->next = cpu_list;
+ cpu_list = entry;
+ }
+
+ return cpu_list;
+}
+
/* CPUClass::reset() */
static void ppc_cpu_reset(CPUState *s)
{
--
1.7.5.4
- [Qemu-devel] [PATCH 0/7] qapi: add commands to remove the need (v2), Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 4/7] compiler: add macro for GCC weak symbols, Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 6/7] target-i386: add implementation of query-cpu-definitions (v2), Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 7/7] target-ppc: add implementation of query-cpu-definitions (v2),
Anthony Liguori <=
- [Qemu-devel] [PATCH 2/7] qapi: mark QOM commands stable, Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 5/7] qapi: add query-cpu-definitions command (v2), Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 1/7] qmp: introduce device-list-properties command, Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 3/7] qapi: add query-machines command, Anthony Liguori, 2012/08/10
- Re: [Qemu-devel] [PATCH 0/7] qapi: add commands to remove the need (v2), Luiz Capitulino, 2012/08/13