ia64/xen-unstable

changeset 14652:19f33f5ba96b

[HVM] Save/restore: Save the ACPI PM control register in qemu
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Thu Mar 29 15:28:27 2007 +0000 (2007-03-29)
parents 121a97005d11
children 8f5a947c0ea6
files tools/ioemu/hw/piix4acpi.c
line diff
     1.1 --- a/tools/ioemu/hw/piix4acpi.c	Thu Mar 29 15:27:18 2007 +0000
     1.2 +++ b/tools/ioemu/hw/piix4acpi.c	Thu Mar 29 15:28:27 2007 +0000
     1.3 @@ -57,6 +57,20 @@ typedef struct PCIAcpiState {
     1.4      uint16_t pm1_control; /* pm1a_ECNT_BLK */
     1.5  } PCIAcpiState;
     1.6  
     1.7 +static void piix4acpi_save(QEMUFile *f, void *opaque)
     1.8 +{
     1.9 +    PCIAcpiState *s = opaque;
    1.10 +    qemu_put_be16s(f, &s->pm1_control);
    1.11 +}
    1.12 +
    1.13 +static int piix4acpi_load(QEMUFile *f, void *opaque, int version_id)
    1.14 +{
    1.15 +    PCIAcpiState *s = opaque;
    1.16 +    if (version_id > 1) 
    1.17 +        return -EINVAL;
    1.18 +    qemu_get_be16s(f, &s->pm1_control);
    1.19 +}
    1.20 +
    1.21  static void acpiPm1Control_writeb(void *opaque, uint32_t addr, uint32_t val)
    1.22  {
    1.23      PCIAcpiState *s = opaque;
    1.24 @@ -193,4 +207,8 @@ void pci_piix4_acpi_init(PCIBus *bus, in
    1.25      d->pm1_control = SCI_EN;
    1.26  
    1.27      acpi_map(d, 0, 0x1f40, 0x10, PCI_ADDRESS_SPACE_IO);
    1.28 +
    1.29 +    register_savevm("piix4acpi", 0, 1, piix4acpi_save, piix4acpi_load, d);    
    1.30 +    register_savevm("piix4acpi_pci", 0, 1, generic_pci_save, generic_pci_load, 
    1.31 +                    &d->dev);
    1.32  }