thermosphere: vgic: largely reduce the number of mmio accesses

since we have to use 64 bits for VirqState anyway
This commit is contained in:
TuxSH
2020-01-05 23:51:17 +00:00
parent d560330a9d
commit 2219494675
4 changed files with 61 additions and 37 deletions

View File

@@ -70,12 +70,12 @@ static inline void generateSgiForAll(ThermosphereSgi id)
generateSgiForList(id, MASK(g_irqManager.numCpuInterfaces));
}
static inline bool irqIsEnabled(u16 id)
{
return (g_irqManager.gic.gicd->isenabler[id / 32] & BIT(id % 32)) != 0;
}
static inline bool irqIsGuest(u16 id)
{
if (id >= 32 + g_irqManager.numSharedInterrupts) {
DEBUG("vgic: %u not supported by physical distributor\n", (u32)id);
return false;
}
return id != GIC_IRQID_MAINTENANCE && id != GIC_IRQID_HYP_TIMER;
}