[FORMATTING][NTOS:IO] iomgr/irq.c

- Add a few blank lines.
- Use 2 'continue'.
This commit is contained in:
Serge Gautherie 2020-06-14 13:49:22 +02:00 committed by Hermès Bélusca-Maïto
parent 8e799e2d3e
commit 35d46b23f1
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -9,6 +9,7 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <ntoskrnl.h> #include <ntoskrnl.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
@ -38,6 +39,7 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject,
BOOLEAN FirstRun; BOOLEAN FirstRun;
CCHAR Count = 0; CCHAR Count = 0;
KAFFINITY Affinity; KAFFINITY Affinity;
PAGED_CODE(); PAGED_CODE();
/* Assume failure */ /* Assume failure */
@ -78,54 +80,54 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject,
for (Count = 0; Affinity; Count++, Affinity >>= 1) for (Count = 0; Affinity; Count++, Affinity >>= 1)
{ {
/* Check if it's enabled for this CPU */ /* Check if it's enabled for this CPU */
if (Affinity & 1) if (!(Affinity & 1))
continue;
/* Check which one we will use */
InterruptUsed = FirstRun ? &IoInterrupt->FirstInterrupt : Interrupt;
/* Initialize it */
KeInitializeInterrupt(InterruptUsed,
ServiceRoutine,
ServiceContext,
SpinLockUsed,
Vector,
Irql,
SynchronizeIrql,
InterruptMode,
ShareVector,
Count,
FloatingSave);
/* Connect it */
if (!KeConnectInterrupt(InterruptUsed))
{ {
/* Check which one we will use */ /* Check how far we got */
InterruptUsed = FirstRun ? &IoInterrupt->FirstInterrupt : Interrupt;
/* Initialize it */
KeInitializeInterrupt(InterruptUsed,
ServiceRoutine,
ServiceContext,
SpinLockUsed,
Vector,
Irql,
SynchronizeIrql,
InterruptMode,
ShareVector,
Count,
FloatingSave);
/* Connect it */
if (!KeConnectInterrupt(InterruptUsed))
{
/* Check how far we got */
if (FirstRun)
{
/* We failed early so just free this */
ExFreePoolWithTag(IoInterrupt, TAG_KINTERRUPT);
}
else
{
/* Far enough, so disconnect everything */
IoDisconnectInterrupt(&IoInterrupt->FirstInterrupt);
}
/* And fail */
*InterruptObject = NULL;
return STATUS_INVALID_PARAMETER;
}
/* Now we've used up our First Run */
if (FirstRun) if (FirstRun)
{ {
FirstRun = FALSE; /* We failed early so just free this */
ExFreePoolWithTag(IoInterrupt, TAG_KINTERRUPT);
} }
else else
{ {
/* Move on to the next one */ /* Far enough, so disconnect everything */
IoInterrupt->Interrupt[(UCHAR)Count] = Interrupt++; IoDisconnectInterrupt(&IoInterrupt->FirstInterrupt);
} }
/* And fail */
*InterruptObject = NULL;
return STATUS_INVALID_PARAMETER;
}
/* Now we've used up our First Run */
if (FirstRun)
{
FirstRun = FALSE;
}
else
{
/* Move on to the next one */
IoInterrupt->Interrupt[(UCHAR)Count] = Interrupt++;
} }
} }
@ -142,6 +144,7 @@ IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
{ {
LONG i; LONG i;
PIO_INTERRUPT IoInterrupt; PIO_INTERRUPT IoInterrupt;
PAGED_CODE(); PAGED_CODE();
/* Get the I/O Interrupt */ /* Get the I/O Interrupt */
@ -156,11 +159,11 @@ IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
for (i = 0; i < KeNumberProcessors; i++) for (i = 0; i < KeNumberProcessors; i++)
{ {
/* Make sure one was registered */ /* Make sure one was registered */
if (IoInterrupt->Interrupt[i]) if (!IoInterrupt->Interrupt[i])
{ continue;
/* Disconnect it */
KeDisconnectInterrupt(&InterruptObject[i]); /* Disconnect it */
} KeDisconnectInterrupt(&InterruptObject[i]);
} }
/* Free the I/O Interrupt */ /* Free the I/O Interrupt */
@ -172,6 +175,7 @@ IopConnectInterruptExFullySpecific(
_Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS Parameters) _Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
{ {
NTSTATUS Status; NTSTATUS Status;
PAGED_CODE(); PAGED_CODE();
/* Fallback to standard IoConnectInterrupt */ /* Fallback to standard IoConnectInterrupt */
@ -196,6 +200,7 @@ IoConnectInterruptEx(
_Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS Parameters) _Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
{ {
PAGED_CODE(); PAGED_CODE();
switch (Parameters->Version) switch (Parameters->Version)
{ {
case CONNECT_FULLY_SPECIFIED: case CONNECT_FULLY_SPECIFIED:
@ -210,6 +215,7 @@ IoConnectInterruptEx(
DPRINT1("FIXME: Line based interrupts are UNIMPLEMENTED\n"); DPRINT1("FIXME: Line based interrupts are UNIMPLEMENTED\n");
break; break;
} }
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }