| 1 | /* |
| 2 | * QEMU MIPS CPU (monitor definitions) |
| 3 | * |
| 4 | * SPDX-FileCopyrightText: 2012 SUSE LINUX Products GmbH |
| 5 | * |
| 6 | * SPDX-License-Identifier: LGPL-2.1-or-later |
| 7 | */ |
| 8 | |
| 9 | #include "qemu/osdep.h" |
| 10 | #include "qemu/target-info.h" |
| 11 | #include "qapi/error.h" |
| 12 | #include "qapi/qapi-commands-machine.h" |
| 13 | #include "cpu.h" |
| 14 | |
| 15 | CpuModelExpansionInfo * |
| 16 | qmp_query_cpu_model_expansion(CpuModelExpansionType type, |
| 17 | CpuModelInfo *model, |
| 18 | Error **errp) |
| 19 | { |
| 20 | error_setg(errp, "CPU model expansion is not supported on this target"); |
| 21 | return NULL; |
| 22 | } |
| 23 | |
| 24 | static void mips_cpu_add_definition(gpointer data, gpointer user_data) |
| 25 | { |
| 26 | ObjectClass *oc = data; |
| 27 | CpuDefinitionInfoList **cpu_list = user_data; |
| 28 | CpuDefinitionInfo *info; |
| 29 | const char *typename; |
| 30 | |
| 31 | typename = object_class_get_name(oc); |
| 32 | info = g_malloc0(sizeof(*info)); |
| 33 | info->name = cpu_model_from_type(typename); |
| 34 | info->q_typename = g_strdup(typename); |
| 35 | |
| 36 | QAPI_LIST_PREPEND(*cpu_list, info); |
| 37 | } |
| 38 | |
| 39 | CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) |
| 40 | { |
| 41 | CpuDefinitionInfoList *cpu_list = NULL; |
| 42 | GSList *list; |
| 43 | |
| 44 | list = object_class_get_list(target_cpu_type(), false); |
| 45 | g_slist_foreach(list, mips_cpu_add_definition, &cpu_list); |
| 46 | g_slist_free(list); |
| 47 | |
| 48 | return cpu_list; |
| 49 | } |