mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/intc/loongarch_extioi: Add common realize interface
Add common realize function, it is only to check validity of property. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Reviewed-by: Song Gao <gaosong@loongson.cn>
This commit is contained in:
parent
c169b51b17
commit
aa6330d50c
1 changed files with 14 additions and 2 deletions
|
@ -318,14 +318,26 @@ static const MemoryRegionOps extioi_virt_ops = {
|
||||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void loongarch_extioi_common_realize(DeviceState *dev, Error **errp)
|
||||||
|
{
|
||||||
|
LoongArchExtIOICommonState *s = (LoongArchExtIOICommonState *)dev;
|
||||||
|
|
||||||
|
if (s->num_cpu == 0) {
|
||||||
|
error_setg(errp, "num-cpu must be at least 1");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void loongarch_extioi_realize(DeviceState *dev, Error **errp)
|
static void loongarch_extioi_realize(DeviceState *dev, Error **errp)
|
||||||
{
|
{
|
||||||
LoongArchExtIOI *s = LOONGARCH_EXTIOI(dev);
|
LoongArchExtIOI *s = LOONGARCH_EXTIOI(dev);
|
||||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||||
|
Error *local_err = NULL;
|
||||||
int i, pin;
|
int i, pin;
|
||||||
|
|
||||||
if (s->num_cpu == 0) {
|
loongarch_extioi_common_realize(dev, &local_err);
|
||||||
error_setg(errp, "num-cpu must be at least 1");
|
if (local_err) {
|
||||||
|
error_propagate(errp, local_err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue