2 * QEMU MIPS CPU (monitor definitions)
4 * SPDX-FileCopyrightText: 2012 SUSE LINUX Products GmbH
6 * SPDX-License-Identifier: LGPL-2.1-or-later
9 #include "qemu/osdep.h"
10 #include "qapi/qapi-commands-machine-target.h"
13 static void mips_cpu_add_definition(gpointer data
, gpointer user_data
)
15 ObjectClass
*oc
= data
;
16 CpuDefinitionInfoList
**cpu_list
= user_data
;
17 CpuDefinitionInfo
*info
;
20 typename
= object_class_get_name(oc
);
21 info
= g_malloc0(sizeof(*info
));
22 info
->name
= g_strndup(typename
,
23 strlen(typename
) - strlen("-" TYPE_MIPS_CPU
));
24 info
->q_typename
= g_strdup(typename
);
26 QAPI_LIST_PREPEND(*cpu_list
, info
);
29 CpuDefinitionInfoList
*qmp_query_cpu_definitions(Error
**errp
)
31 CpuDefinitionInfoList
*cpu_list
= NULL
;
34 list
= object_class_get_list(TYPE_MIPS_CPU
, false);
35 g_slist_foreach(list
, mips_cpu_add_definition
, &cpu_list
);