aboutsummaryrefslogtreecommitdiff
path: root/target/i386/cpu.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-04-24 11:55:48 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-04-24 11:55:50 +0100
commitc4e9f845f6248885ff73a9e1ecb74052a1c3dcd4 (patch)
tree279a6b792989bc2bfd9b5e08b5df4cf65e098b74 /target/i386/cpu.c
parent85947dafad13ef8aea02eef2b058ee7aee47ab3e (diff)
parentede9a8a656c992deecce45f8175985dd81cc6be9 (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-monitor-2019-04-18' into staging
Error reporting & monitor patches for 2019-04-18 # gpg: Signature made Thu 18 Apr 2019 21:40:41 BST # gpg: using RSA key 3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-error-monitor-2019-04-18: (36 commits) include: Move fprintf_function to disas/ disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h monitor: Clean up how monitor_disas() funnels output to monitor qom/cpu: Simplify how CPUClass:cpu_dump_state() prints qemu-print: New qemu_fprintf(), qemu_vfprintf() qom/cpu: Simplify how CPUClass::dump_statistics() prints target/i386: Simplify how x86_cpu_dump_local_apic_state() prints target: Clean up how the dump_mmu() print target: Simplify how the TARGET_cpu_list() print memory: Clean up how mtree_info() prints block/qapi: Clean up how we print to monitor or stdout qsp: Simplify how qsp_report() prints tcg: Simplify how dump_drift_info() prints tcg: Simplify how dump_exec_info() prints tcg: Simplify how dump_opcount_info() prints trace: Simplify how st_print_trace_file_status() prints include: Include fprintf-fn.h only where needed monitor: Simplify how -device/device_add print help char-pty: Print "char device redirected" message to stdout char: Make -chardev help print to stdout ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/i386/cpu.c')
-rw-r--r--target/i386/cpu.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index d6bb57d210..e1687f7547 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -21,6 +21,7 @@
#include "qemu/units.h"
#include "qemu/cutils.h"
#include "qemu/bitops.h"
+#include "qemu/qemu-print.h"
#include "cpu.h"
#include "exec/exec-all.h"
@@ -3671,7 +3672,7 @@ static void x86_cpu_class_check_missing_features(X86CPUClass *xcc,
/* Print all cpuid feature names in featureset
*/
-static void listflags(FILE *f, fprintf_function print, GList *features)
+static void listflags(GList *features)
{
size_t len = 0;
GList *tmp;
@@ -3679,13 +3680,13 @@ static void listflags(FILE *f, fprintf_function print, GList *features)
for (tmp = features; tmp; tmp = tmp->next) {
const char *name = tmp->data;
if ((len + strlen(name) + 1) >= 75) {
- print(f, "\n");
+ qemu_printf("\n");
len = 0;
}
- print(f, "%s%s", len == 0 ? " " : " ", name);
+ qemu_printf("%s%s", len == 0 ? " " : " ", name);
len += strlen(name) + 1;
}
- print(f, "\n");
+ qemu_printf("\n");
}
/* Sort alphabetically by type name, respecting X86CPUClass::ordering. */
@@ -3721,32 +3722,26 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data)
{
ObjectClass *oc = data;
X86CPUClass *cc = X86_CPU_CLASS(oc);
- CPUListState *s = user_data;
char *name = x86_cpu_class_get_model_name(cc);
const char *desc = cc->model_description;
if (!desc && cc->cpu_def) {
desc = cc->cpu_def->model_id;
}
- (*s->cpu_fprintf)(s->file, "x86 %-20s %-48s\n",
- name, desc);
+ qemu_printf("x86 %-20s %-48s\n", name, desc);
g_free(name);
}
/* list available CPU models and flags */
-void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
+void x86_cpu_list(void)
{
int i, j;
- CPUListState s = {
- .file = f,
- .cpu_fprintf = cpu_fprintf,
- };
GSList *list;
GList *names = NULL;
- (*cpu_fprintf)(f, "Available CPUs:\n");
+ qemu_printf("Available CPUs:\n");
list = get_sorted_cpu_model_list();
- g_slist_foreach(list, x86_cpu_list_entry, &s);
+ g_slist_foreach(list, x86_cpu_list_entry, NULL);
g_slist_free(list);
names = NULL;
@@ -3761,9 +3756,9 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
names = g_list_sort(names, (GCompareFunc)strcmp);
- (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n");
- listflags(f, cpu_fprintf, names);
- (*cpu_fprintf)(f, "\n");
+ qemu_printf("\nRecognized CPUID flags:\n");
+ listflags(names);
+ qemu_printf("\n");
g_list_free(names);
}