mirror of https://github.com/xemu-project/xemu.git
nv2a: Use Resettable interface
This commit is contained in:
parent
3106ea97e5
commit
9327159f7c
|
@ -350,10 +350,10 @@ static void nv2a_exitfn(PCIDevice *dev)
|
||||||
pgraph_destroy(&d->pgraph);
|
pgraph_destroy(&d->pgraph);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qdev_nv2a_reset(DeviceState *dev)
|
static void nv2a_reset_hold(Object *obj, ResetType type)
|
||||||
{
|
{
|
||||||
NV2AState *d = NV2A_DEVICE(dev);
|
NV2AState *s = NV2A_DEVICE(obj);
|
||||||
nv2a_reset(d);
|
nv2a_reset(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: This is handled as a VM state change and not as a `pre_save` callback
|
// Note: This is handled as a VM state change and not as a `pre_save` callback
|
||||||
|
@ -548,6 +548,7 @@ static const VMStateDescription vmstate_nv2a = {
|
||||||
static void nv2a_class_init(ObjectClass *klass, void *data)
|
static void nv2a_class_init(ObjectClass *klass, void *data)
|
||||||
{
|
{
|
||||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
|
ResettableClass *rc = RESETTABLE_CLASS(klass);
|
||||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||||
|
|
||||||
k->vendor_id = PCI_VENDOR_ID_NVIDIA;
|
k->vendor_id = PCI_VENDOR_ID_NVIDIA;
|
||||||
|
@ -562,9 +563,10 @@ static void nv2a_class_init(ObjectClass *klass, void *data)
|
||||||
k->realize = nv2a_realize;
|
k->realize = nv2a_realize;
|
||||||
k->exit = nv2a_exitfn;
|
k->exit = nv2a_exitfn;
|
||||||
|
|
||||||
|
rc->phases.hold = nv2a_reset_hold;
|
||||||
|
|
||||||
dc->desc = "GeForce NV2A Integrated Graphics";
|
dc->desc = "GeForce NV2A Integrated Graphics";
|
||||||
dc->vmsd = &vmstate_nv2a;
|
dc->vmsd = &vmstate_nv2a;
|
||||||
dc->reset = qdev_nv2a_reset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo nv2a_info = {
|
static const TypeInfo nv2a_info = {
|
||||||
|
|
Loading…
Reference in New Issue