2 * Exception handling support specific for ARM
4 * Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 * Copyright (c) 2014, ARM Limited. All rights reserved.<BR>
6 * Copyright (c) 2016 HP Development Company, L.P.<BR>
8 * This program and the accompanying materials
9 * are licensed and made available under the terms and conditions of the BSD License
10 * which accompanies this distribution. The full text of the license may be found at
11 * http://opensource.org/licenses/bsd-license.php
13 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #include <Chipset/ArmV7.h>
22 #include <Library/ArmLib.h>
24 #include <Protocol/DebugSupport.h> // for MAX_ARM_EXCEPTION
26 UINTN gMaxExceptionNumber
= MAX_ARM_EXCEPTION
;
27 EFI_EXCEPTION_CALLBACK gExceptionHandlers
[MAX_ARM_EXCEPTION
+ 1] = { 0 };
28 EFI_EXCEPTION_CALLBACK gDebuggerExceptionHandlers
[MAX_ARM_EXCEPTION
+ 1] = { 0 };
29 PHYSICAL_ADDRESS gExceptionVectorAlignmentMask
= ARM_VECTOR_TABLE_ALIGNMENT
;
31 // Exception handler contains branch to vector location (jmp $) so no handler
32 // NOTE: This code assumes vectors are ARM and not Thumb code
33 UINTN gDebuggerNoHandlerValue
= 0xEAFFFFFE;
35 RETURN_STATUS
ArchVectorConfig(
36 IN UINTN VectorBaseAddress
39 // if the vector address corresponds to high vectors
40 if (VectorBaseAddress
== 0xFFFF0000) {
41 // set SCTLR.V to enable high vectors
45 // Set SCTLR.V to 0 to enable VBAR to be used
49 return RETURN_SUCCESS
;