via.c (a348f108842fb928563865c9918642900cd0d477) via.c (f90c2bcdbc69e41e575f868b984c3e2de8f51bac)
1/*
2 * QEMU IDE Emulation: PCI VIA82C686B support.
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 * Copyright (c) 2006 Openedhand Ltd.
6 * Copyright (c) 2010 Huacai Chen <zltjiangshi@gmail.com>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy

--- 175 unchanged lines hidden (view full) ---

184
185 vmstate_register(&dev->qdev, 0, &vmstate_ide_pci, d);
186
187 vt82c686b_init_ports(d);
188
189 return 0;
190}
191
1/*
2 * QEMU IDE Emulation: PCI VIA82C686B support.
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 * Copyright (c) 2006 Openedhand Ltd.
6 * Copyright (c) 2010 Huacai Chen <zltjiangshi@gmail.com>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy

--- 175 unchanged lines hidden (view full) ---

184
185 vmstate_register(&dev->qdev, 0, &vmstate_ide_pci, d);
186
187 vt82c686b_init_ports(d);
188
189 return 0;
190}
191
192static int vt82c686b_ide_exitfn(PCIDevice *dev)
192static void vt82c686b_ide_exitfn(PCIDevice *dev)
193{
194 PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);
195 unsigned i;
196
197 for (i = 0; i < 2; ++i) {
198 memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io);
199 memory_region_destroy(&d->bmdma[i].extra_io);
200 memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_ioport);
201 memory_region_destroy(&d->bmdma[i].addr_ioport);
202 }
203 memory_region_destroy(&d->bmdma_bar);
193{
194 PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);
195 unsigned i;
196
197 for (i = 0; i < 2; ++i) {
198 memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io);
199 memory_region_destroy(&d->bmdma[i].extra_io);
200 memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_ioport);
201 memory_region_destroy(&d->bmdma[i].addr_ioport);
202 }
203 memory_region_destroy(&d->bmdma_bar);
204
205 return 0;
206}
207
208void vt82c686b_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
209{
210 PCIDevice *dev;
211
212 dev = pci_create_simple(bus, devfn, "via-ide");
213 pci_ide_create_devs(dev, hd_table);

--- 29 unchanged lines hidden ---
204}
205
206void vt82c686b_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
207{
208 PCIDevice *dev;
209
210 dev = pci_create_simple(bus, devfn, "via-ide");
211 pci_ide_create_devs(dev, hd_table);

--- 29 unchanged lines hidden ---