In order to support irqchip_in_kenrel method, split loongarch pch pic driver into two parts, pic common and pic TCG driver. LoongArch pic common driver includes vmstate and property interface, also vmstate load and store interface is defined in pic common driver.
In future LoongArch pic kvm driver can inherit from pic common driver. --- v1 ... v2: 1. Reorganize the patchset, put macro and structure moving patch as first one 2. Split the patchset with smaller patch, so that it is easier to review --- Bibo Mao (8): include: Add loongarch_pic_common header file include: Move struct LoongArchPCHPIC to loongarch_pic_common header file hw/intc/loongarch_pch: Merge instance_init() into realize() hw/intc/loongarch_pch: Rename LoongArchPCHPIC with LoongArchPICCommonState hw/intc/loongarch_pch: Move some functions to file loongarch_pic_common hw/intc/loongarch_pch: Inherit from loongarch_pic_common hw/intc/loongarch_pch: Add pre_save and post_load interfaces hw/intc/loongarch_pch: Code cleanup about loongarch_pch_pic hw/intc/loongarch_pch_pic.c | 106 ++++++++----------------- hw/intc/loongarch_pic_common.c | 97 ++++++++++++++++++++++ hw/intc/meson.build | 2 +- hw/loongarch/virt.c | 2 +- include/hw/intc/loongarch_pch_pic.h | 70 ++++------------ include/hw/intc/loongarch_pic_common.h | 82 +++++++++++++++++++ 6 files changed, 230 insertions(+), 129 deletions(-) create mode 100644 hw/intc/loongarch_pic_common.c create mode 100644 include/hw/intc/loongarch_pic_common.h base-commit: 2b81c046252fbfb375ad30632362fc16e6e22bd5 -- 2.39.3