@@ -95,7 +95,7 @@ struct ICSStateClass {
DeviceClass parent_class;
DeviceRealize parent_realize;
- DeviceReset parent_reset;
+ ResettablePhases parent_phases;
void (*reject)(ICSState *s, uint32_t irq);
void (*resend)(ICSState *s);
@@ -228,12 +228,14 @@ static void phb3_msi_resend(ICSState *ics)
}
}
-static void phb3_msi_reset(DeviceState *dev)
+static void phb3_msi_reset_hold(Object *obj)
{
- Phb3MsiState *msi = PHB3_MSI(dev);
- ICSStateClass *icsc = ICS_GET_CLASS(dev);
+ Phb3MsiState *msi = PHB3_MSI(obj);
+ ICSStateClass *icsc = ICS_GET_CLASS(obj);
- icsc->parent_reset(dev);
+ if (icsc->parent_phases.hold) {
+ icsc->parent_phases.hold(obj);
+ }
memset(msi->rba, 0, sizeof(msi->rba));
msi->rba_sum = 0;
@@ -287,11 +289,12 @@ static void phb3_msi_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
ICSStateClass *isc = ICS_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
device_class_set_parent_realize(dc, phb3_msi_realize,
&isc->parent_realize);
- device_class_set_parent_reset(dc, phb3_msi_reset,
- &isc->parent_reset);
+ resettable_class_set_parent_phases(rc, NULL, phb3_msi_reset_hold, NULL,
+ &isc->parent_phases);
isc->reject = phb3_msi_reject;
isc->resend = phb3_msi_resend;