TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmException.c
Go to the documentation of this file.
1
12#include <Uefi.h>
13
14#include <Arm/AArch32.h>
15
16#include <Library/ArmLib.h>
17
18#include <Protocol/DebugSupport.h> // for MAX_ARM_EXCEPTION
19
20UINTN gMaxExceptionNumber = MAX_ARM_EXCEPTION;
21EFI_EXCEPTION_CALLBACK gExceptionHandlers[MAX_ARM_EXCEPTION + 1] = { 0 };
22EFI_EXCEPTION_CALLBACK gDebuggerExceptionHandlers[MAX_ARM_EXCEPTION + 1] = { 0 };
23PHYSICAL_ADDRESS gExceptionVectorAlignmentMask = ARM_VECTOR_TABLE_ALIGNMENT;
24
25// Exception handler contains branch to vector location (jmp $) so no handler
26// NOTE: This code assumes vectors are ARM and not Thumb code
27UINTN gDebuggerNoHandlerValue = 0xEAFFFFFE;
28
29RETURN_STATUS
30ArchVectorConfig (
31 IN UINTN VectorBaseAddress
32 )
33{
34 // if the vector address corresponds to high vectors
35 if (VectorBaseAddress == 0xFFFF0000) {
36 // set SCTLR.V to enable high vectors
37 ArmSetHighVectors ();
38 } else {
39 // Set SCTLR.V to 0 to enable VBAR to be used
40 ArmSetLowVectors ();
41 }
42
43 return RETURN_SUCCESS;
44}
UINT64 UINTN
#define RETURN_SUCCESS
Definition: Base.h:1066
#define IN
Definition: Base.h:279
VOID(EFIAPI * EFI_EXCEPTION_CALLBACK)(IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: DebugSupport.h:816
#define MAX_ARM_EXCEPTION
Definition: DebugSupport.h:485