提交 35112e41 编写于 作者: A Andreas Färber

target-i386: Add property getter for CPU stepping

Signed-off-by: NAndreas Färber <afaerber@suse.de>
Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
上级 67e30c83
...@@ -675,6 +675,18 @@ static void x86_cpuid_version_set_model(Object *obj, Visitor *v, void *opaque, ...@@ -675,6 +675,18 @@ static void x86_cpuid_version_set_model(Object *obj, Visitor *v, void *opaque,
env->cpuid_version |= ((value & 0xf) << 4) | ((value >> 4) << 16); env->cpuid_version |= ((value & 0xf) << 4) | ((value >> 4) << 16);
} }
static void x86_cpuid_version_get_stepping(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 & 0xf;
visit_type_int(v, &value, name, errp);
}
static void x86_cpuid_version_set_stepping(Object *obj, Visitor *v, static void x86_cpuid_version_set_stepping(Object *obj, Visitor *v,
void *opaque, const char *name, void *opaque, const char *name,
Error **errp) Error **errp)
...@@ -1570,7 +1582,7 @@ static void x86_cpu_initfn(Object *obj) ...@@ -1570,7 +1582,7 @@ static void x86_cpu_initfn(Object *obj)
x86_cpuid_version_get_model, x86_cpuid_version_get_model,
x86_cpuid_version_set_model, NULL, NULL, NULL); x86_cpuid_version_set_model, NULL, NULL, NULL);
object_property_add(obj, "stepping", "int", object_property_add(obj, "stepping", "int",
NULL, x86_cpuid_version_get_stepping,
x86_cpuid_version_set_stepping, NULL, NULL, NULL); x86_cpuid_version_set_stepping, NULL, NULL, NULL);
object_property_add_str(obj, "model-id", object_property_add_str(obj, "model-id",
NULL, NULL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册