summary refs log tree commit diff stats
path: root/hw/pci.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-08-17 10:46:34 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-08-17 10:46:34 +0000
commit1941d19c657a8084603e88d7860786baa40c0e80 (patch)
treee40f3b80ebfe96c335e594678218ae8b0eb726bc /hw/pci.c
parent89b6b508929d63b2a3dda18692fcb724afb43336 (diff)
downloadfocaccia-qemu-1941d19c657a8084603e88d7860786baa40c0e80.tar.gz
focaccia-qemu-1941d19c657a8084603e88d7860786baa40c0e80.zip
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.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 85531f72ee..75bd981104 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -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;
 }