mirror of
https://github.com/qemu/qemu.git
synced 2024-12-04 17:23:39 +08:00
hw/intc: Convert TYPE_KVM_ARM_ITS to 3-phase reset
Convert the TYPE_KVM_ARM_ITS device to 3-phase reset. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20221109161444.3397405-10-peter.maydell@linaro.org
This commit is contained in:
parent
1bcb90762b
commit
227b5866c0
@ -37,7 +37,7 @@ DECLARE_OBJ_CHECKERS(GICv3ITSState, KVMARMITSClass,
|
||||
|
||||
struct KVMARMITSClass {
|
||||
GICv3ITSCommonClass parent_class;
|
||||
void (*parent_reset)(DeviceState *dev);
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
|
||||
@ -197,13 +197,15 @@ static void kvm_arm_its_post_load(GICv3ITSState *s)
|
||||
GITS_CTLR, &s->ctlr, true, &error_abort);
|
||||
}
|
||||
|
||||
static void kvm_arm_its_reset(DeviceState *dev)
|
||||
static void kvm_arm_its_reset_hold(Object *obj)
|
||||
{
|
||||
GICv3ITSState *s = ARM_GICV3_ITS_COMMON(dev);
|
||||
GICv3ITSState *s = ARM_GICV3_ITS_COMMON(obj);
|
||||
KVMARMITSClass *c = KVM_ARM_ITS_GET_CLASS(s);
|
||||
int i;
|
||||
|
||||
c->parent_reset(dev);
|
||||
if (c->parent_phases.hold) {
|
||||
c->parent_phases.hold(obj);
|
||||
}
|
||||
|
||||
if (kvm_device_check_attr(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL,
|
||||
KVM_DEV_ARM_ITS_CTRL_RESET)) {
|
||||
@ -241,12 +243,14 @@ static Property kvm_arm_its_props[] = {
|
||||
static void kvm_arm_its_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ResettableClass *rc = RESETTABLE_CLASS(klass);
|
||||
GICv3ITSCommonClass *icc = ARM_GICV3_ITS_COMMON_CLASS(klass);
|
||||
KVMARMITSClass *ic = KVM_ARM_ITS_CLASS(klass);
|
||||
|
||||
dc->realize = kvm_arm_its_realize;
|
||||
device_class_set_props(dc, kvm_arm_its_props);
|
||||
device_class_set_parent_reset(dc, kvm_arm_its_reset, &ic->parent_reset);
|
||||
resettable_class_set_parent_phases(rc, NULL, kvm_arm_its_reset_hold, NULL,
|
||||
&ic->parent_phases);
|
||||
icc->send_msi = kvm_its_send_msi;
|
||||
icc->pre_save = kvm_arm_its_pre_save;
|
||||
icc->post_load = kvm_arm_its_post_load;
|
||||
|
Loading…
Reference in New Issue
Block a user