hw/intc/loongson_ipi: Move IPICore structure to loongson_ipi_common.h

Move the IPICore structure and corresponding common fields
of LoongsonIPICommonState to "hw/intc/loongson_ipi_common.h".

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
[PMD: Extracted from bigger commit, added commit description]
Co-Developed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Tested-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Message-Id: <20240805180622.21001-7-philmd@linaro.org>
This commit is contained in:
Bibo Mao 2024-07-23 11:55:41 +02:00 committed by Philippe Mathieu-Daudé
parent a022e0de53
commit 6c8698a5e4
4 changed files with 70 additions and 57 deletions

View file

@ -12,22 +12,9 @@
#include "hw/intc/loongson_ipi_common.h"
#include "hw/sysbus.h"
#define IPI_MBX_NUM 4
#define TYPE_LOONGSON_IPI "loongson_ipi"
OBJECT_DECLARE_TYPE(LoongsonIPIState, LoongsonIPIClass, LOONGSON_IPI)
typedef struct IPICore {
LoongsonIPIState *ipi;
uint32_t status;
uint32_t en;
uint32_t set;
uint32_t clear;
/* 64bit buf divide into 2 32bit buf */
uint32_t buf[IPI_MBX_NUM * 2];
qemu_irq irq;
} IPICore;
struct LoongsonIPIClass {
LoongsonIPICommonClass parent_class;
@ -39,10 +26,6 @@ struct LoongsonIPIState {
LoongsonIPICommonState parent_obj;
MemoryRegion *ipi_mmio_mem;
MemoryRegion ipi_iocsr_mem;
MemoryRegion ipi64_iocsr_mem;
uint32_t num_cpu;
IPICore *cpu;
};
#endif