diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-08-17 10:46:34 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-08-17 10:46:34 +0000 |
commit | 1941d19c657a8084603e88d7860786baa40c0e80 (patch) | |
tree | e40f3b80ebfe96c335e594678218ae8b0eb726bc /hw/pci.c | |
parent | 89b6b508929d63b2a3dda18692fcb724afb43336 (diff) |
PCI save/restore changes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2115 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pci.c')
-rw-r--r-- | hw/pci.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -36,6 +36,8 @@ struct PCIBus { PCIDevice *devices[256]; }; +static void pci_update_mappings(PCIDevice *d); + target_phys_addr_t pci_mem_base; static int pci_irq_index; static PCIBus *first_bus; @@ -56,21 +58,20 @@ int pci_bus_num(PCIBus *s) return s->bus_num; } -void generic_pci_save(QEMUFile* f, void *opaque) +void pci_device_save(PCIDevice *s, QEMUFile *f) { - PCIDevice* s=(PCIDevice*)opaque; - + qemu_put_be32(f, 1); /* PCI device version */ qemu_put_buffer(f, s->config, 256); } -int generic_pci_load(QEMUFile* f, void *opaque, int version_id) +int pci_device_load(PCIDevice *s, QEMUFile *f) { - PCIDevice* s=(PCIDevice*)opaque; - + uint32_t version_id; + version_id = qemu_get_be32(f); if (version_id != 1) return -EINVAL; - qemu_get_buffer(f, s->config, 256); + pci_update_mappings(s); return 0; } |