spapr: Fix error leak in spapr_realize_vcpu()
[qemu/ar7.git] / include / hw / ppc / pnv_core.h
blobf15829dfaebc833784af35cdad74f4905b4bf622
1 /*
2 * QEMU PowerPC PowerNV CPU Core model
4 * Copyright (c) 2016, IBM Corporation.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2 of
9 * the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef PPC_PNV_CORE_H
21 #define PPC_PNV_CORE_H
23 #include "hw/cpu/core.h"
24 #include "target/ppc/cpu.h"
25 #include "qom/object.h"
27 #define TYPE_PNV_CORE "powernv-cpu-core"
28 OBJECT_DECLARE_TYPE(PnvCore, PnvCoreClass,
29 PNV_CORE)
31 typedef struct PnvChip PnvChip;
33 struct PnvCore {
34 /*< private >*/
35 CPUCore parent_obj;
37 /*< public >*/
38 PowerPCCPU **threads;
39 uint32_t pir;
40 uint64_t hrmor;
41 PnvChip *chip;
43 MemoryRegion xscom_regs;
46 struct PnvCoreClass {
47 DeviceClass parent_class;
49 const MemoryRegionOps *xscom_ops;
52 #define PNV_CORE_TYPE_SUFFIX "-" TYPE_PNV_CORE
53 #define PNV_CORE_TYPE_NAME(cpu_model) cpu_model PNV_CORE_TYPE_SUFFIX
55 typedef struct PnvCPUState {
56 Object *intc;
57 } PnvCPUState;
59 static inline PnvCPUState *pnv_cpu_state(PowerPCCPU *cpu)
61 return (PnvCPUState *)cpu->machine_data;
64 #define TYPE_PNV_QUAD "powernv-cpu-quad"
65 OBJECT_DECLARE_SIMPLE_TYPE(PnvQuad, PNV_QUAD)
67 struct PnvQuad {
68 DeviceState parent_obj;
70 uint32_t id;
71 MemoryRegion xscom_regs;
73 #endif /* PPC_PNV_CORE_H */