mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
hw/arm/exynos4210: Put combiners into state struct
Switch the creation of the combiner devices to the new-style "embedded in state struct" approach, so we can easily refer to the object elsewhere during realize. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220404154658.565020-18-peter.maydell@linaro.org
This commit is contained in:
parent
76621953c9
commit
cebef07df5
4 changed files with 72 additions and 39 deletions
|
@ -31,7 +31,7 @@
|
|||
#include "hw/sysbus.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qemu/module.h"
|
||||
|
||||
#include "hw/intc/exynos4210_combiner.h"
|
||||
#include "hw/arm/exynos4210.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/irq.h"
|
||||
|
@ -48,36 +48,7 @@
|
|||
#define DPRINTF(fmt, ...) do {} while (0)
|
||||
#endif
|
||||
|
||||
#define IIC_NGRP 64 /* Internal Interrupt Combiner
|
||||
Groups number */
|
||||
#define IIC_NIRQ (IIC_NGRP * 8)/* Internal Interrupt Combiner
|
||||
Interrupts number */
|
||||
#define IIC_REGION_SIZE 0x108 /* Size of memory mapped region */
|
||||
#define IIC_REGSET_SIZE 0x41
|
||||
|
||||
/*
|
||||
* State for each output signal of internal combiner
|
||||
*/
|
||||
typedef struct CombinerGroupState {
|
||||
uint8_t src_mask; /* 1 - source enabled, 0 - disabled */
|
||||
uint8_t src_pending; /* Pending source interrupts before masking */
|
||||
} CombinerGroupState;
|
||||
|
||||
#define TYPE_EXYNOS4210_COMBINER "exynos4210.combiner"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210CombinerState, EXYNOS4210_COMBINER)
|
||||
|
||||
struct Exynos4210CombinerState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion iomem;
|
||||
|
||||
struct CombinerGroupState group[IIC_NGRP];
|
||||
uint32_t reg_set[IIC_REGSET_SIZE];
|
||||
uint32_t icipsr[2];
|
||||
uint32_t external; /* 1 means that this combiner is external */
|
||||
|
||||
qemu_irq output_irq[IIC_NGRP];
|
||||
};
|
||||
|
||||
static const VMStateDescription vmstate_exynos4210_combiner_group_state = {
|
||||
.name = "exynos4210.combiner.groupstate",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue