/* *Readcurrentconfigurationregister,andinserttheconfig *for"irq",dependingon"type".
*/
raw_spin_lock_irqsave(&irq_controller_lock, flags);
val = oldval = readl_relaxed(base + confoff); if (type & IRQ_TYPE_LEVEL_MASK)
val &= ~confmask; elseif (type & IRQ_TYPE_EDGE_BOTH)
val |= confmask;
/* If the current configuration is the same, then we are done */ if (val == oldval) {
raw_spin_unlock_irqrestore(&irq_controller_lock, flags); return0;
}
/* *Writebackthenewconfiguration,andpossiblyre-enable *theinterrupt.Ifwefailtowriteanewconfigurationfor *anSPIthenWARNandreturnanerror.Ifwefailtowritethe *configurationforaPPIthisismostlikelybecausetheGIC *doesnotallowustosettheconfigurationorweareina *non-securemode,andhenceitmaynotbecatastrophic.
*/
writel_relaxed(val, base + confoff); if (readl_relaxed(base + confoff) != val)
ret = -EINVAL;
/* *Setallglobalinterruptstobeleveltriggered,activelow.
*/ for (i = 32; i < gic_irqs; i += 16)
writel_relaxed(GICD_INT_ACTLOW_LVLTRIG,
base + GIC_DIST_CONFIG + i / 4);
/* *Setpriorityonallglobalinterrupts.
*/ for (i = 32; i < gic_irqs; i += 4)
writel_relaxed(REPEAT_BYTE_U32(priority),
base + GIC_DIST_PRI + i);
/* *DeactivateanddisableallSPIs.LeavethePPIandSGIs *aloneastheyareintheredistributorregistersonGICv3.
*/ for (i = 32; i < gic_irqs; i += 32) {
writel_relaxed(GICD_INT_EN_CLR_X32,
base + GIC_DIST_ACTIVE_CLEAR + i / 8);
writel_relaxed(GICD_INT_EN_CLR_X32,
base + GIC_DIST_ENABLE_CLEAR + i / 8);
}
}
void gic_cpu_config(void __iomem *base, int nr, u8 priority)
{ int i;
/* *DealwiththebankedPPIandSGIinterrupts-disableall *privateinterrupts.Makesureeverythingisdeactivated.
*/ for (i = 0; i < nr; i += 32) {
writel_relaxed(GICD_INT_EN_CLR_X32,
base + GIC_DIST_ACTIVE_CLEAR + i / 8);
writel_relaxed(GICD_INT_EN_CLR_X32,
base + GIC_DIST_ENABLE_CLEAR + i / 8);
}
/* *SetpriorityonPPIandSGIinterrupts
*/ for (i = 0; i < nr; i += 4)
writel_relaxed(REPEAT_BYTE_U32(priority),
base + GIC_DIST_PRI + i * 4 / 4);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.