trivial: formatting, improve comments

Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
This commit is contained in:
Axel Heider
2021-08-20 14:14:55 +02:00
committed by Gerwin Klein
parent 751198038a
commit 502dec1cd3

View File

@@ -182,21 +182,25 @@ void deletedIRQHandler(irq_t irq)
void handleInterrupt(irq_t irq)
{
if (unlikely(IRQT_TO_IRQ(irq) > maxIRQ)) {
/* mask, ack and pretend it didn't happen. We assume that because
* the interrupt controller for the platform returned this IRQ that
* it is safe to use in mask and ack operations, even though it is
* above the claimed maxIRQ. i.e. we're assuming maxIRQ is wrong */
/* The interrupt number is out of range. Pretend it did not happen by
* handling it like an inactive interrupt (mask and ack). We assume this
* is acceptable, because the platform specific interrupt controller
* driver reported this interrupt. Maybe the value maxIRQ is just wrong
* or set to a lower value because the interrupts are unused.
*/
printf("Received IRQ %d, which is above the platforms maxIRQ of %d\n", (int)IRQT_TO_IRQ(irq), (int)maxIRQ);
maskInterrupt(true, irq);
ackInterrupt(irq);
return;
}
switch (intStateIRQTable[IRQT_TO_IDX(irq)]) {
case IRQSignal: {
/* Merging the variable declaration and initialization into one line
* requires an update in the proofs first. Might be a c89 legacy.
*/
cap_t cap;
cap = intStateIRQNode[IRQT_TO_IDX(irq)].cap;
if (cap_get_capType(cap) == cap_notification_cap &&
cap_notification_cap_get_capNtfnCanSend(cap)) {
sendSignal(NTFN_PTR(cap_notification_cap_get_capNtfnPtr(cap)),
@@ -233,10 +237,9 @@ void handleInterrupt(irq_t irq)
break;
case IRQInactive:
/*
* This case shouldn't happen anyway unless the hardware or
* platform code is broken. Hopefully masking it again should make
* the interrupt go away.
/* This case shouldn't happen anyway unless the hardware or platform
* code is broken. Hopefully masking it again should make the interrupt
* go away.
*/
maskInterrupt(true, irq);
#ifdef CONFIG_IRQ_REPORTING
@@ -249,6 +252,9 @@ void handleInterrupt(irq_t irq)
fail("Invalid IRQ state");
}
/* Every interrupt is ack'd, even if it is an inactive one. Rationale is,
* that for any interrupt reported by the platform specific code the generic
* kernel code does report here that it is done with handling it. */
ackInterrupt(irq);
}