Revision 0c7d19e5
b/hw/piix_pci.c | ||
---|---|---|
154 | 154 |
i440fx_update_memory_mappings(d); |
155 | 155 |
} |
156 | 156 |
|
157 |
static void i440fx_save(QEMUFile* f, void *opaque) |
|
158 |
{ |
|
159 |
PCII440FXState *d = opaque; |
|
160 |
|
|
161 |
pci_device_save(&d->dev, f); |
|
162 |
qemu_put_8s(f, &d->smm_enabled); |
|
163 |
} |
|
164 |
|
|
165 |
static int i440fx_load(QEMUFile* f, void *opaque, int version_id) |
|
157 |
static int i440fx_load_old(QEMUFile* f, void *opaque, int version_id) |
|
166 | 158 |
{ |
167 | 159 |
PCII440FXState *d = opaque; |
168 | 160 |
int ret, i; |
169 | 161 |
|
170 |
if (version_id > 3) |
|
171 |
return -EINVAL; |
|
172 | 162 |
ret = pci_device_load(&d->dev, f); |
173 | 163 |
if (ret < 0) |
174 | 164 |
return ret; |
... | ... | |
182 | 172 |
return 0; |
183 | 173 |
} |
184 | 174 |
|
175 |
static int i440fx_after_load(void *opaque) |
|
176 |
{ |
|
177 |
PCII440FXState *d = opaque; |
|
178 |
|
|
179 |
i440fx_update_memory_mappings(d); |
|
180 |
return 0; |
|
181 |
} |
|
182 |
|
|
183 |
static const VMStateDescription vmstate_i440fx = { |
|
184 |
.name = "I440FX", |
|
185 |
.version_id = 3, |
|
186 |
.minimum_version_id = 3, |
|
187 |
.minimum_version_id_old = 1, |
|
188 |
.load_state_old = i440fx_load_old, |
|
189 |
.run_after_load = i440fx_after_load, |
|
190 |
.fields = (VMStateField []) { |
|
191 |
VMSTATE_PCI_DEVICE(dev, PCII440FXState), |
|
192 |
VMSTATE_UINT8(smm_enabled, PCII440FXState), |
|
193 |
VMSTATE_END_OF_LIST() |
|
194 |
} |
|
195 |
}; |
|
196 |
|
|
185 | 197 |
static int i440fx_pcihost_initfn(SysBusDevice *dev) |
186 | 198 |
{ |
187 | 199 |
I440FXState *s = FROM_SYSBUS(I440FXState, dev); |
... | ... | |
210 | 222 |
|
211 | 223 |
d->dev.config[0x72] = 0x02; /* SMRAM */ |
212 | 224 |
|
213 |
register_savevm("I440FX", 0, 3, i440fx_save, i440fx_load, d);
|
|
225 |
vmstate_register(0, &vmstate_i440fx, d);
|
|
214 | 226 |
return 0; |
215 | 227 |
} |
216 | 228 |
|
Also available in: Unified diff