Commit 1823082ccc32394fe2788b6b545fd080d60bb7e7
1 parent
05b4ff43
PCI device saving for GT64xxx.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2954 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
21 additions
and
0 deletions
hw/gt64xxx.c
@@ -945,6 +945,25 @@ static void gt64120_write_config(PCIDevice *d, uint32_t address, uint32_t val, | @@ -945,6 +945,25 @@ static void gt64120_write_config(PCIDevice *d, uint32_t address, uint32_t val, | ||
945 | pci_default_write_config(d, address, val, len); | 945 | pci_default_write_config(d, address, val, len); |
946 | } | 946 | } |
947 | 947 | ||
948 | +static void gt64120_save(QEMUFile* f, void *opaque) | ||
949 | +{ | ||
950 | + PCIDevice *d = opaque; | ||
951 | + pci_device_save(d, f); | ||
952 | +} | ||
953 | + | ||
954 | +static int gt64120_load(QEMUFile* f, void *opaque, int version_id) | ||
955 | +{ | ||
956 | + PCIDevice *d = opaque; | ||
957 | + int ret; | ||
958 | + | ||
959 | + if (version_id != 1) | ||
960 | + return -EINVAL; | ||
961 | + ret = pci_device_load(d, f); | ||
962 | + if (ret < 0) | ||
963 | + return ret; | ||
964 | + return 0; | ||
965 | +} | ||
966 | + | ||
948 | PCIBus *pci_gt64120_init(qemu_irq *pic) | 967 | PCIBus *pci_gt64120_init(qemu_irq *pic) |
949 | { | 968 | { |
950 | GT64120State *s; | 969 | GT64120State *s; |
@@ -988,5 +1007,7 @@ PCIBus *pci_gt64120_init(qemu_irq *pic) | @@ -988,5 +1007,7 @@ PCIBus *pci_gt64120_init(qemu_irq *pic) | ||
988 | d->config[0x27] = 0x14; | 1007 | d->config[0x27] = 0x14; |
989 | d->config[0x3D] = 0x01; | 1008 | d->config[0x3D] = 0x01; |
990 | 1009 | ||
1010 | + register_savevm("GT64120 PCI Bus", 0, 1, gt64120_save, gt64120_load, d); | ||
1011 | + | ||
991 | return s->pci->bus; | 1012 | return s->pci->bus; |
992 | } | 1013 | } |