TianoCore EDK2 master
Loading...
Searching...
No Matches
DefaultExceptionHandler.c File Reference

Go to the source code of this file.

Macros

#define MAX_PRINT_CHARS   100
 

Functions

CHAR8 * GetImageName (IN UINTN FaultAddress, OUT UINTN *ImageBase, OUT UINTN *PeCoffSizeOfHeaders)
 
STATIC VOID DescribeInstructionOrDataAbort (IN CHAR8 *AbortType, IN UINTN Iss)
 
STATIC VOID DescribeExceptionSyndrome (IN UINT32 Esr)
 
STATIC CONST CHAR8 * BaseName (IN CONST CHAR8 *FullName)
 
VOID DefaultExceptionHandler (IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
 

Variables

STATIC CHAR8 * gExceptionTypeString []
 
STATIC BOOLEAN mRecursiveException
 

Detailed Description

Default exception handler

Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DefaultExceptionHandler.c.

Macro Definition Documentation

◆ MAX_PRINT_CHARS

#define MAX_PRINT_CHARS   100

Definition at line 29 of file DefaultExceptionHandler.c.

Function Documentation

◆ BaseName()

STATIC CONST CHAR8 * BaseName ( IN CONST CHAR8 *  FullName)

Definition at line 162 of file DefaultExceptionHandler.c.

◆ DefaultExceptionHandler()

VOID DefaultExceptionHandler ( IN EFI_EXCEPTION_TYPE  ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT  SystemContext 
)

This is the default action to take on an unexpected exception

Since this is exception context don't do anything crazy like try to allocate memory.

Parameters
ExceptionTypeType of the exception
SystemContextRegister state at the time of the Exception

Definition at line 189 of file DefaultExceptionHandler.c.

◆ DescribeExceptionSyndrome()

STATIC VOID DescribeExceptionSyndrome ( IN UINT32  Esr)

Definition at line 130 of file DefaultExceptionHandler.c.

◆ DescribeInstructionOrDataAbort()

STATIC VOID DescribeInstructionOrDataAbort ( IN CHAR8 *  AbortType,
IN UINTN  Iss 
)

Definition at line 49 of file DefaultExceptionHandler.c.

◆ GetImageName()

CHAR8 * GetImageName ( IN UINTN  FaultAddress,
OUT UINTN ImageBase,
OUT UINTN PeCoffSizeOfHeaders 
)

Use the EFI Debug Image Table to lookup the FaultAddress and find which PE/COFF image it came from. As long as the PE/COFF image contains a debug directory entry a string can be returned. For ELF and Mach-O images the string points to the Mach-O or ELF image. Microsoft tools contain a pointer to the PDB file that contains the debug information.

Parameters
FaultAddressAddress to find PE/COFF image for.
ImageBaseReturn load address of found image
PeCoffSizeOfHeadersReturn the size of the PE/COFF header for the image that was found
Return values
NULLFaultAddress not in a loaded PE/COFF image.
Pathand file name of PE/COFF image.

Definition at line 30 of file DefaultExceptionHandlerUefi.c.

Variable Documentation

◆ gExceptionTypeString

STATIC CHAR8* gExceptionTypeString[]
Initial value:
= {
"Synchronous",
"IRQ",
"FIQ",
"SError"
}

Definition at line 31 of file DefaultExceptionHandler.c.

◆ mRecursiveException

STATIC BOOLEAN mRecursiveException

Definition at line 38 of file DefaultExceptionHandler.c.