]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/CpuDxe: AArch64: Fix wrong comparison of exception type
authorGirish K S <ks.giri@samsung.com>
Mon, 19 Aug 2013 13:49:09 +0000 (13:49 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Aug 2013 13:49:09 +0000 (13:49 +0000)
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 <ks.giri@samsung.com>
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
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

index 1aac6a5a91ab71a5e994c37d6b87863305f905ab..0cd80bb722e28d861669a8356909e1ae6923c2f8 100644 (file)
@@ -38,8 +38,8 @@ AsmCommonExceptionEntry (
   );\r
 \r
 \r
-EFI_EXCEPTION_CALLBACK  gExceptionHandlers[MAX_ARM_EXCEPTION + 1];\r
-EFI_EXCEPTION_CALLBACK  gDebuggerExceptionHandlers[MAX_ARM_EXCEPTION + 1];\r
+EFI_EXCEPTION_CALLBACK  gExceptionHandlers[MAX_AARCH64_EXCEPTION + 1];\r
+EFI_EXCEPTION_CALLBACK  gDebuggerExceptionHandlers[MAX_AARCH64_EXCEPTION + 1];\r
 \r
 \r
 \r
@@ -69,7 +69,7 @@ RegisterInterruptHandler (
   IN EFI_CPU_INTERRUPT_HANDLER      InterruptHandler\r
   )\r
 {\r
-  if (InterruptType > MAX_ARM_EXCEPTION) {\r
+  if (InterruptType > MAX_AARCH64_EXCEPTION) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r