aboutsummaryrefslogtreecommitdiff
path: root/hw/intc/i8259_common.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-12-10 14:38:19 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-12-21 09:30:32 +0100
commitb8c7723440324a7822acdb0b6f35c7ccb791862a (patch)
tree4d0f006635eb102d03eaec95748a3ad93eb13374 /hw/intc/i8259_common.c
parente267d16496e3998f271767a80ff9b0cc43be8a35 (diff)
i8259: move TYPE_INTERRUPT_STATS_PROVIDER upper
Now both classes (i8259, i8259-kvm) support this. Move this upper to the common class code. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20171210063819.14892-6-peterx@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/intc/i8259_common.c')
-rw-r--r--hw/intc/i8259_common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/intc/i8259_common.c b/hw/intc/i8259_common.c
index 7efd2e8012..c75c880157 100644
--- a/hw/intc/i8259_common.c
+++ b/hw/intc/i8259_common.c
@@ -178,6 +178,7 @@ static Property pic_properties_common[] = {
static void pic_common_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ InterruptStatsProviderClass *ic = INTERRUPT_STATS_PROVIDER_CLASS(klass);
dc->vmsd = &vmstate_pic_common;
dc->props = pic_properties_common;
@@ -189,6 +190,8 @@ static void pic_common_class_init(ObjectClass *klass, void *data)
* code.
*/
dc->user_creatable = false;
+ ic->get_statistics = pic_get_statistics;
+ ic->print_info = pic_print_info;
}
static const TypeInfo pic_common_type = {
@@ -198,6 +201,10 @@ static const TypeInfo pic_common_type = {
.class_size = sizeof(PICCommonClass),
.class_init = pic_common_class_init,
.abstract = true,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_INTERRUPT_STATS_PROVIDER },
+ { }
+ },
};
static void pic_common_register_types(void)