mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
hw/i386: Make pit a property of common x86 base machine type
Both pc and microvm have pit property individually. Let's just make it the property of common x86 base machine type. Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Message-Id: <20220310122811.807794-2-xiaoyao.li@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
1f1a7b2269
commit
9dee7e5109
6 changed files with 31 additions and 51 deletions
|
@ -1244,6 +1244,23 @@ static void x86_machine_set_acpi(Object *obj, Visitor *v, const char *name,
|
|||
visit_type_OnOffAuto(v, name, &x86ms->acpi, errp);
|
||||
}
|
||||
|
||||
static void x86_machine_get_pit(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
OnOffAuto pit = x86ms->pit;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &pit, errp);
|
||||
}
|
||||
|
||||
static void x86_machine_set_pit(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &x86ms->pit, errp);
|
||||
}
|
||||
|
||||
static char *x86_machine_get_oem_id(Object *obj, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
|
@ -1333,6 +1350,7 @@ static void x86_machine_initfn(Object *obj)
|
|||
|
||||
x86ms->smm = ON_OFF_AUTO_AUTO;
|
||||
x86ms->acpi = ON_OFF_AUTO_AUTO;
|
||||
x86ms->pit = ON_OFF_AUTO_AUTO;
|
||||
x86ms->pci_irq_mask = ACPI_BUILD_PCI_IRQS;
|
||||
x86ms->oem_id = g_strndup(ACPI_BUILD_APPNAME6, 6);
|
||||
x86ms->oem_table_id = g_strndup(ACPI_BUILD_APPNAME8, 8);
|
||||
|
@ -1364,6 +1382,13 @@ static void x86_machine_class_init(ObjectClass *oc, void *data)
|
|||
object_class_property_set_description(oc, X86_MACHINE_ACPI,
|
||||
"Enable ACPI");
|
||||
|
||||
object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto",
|
||||
x86_machine_get_pit,
|
||||
x86_machine_set_pit,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, X86_MACHINE_PIT,
|
||||
"Enable i8254 PIT");
|
||||
|
||||
object_class_property_add_str(oc, X86_MACHINE_OEM_ID,
|
||||
x86_machine_get_oem_id,
|
||||
x86_machine_set_oem_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue