From aaf0846fa251c9a86dfa8125cdd540c97ef1d232 Mon Sep 17 00:00:00 2001 From: Mike Maslenkin Date: Sun, 12 Jan 2025 02:29:09 +0300 Subject: [PATCH] ArmPkg: remove ArmGicAcknowledgeInterrupt function. A compiler warning was detected that 'IntId' could be used uninitialized in the `else` branch. Since there are no consumers of this function, it was decided to remove this function completely. Signed-off-by: Mike Maslenkin --- ArmPkg/Drivers/ArmGic/ArmGicLib.c | 49 ------------------------------ ArmPkg/Include/Library/ArmGicLib.h | 21 ------------- 2 files changed, 70 deletions(-) diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c index f49a376b14..ddfd2e5203 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c @@ -154,55 +154,6 @@ ArmGicSendSgiTo ( ); } -/* - * Acknowledge and return the value of the Interrupt Acknowledge Register - * - * InterruptId is returned separately from the register value because in - * the GICv2 the register value contains the CpuId and InterruptId while - * in the GICv3 the register value is only the InterruptId. - * - * @param GicInterruptInterfaceBase Base Address of the GIC CPU Interface - * @param InterruptId InterruptId read from the Interrupt - * Acknowledge Register - * - * @retval value returned by the Interrupt Acknowledge Register - * - */ -UINTN -EFIAPI -ArmGicAcknowledgeInterrupt ( - IN UINTN GicInterruptInterfaceBase, - OUT UINTN *InterruptId - ) -{ - UINTN Value; - UINTN IntId; - ARM_GIC_ARCH_REVISION Revision; - - ASSERT (InterruptId != NULL); - Revision = ArmGicGetSupportedArchRevision (); - if (Revision == ARM_GIC_ARCH_REVISION_2) { - Value = ArmGicV2AcknowledgeInterrupt (GicInterruptInterfaceBase); - IntId = Value & ARM_GIC_ICCIAR_ACKINTID; - } else if (Revision == ARM_GIC_ARCH_REVISION_3) { - Value = ArmGicV3AcknowledgeInterrupt (); - IntId = Value; - } else { - ASSERT_EFI_ERROR (EFI_UNSUPPORTED); - // Report Spurious interrupt which is what the above controllers would - // return if no interrupt was available - Value = 1023; - } - - if (InterruptId != NULL) { - // InterruptId is required for the caller to know if a valid or spurious - // interrupt has been read - *InterruptId = IntId; - } - - return Value; -} - VOID EFIAPI ArmGicEndOfInterrupt ( diff --git a/ArmPkg/Include/Library/ArmGicLib.h b/ArmPkg/Include/Library/ArmGicLib.h index 32a06485f9..2874ea2b0b 100644 --- a/ArmPkg/Include/Library/ArmGicLib.h +++ b/ArmPkg/Include/Library/ArmGicLib.h @@ -172,27 +172,6 @@ ArmGicSendSgiTo ( IN UINT8 SgiId ); -/* - * Acknowledge and return the value of the Interrupt Acknowledge Register - * - * InterruptId is returned separately from the register value because in - * the GICv2 the register value contains the CpuId and InterruptId while - * in the GICv3 the register value is only the InterruptId. - * - * @param GicInterruptInterfaceBase Base Address of the GIC CPU Interface - * @param InterruptId InterruptId read from the Interrupt - * Acknowledge Register - * - * @retval value returned by the Interrupt Acknowledge Register - * - */ -UINTN -EFIAPI -ArmGicAcknowledgeInterrupt ( - IN UINTN GicInterruptInterfaceBase, - OUT UINTN *InterruptId - ); - VOID EFIAPI ArmGicEndOfInterrupt (