thermosphere: vgic: fix enabled state of virqs

This commit is contained in:
TuxSH 2019-12-26 00:33:21 +00:00
parent e3b6d64f1b
commit 27859a7541

View file

@ -265,6 +265,8 @@ static void vgicSetInterruptEnabledState(u16 id)
if (vgicIsVirqPending(state)) { if (vgicIsVirqPending(state)) {
vgicNotifyOtherCoreList(g_irqManager.gic.gicd->itargetsr[id]); vgicNotifyOtherCoreList(g_irqManager.gic.gicd->itargetsr[id]);
} }
g_irqManager.gic.gicd->isenabler[id / 32] |= BIT(id % 32);
} }
static void vgicClearInterruptEnabledState(u16 id) static void vgicClearInterruptEnabledState(u16 id)
@ -282,7 +284,7 @@ static void vgicClearInterruptEnabledState(u16 id)
vgicNotifyOtherCoreList(BIT(vgicGetVirqStateCoreId(state))); vgicNotifyOtherCoreList(BIT(vgicGetVirqStateCoreId(state)));
} }
g_irqManager.gic.gicd->isenabler[id / 32] &= ~BIT(id % 32); g_irqManager.gic.gicd->icenabler[id / 32] |= ~BIT(id % 32);
} }
static inline bool vgicGetInterruptEnabledState(u16 id) static inline bool vgicGetInterruptEnabledState(u16 id)
@ -671,7 +673,7 @@ static bool vgicTestInterruptEligibility(VirqState *state)
return false; return false;
} }
return vgicIsVirqEnabled(id) && (g_irqManager.gic.gicd->itargetsr[id] & BIT(currentCoreCtx->coreId)) != 0; return vgicGetInterruptEnabledState(id) && (id < 32 || (g_irqManager.gic.gicd->itargetsr[id] & BIT(currentCoreCtx->coreId)) != 0);
} }
// Returns highest priority // Returns highest priority