/**
* CPUClass:
* @reset: Callback to reset the #CPUState to its initial state.
- * @get_arch_id: Callback for getting architecture-dependent CPU ID.
*
* Represents a CPU family or model.
*/
/*< public >*/
void (*reset)(CPUState *cpu);
- int64_t (*get_arch_id)(CPUState *cpu);
} CPUClass;
/**
{
}
-static int64_t cpu_common_get_arch_id(CPUState *cpu)
-{
- /* Not used in Xen, so no backport.
- * There is a missing cpu_index field in CPUState. */
- abort();
-}
-
static void cpu_class_init(ObjectClass *klass, void *data)
{
CPUClass *k = CPU_CLASS(klass);
k->reset = cpu_common_reset;
- k->get_arch_id = cpu_common_get_arch_id;
}
static TypeInfo cpu_type_info = {
}
}
-static int64_t x86_cpu_get_arch_id(CPUState *cs)
-{
- X86CPU *cpu = X86_CPU(cs);
- CPUX86State *env = &cpu->env;
-
- return env->cpuid_apic_id;
-}
-
static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
{
X86CPUClass *xcc = X86_CPU_CLASS(oc);
xcc->parent_reset = cc->reset;
cc->reset = x86_cpu_reset;
-
- cc->get_arch_id = x86_cpu_get_arch_id;
}
static const TypeInfo x86_cpu_type_info = {