mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
target-i386: Add property getter for CPU model
Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
parent
95b8519d16
commit
67e30c8349
1 changed files with 13 additions and 1 deletions
|
@ -640,6 +640,18 @@ static void x86_cpuid_version_set_family(Object *obj, Visitor *v, void *opaque,
|
|||
}
|
||||
}
|
||||
|
||||
static void x86_cpuid_version_get_model(Object *obj, Visitor *v, void *opaque,
|
||||
const char *name, Error **errp)
|
||||
{
|
||||
X86CPU *cpu = X86_CPU(obj);
|
||||
CPUX86State *env = &cpu->env;
|
||||
int64_t value;
|
||||
|
||||
value = (env->cpuid_version >> 4) & 0xf;
|
||||
value |= ((env->cpuid_version >> 16) & 0xf) << 4;
|
||||
visit_type_int(v, &value, name, errp);
|
||||
}
|
||||
|
||||
static void x86_cpuid_version_set_model(Object *obj, Visitor *v, void *opaque,
|
||||
const char *name, Error **errp)
|
||||
{
|
||||
|
@ -1555,7 +1567,7 @@ static void x86_cpu_initfn(Object *obj)
|
|||
x86_cpuid_version_get_family,
|
||||
x86_cpuid_version_set_family, NULL, NULL, NULL);
|
||||
object_property_add(obj, "model", "int",
|
||||
NULL,
|
||||
x86_cpuid_version_get_model,
|
||||
x86_cpuid_version_set_model, NULL, NULL, NULL);
|
||||
object_property_add(obj, "stepping", "int",
|
||||
NULL,
|
||||
|
|
Loading…
Reference in a new issue