]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmExceptionLib/Arm/ArmException.c
ArmPkg: Apply uncrustify changes
[mirror_edk2.git] / ArmPkg / Library / ArmExceptionLib / Arm / ArmException.c
CommitLineData
2939c778
EC
1/** @file\r
2* Exception handling support specific for ARM\r
3*\r
4* Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
74b41d56 5* Copyright (c) 2014 - 2021, Arm Limited. All rights reserved.<BR>\r
2939c778
EC
6* Copyright (c) 2016 HP Development Company, L.P.<BR>\r
7*\r
4059386c 8* SPDX-License-Identifier: BSD-2-Clause-Patent\r
2939c778
EC
9*\r
10**/\r
11\r
12#include <Uefi.h>\r
13\r
14#include <Chipset/ArmV7.h>\r
15\r
16#include <Library/ArmLib.h>\r
17\r
18#include <Protocol/DebugSupport.h> // for MAX_ARM_EXCEPTION\r
19\r
429309e0
MK
20UINTN gMaxExceptionNumber = MAX_ARM_EXCEPTION;\r
21EFI_EXCEPTION_CALLBACK gExceptionHandlers[MAX_ARM_EXCEPTION + 1] = { 0 };\r
2939c778 22EFI_EXCEPTION_CALLBACK gDebuggerExceptionHandlers[MAX_ARM_EXCEPTION + 1] = { 0 };\r
429309e0 23PHYSICAL_ADDRESS gExceptionVectorAlignmentMask = ARM_VECTOR_TABLE_ALIGNMENT;\r
2939c778
EC
24\r
25// Exception handler contains branch to vector location (jmp $) so no handler\r
26// NOTE: This code assumes vectors are ARM and not Thumb code\r
429309e0 27UINTN gDebuggerNoHandlerValue = 0xEAFFFFFE;\r
2939c778 28\r
74b41d56
PG
29RETURN_STATUS\r
30ArchVectorConfig (\r
429309e0 31 IN UINTN VectorBaseAddress\r
2939c778
EC
32 )\r
33{\r
34 // if the vector address corresponds to high vectors\r
35 if (VectorBaseAddress == 0xFFFF0000) {\r
36 // set SCTLR.V to enable high vectors\r
429309e0
MK
37 ArmSetHighVectors ();\r
38 } else {\r
2939c778 39 // Set SCTLR.V to 0 to enable VBAR to be used\r
429309e0 40 ArmSetLowVectors ();\r
2939c778
EC
41 }\r
42\r
43 return RETURN_SUCCESS;\r
44}\r