xref: /openbmc/qemu/hw/cpu/cluster.c (revision c7b95171)
1 /*
2  * QEMU CPU cluster
3  *
4  * Copyright (c) 2018 GreenSocs SAS
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see
18  * <http://www.gnu.org/licenses/gpl-2.0.html>
19  */
20 
21 #include "qemu/osdep.h"
22 #include "hw/cpu/cluster.h"
23 #include "qapi/error.h"
24 #include "qemu/module.h"
25 
26 static Property cpu_cluster_properties[] = {
27     DEFINE_PROP_UINT32("cluster-id", CPUClusterState, cluster_id, 0),
28     DEFINE_PROP_END_OF_LIST()
29 };
30 
31 static void cpu_cluster_class_init(ObjectClass *klass, void *data)
32 {
33     DeviceClass *dc = DEVICE_CLASS(klass);
34 
35     dc->props = cpu_cluster_properties;
36 }
37 
38 static const TypeInfo cpu_cluster_type_info = {
39     .name = TYPE_CPU_CLUSTER,
40     .parent = TYPE_DEVICE,
41     .instance_size = sizeof(CPUClusterState),
42     .class_init = cpu_cluster_class_init,
43 };
44 
45 static void cpu_cluster_register_types(void)
46 {
47     type_register_static(&cpu_cluster_type_info);
48 }
49 
50 type_init(cpu_cluster_register_types)
51