debuggers.hg

view tools/ioemu/patches/ioemu-save-restore-acpi @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 Index: ioemu/hw/piix4acpi.c
2 ===================================================================
3 --- ioemu.orig/hw/piix4acpi.c 2007-05-09 13:54:28.000000000 +0100
4 +++ ioemu/hw/piix4acpi.c 2007-05-09 13:54:41.000000000 +0100
5 @@ -57,6 +57,26 @@
6 uint16_t pm1_control; /* pm1a_ECNT_BLK */
7 } PCIAcpiState;
9 +static void piix4acpi_save(QEMUFile *f, void *opaque)
10 +{
11 + PCIAcpiState *s = opaque;
12 + pci_device_save(&s->dev, f);
13 + qemu_put_be16s(f, &s->pm1_control);
14 +}
15 +
16 +static int piix4acpi_load(QEMUFile *f, void *opaque, int version_id)
17 +{
18 + PCIAcpiState *s = opaque;
19 + int ret;
20 + if (version_id > 1)
21 + return -EINVAL;
22 + ret = pci_device_load(&s->dev, f);
23 + if (ret < 0)
24 + return ret;
25 + qemu_get_be16s(f, &s->pm1_control);
26 + return 0;
27 +}
28 +
29 static void acpiPm1Control_writeb(void *opaque, uint32_t addr, uint32_t val)
30 {
31 PCIAcpiState *s = opaque;
32 @@ -193,4 +213,6 @@
33 d->pm1_control = SCI_EN;
35 acpi_map((PCIDevice *)d, 0, 0x1f40, 0x10, PCI_ADDRESS_SPACE_IO);
36 +
37 + register_savevm("piix4acpi", 0, 1, piix4acpi_save, piix4acpi_load, d);
38 }