From 3b542549661eb216580e8b7683e13caa3950da45 Mon Sep 17 00:00:00 2001 From: Bharata B Rao Date: Fri, 10 Jun 2016 06:29:01 +0530 Subject: spapr: Abstract CPU core device and type specific core devices Add sPAPR specific abastract CPU core device that is based on generic CPU core device. Use this as base type to create sPAPR CPU specific core devices. TODO: - Add core types for other remaining CPU types - Handle CPU model alias correctly Signed-off-by: Bharata B Rao Signed-off-by: David Gibson --- include/hw/ppc/spapr.h | 1 + include/hw/ppc/spapr_cpu_core.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 include/hw/ppc/spapr_cpu_core.h (limited to 'include/hw/ppc') diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 3ac85c07d7..f597cc2251 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -582,6 +582,7 @@ void spapr_hotplug_req_add_by_count(sPAPRDRConnectorType drc_type, uint32_t count); void spapr_hotplug_req_remove_by_count(sPAPRDRConnectorType drc_type, uint32_t count); +void spapr_cpu_init(sPAPRMachineState *spapr, PowerPCCPU *cpu, Error **errp); /* rtas-configure-connector state */ struct sPAPRConfigureConnectorState { diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_core.h new file mode 100644 index 0000000000..424edeccc9 --- /dev/null +++ b/include/hw/ppc/spapr_cpu_core.h @@ -0,0 +1,29 @@ +/* + * sPAPR CPU core device. + * + * Copyright (C) 2016 Bharata B Rao + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef HW_SPAPR_CPU_CORE_H +#define HW_SPAPR_CPU_CORE_H + +#include "hw/qdev.h" +#include "hw/cpu/core.h" +#include "target-ppc/cpu-qom.h" + +#define TYPE_SPAPR_CPU_CORE "spapr-cpu-core" +#define SPAPR_CPU_CORE(obj) \ + OBJECT_CHECK(sPAPRCPUCore, (obj), TYPE_SPAPR_CPU_CORE) + +typedef struct sPAPRCPUCore { + /*< private >*/ + CPUCore parent_obj; + + /*< public >*/ + void *threads; + ObjectClass *cpu_class; +} sPAPRCPUCore; + +#endif -- cgit v1.2.1