aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-03 13:56:00 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-03 13:56:00 +0000
commit30ca2aab8e7419d2c8cf597743633a6477840277 (patch)
tree5692e8dfdb7f3745c4b9e8af3fa149c0af124d5a /hw/pci.c
parent8a8a608f6e2dc3d258bd765afa0aea6e1c33475c (diff)
downloadqemu-30ca2aab8e7419d2c8cf597743633a6477840277.zip
qemu-30ca2aab8e7419d2c8cf597743633a6477840277.tar.gz
qemu-30ca2aab8e7419d2c8cf597743633a6477840277.tar.bz2
ne2000 savevm support (Johannes Schindelin)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1092 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/pci.c b/hw/pci.c
index a6f452f..f159dc2 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -62,6 +62,24 @@ static PCIBus *pci_register_bus(void)
return bus;
}
+void generic_pci_save(QEMUFile* f, void *opaque)
+{
+ PCIDevice* s=(PCIDevice*)opaque;
+
+ qemu_put_buffer(f, s->config, 256);
+}
+
+int generic_pci_load(QEMUFile* f, void *opaque, int version_id)
+{
+ PCIDevice* s=(PCIDevice*)opaque;
+
+ if (version_id != 1)
+ return -EINVAL;
+
+ qemu_get_buffer(f, s->config, 256);
+ return 0;
+}
+
/* -1 for devfn means auto assign */
PCIDevice *pci_register_device(PCIBus *bus, const char *name,
int instance_size, int devfn,
@@ -558,6 +576,8 @@ void piix3_init(PCIBus *bus)
d = (PIIX3State *)pci_register_device(bus, "PIIX3", sizeof(PIIX3State),
-1, NULL, NULL);
+ register_savevm("PIIX3", 0, 1, generic_pci_save, generic_pci_load, d);
+
piix3_state = d;
pci_conf = d->dev.config;