2016-06-10 00:59:01 +00:00
|
|
|
/*
|
|
|
|
* sPAPR CPU core device.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 Bharata B Rao <bharata@linux.vnet.ibm.com>
|
|
|
|
*
|
|
|
|
* 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"
|
2016-10-11 06:56:52 +00:00
|
|
|
#include "target/ppc/cpu-qom.h"
|
2018-05-01 06:22:49 +00:00
|
|
|
#include "target/ppc/cpu.h"
|
2016-06-10 00:59:01 +00:00
|
|
|
|
|
|
|
#define TYPE_SPAPR_CPU_CORE "spapr-cpu-core"
|
|
|
|
#define SPAPR_CPU_CORE(obj) \
|
|
|
|
OBJECT_CHECK(sPAPRCPUCore, (obj), TYPE_SPAPR_CPU_CORE)
|
2016-09-12 07:57:20 +00:00
|
|
|
#define SPAPR_CPU_CORE_CLASS(klass) \
|
|
|
|
OBJECT_CLASS_CHECK(sPAPRCPUCoreClass, (klass), TYPE_SPAPR_CPU_CORE)
|
|
|
|
#define SPAPR_CPU_CORE_GET_CLASS(obj) \
|
|
|
|
OBJECT_GET_CLASS(sPAPRCPUCoreClass, (obj), TYPE_SPAPR_CPU_CORE)
|
2016-06-10 00:59:01 +00:00
|
|
|
|
2017-10-09 19:51:00 +00:00
|
|
|
#define SPAPR_CPU_CORE_TYPE_NAME(model) model "-" TYPE_SPAPR_CPU_CORE
|
|
|
|
|
2016-06-10 00:59:01 +00:00
|
|
|
typedef struct sPAPRCPUCore {
|
|
|
|
/*< private >*/
|
|
|
|
CPUCore parent_obj;
|
|
|
|
|
|
|
|
/*< public >*/
|
2017-11-20 09:19:54 +00:00
|
|
|
PowerPCCPU **threads;
|
2017-05-10 11:29:46 +00:00
|
|
|
int node_id;
|
2018-06-18 12:26:35 +00:00
|
|
|
bool pre_3_0_migration; /* older machine don't know about sPAPRCPUState */
|
2016-06-10 00:59:01 +00:00
|
|
|
} sPAPRCPUCore;
|
|
|
|
|
2016-09-12 07:57:20 +00:00
|
|
|
typedef struct sPAPRCPUCoreClass {
|
|
|
|
DeviceClass parent_class;
|
2017-10-09 19:51:01 +00:00
|
|
|
const char *cpu_type;
|
2016-09-12 07:57:20 +00:00
|
|
|
} sPAPRCPUCoreClass;
|
|
|
|
|
2017-10-09 19:51:05 +00:00
|
|
|
const char *spapr_get_cpu_core_type(const char *cpu_type);
|
2018-05-01 06:22:49 +00:00
|
|
|
void spapr_cpu_set_entry_state(PowerPCCPU *cpu, target_ulong nip, target_ulong r3);
|
|
|
|
|
2018-06-13 06:22:18 +00:00
|
|
|
typedef struct sPAPRCPUState {
|
|
|
|
uint64_t vpa_addr;
|
|
|
|
uint64_t slb_shadow_addr, slb_shadow_size;
|
|
|
|
uint64_t dtl_addr, dtl_size;
|
|
|
|
} sPAPRCPUState;
|
|
|
|
|
|
|
|
static inline sPAPRCPUState *spapr_cpu_state(PowerPCCPU *cpu)
|
|
|
|
{
|
|
|
|
return (sPAPRCPUState *)cpu->machine_data;
|
|
|
|
}
|
|
|
|
|
2016-06-10 00:59:01 +00:00
|
|
|
#endif
|