]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/CpuDxe/ArmV6: Return error status when ExceptionHandlersStart is not 32-byte...
authorOlivier Martin <olivier.martin@arm.com>
Tue, 1 Jul 2014 09:24:07 +0000 (09:24 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 1 Jul 2014 09:24:07 +0000 (09:24 +0000)
The function should detect and return the error in non-debug builds when the ASSERT does nothing.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15606 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Drivers/CpuDxe/ArmV6/Exception.c

index d7d33fb4923745ad175986736e7f7882dcc67b07..80006261260a1206b40b049a71c39cf184e892fa 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+  Copyright (c) 2014, ARM Limited. All rights reserved.<BR>\r
   \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -207,9 +208,12 @@ InitializeExceptions (
     //Note: On ARM processor with the Security Extension, the Vector Table can be located anywhere in the memory.\r
     //      The Vector Base Address Register defines the location\r
     ArmWriteVBar (PcdGet32(PcdCpuVectorBaseAddress));\r
-  } else {\r
+  } else {
     // The Vector table must be 32-byte aligned\r
-    ASSERT(((UINT32)ExceptionHandlersStart & ARM_VECTOR_TABLE_ALIGNMENT) == 0);\r
+    if (((UINT32)ExceptionHandlersStart & ARM_VECTOR_TABLE_ALIGNMENT) != 0) {\r
+      ASSERT (0);\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
 \r
     // We do not copy the Exception Table at PcdGet32(PcdCpuVectorBaseAddress). We just set Vector Base Address to point into CpuDxe code.\r
     ArmWriteVBar ((UINT32)ExceptionHandlersStart);\r