2 * Exception handling support specific for ARM
4 * Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 * Copyright (c) 2014 - 2021, Arm Limited. All rights reserved.<BR>
6 * Copyright (c) 2016 HP Development Company, L.P.<BR>
8 * SPDX-License-Identifier: BSD-2-Clause-Patent
14 #include <Chipset/ArmV7.h>
16 #include <Library/ArmLib.h>
18 #include <Protocol/DebugSupport.h> // for MAX_ARM_EXCEPTION
20 UINTN gMaxExceptionNumber
= MAX_ARM_EXCEPTION
;
21 EFI_EXCEPTION_CALLBACK gExceptionHandlers
[MAX_ARM_EXCEPTION
+ 1] = { 0 };
22 EFI_EXCEPTION_CALLBACK gDebuggerExceptionHandlers
[MAX_ARM_EXCEPTION
+ 1] = { 0 };
23 PHYSICAL_ADDRESS gExceptionVectorAlignmentMask
= ARM_VECTOR_TABLE_ALIGNMENT
;
25 // Exception handler contains branch to vector location (jmp $) so no handler
26 // NOTE: This code assumes vectors are ARM and not Thumb code
27 UINTN gDebuggerNoHandlerValue
= 0xEAFFFFFE;
31 IN UINTN VectorBaseAddress
34 // if the vector address corresponds to high vectors
35 if (VectorBaseAddress
== 0xFFFF0000) {
36 // set SCTLR.V to enable high vectors
39 // Set SCTLR.V to 0 to enable VBAR to be used
43 return RETURN_SUCCESS
;