Skip to content

Commit

Permalink
ArmPkg: Make variables used for GicInterrupt UINTN
Browse files Browse the repository at this point in the history
Although the maximum interrupt ID on GicV2 is 10bit and for GicV3/4 is
24bit, and that the IAR and EOIR registers of the Gic CPU interface are
32 bit; the typedef HARDWARE_INTERRUPT_SOURCE is defined as UINTN in
EmbeddedPkg\Include\Protocol\HardwareInterrupt.h

Therefore, use UINTN for Gic Interrupt variables and use appropriate
typecasts wherever needed.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
  • Loading branch information
samimujawar authored and mergify[bot] committed Jun 1, 2023
1 parent 937fbe4 commit 7f19832
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ GicV2IrqInterruptHandler (
IN EFI_SYSTEM_CONTEXT SystemContext
)
{
UINT32 GicInterrupt;
UINTN GicInterrupt;
HARDWARE_INTERRUPT_HANDLER InterruptHandler;

GicInterrupt = ArmGicV2AcknowledgeInterrupt (mGicInterruptInterfaceBase);
Expand All @@ -179,7 +179,7 @@ GicV2IrqInterruptHandler (
// Call the registered interrupt handler.
InterruptHandler (GicInterrupt, SystemContext);
} else {
DEBUG ((DEBUG_ERROR, "Spurious GIC interrupt: 0x%x\n", GicInterrupt));
DEBUG ((DEBUG_ERROR, "Spurious GIC interrupt: 0x%x\n", (UINT32)GicInterrupt));
GicV2EndOfInterrupt (&gHardwareInterruptV2Protocol, GicInterrupt);
}
}
Expand Down Expand Up @@ -349,8 +349,8 @@ GicV2ExitBootServicesEvent (
IN VOID *Context
)
{
UINTN Index;
UINT32 GicInterrupt;
UINTN Index;
UINTN GicInterrupt;

// Disable all the interrupts
for (Index = 0; Index < mGicNumInterrupts; Index++) {
Expand Down
4 changes: 2 additions & 2 deletions ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ GicV3IrqInterruptHandler (
IN EFI_SYSTEM_CONTEXT SystemContext
)
{
UINT32 GicInterrupt;
UINTN GicInterrupt;
HARDWARE_INTERRUPT_HANDLER InterruptHandler;

GicInterrupt = ArmGicV3AcknowledgeInterrupt ();
Expand All @@ -173,7 +173,7 @@ GicV3IrqInterruptHandler (
// Call the registered interrupt handler.
InterruptHandler (GicInterrupt, SystemContext);
} else {
DEBUG ((DEBUG_ERROR, "Spurious GIC interrupt: 0x%x\n", GicInterrupt));
DEBUG ((DEBUG_ERROR, "Spurious GIC interrupt: 0x%x\n", (UINT32)GicInterrupt));
GicV3EndOfInterrupt (&gHardwareInterruptV3Protocol, GicInterrupt);
}
}
Expand Down

0 comments on commit 7f19832

Please sign in to comment.