From 6a343fac2c0607004a7634ce6d47cfbd37685fd8 Mon Sep 17 00:00:00 2001 From: Girish K S Date: Mon, 19 Aug 2013 13:49:09 +0000 Subject: ArmPkg/CpuDxe: AArch64: Fix wrong comparison of exception type During the interrupt registration comparison is made against max value of exception types for ARMV7, but in the common handling function the check is made against max value of exceptions types for ARMV8. This can lead to undefined behaviour during registration of interrupts. This patch modifies the registration function to handle only AArch64 exceptions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Girish K S Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14561 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Drivers/CpuDxe/AArch64/Exception.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ArmPkg') diff --git a/ArmPkg/Drivers/CpuDxe/AArch64/Exception.c b/ArmPkg/Drivers/CpuDxe/AArch64/Exception.c index 1aac6a5a91..0cd80bb722 100644 --- a/ArmPkg/Drivers/CpuDxe/AArch64/Exception.c +++ b/ArmPkg/Drivers/CpuDxe/AArch64/Exception.c @@ -38,8 +38,8 @@ AsmCommonExceptionEntry ( ); -EFI_EXCEPTION_CALLBACK gExceptionHandlers[MAX_ARM_EXCEPTION + 1]; -EFI_EXCEPTION_CALLBACK gDebuggerExceptionHandlers[MAX_ARM_EXCEPTION + 1]; +EFI_EXCEPTION_CALLBACK gExceptionHandlers[MAX_AARCH64_EXCEPTION + 1]; +EFI_EXCEPTION_CALLBACK gDebuggerExceptionHandlers[MAX_AARCH64_EXCEPTION + 1]; @@ -69,7 +69,7 @@ RegisterInterruptHandler ( IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler ) { - if (InterruptType > MAX_ARM_EXCEPTION) { + if (InterruptType > MAX_AARCH64_EXCEPTION) { return EFI_UNSUPPORTED; } -- cgit v1.2.3