2 Common header file for CPU Exception Handler Library.
4 Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _CPU_EXCEPTION_COMMON_H_
16 #define _CPU_EXCEPTION_COMMON_H_
18 #include <Library/BaseLib.h>
19 #include <Library/SerialPortLib.h>
20 #include <Library/PrintLib.h>
21 #include <Library/LocalApicLib.h>
22 #include <Library/PeCoffGetEntryPointLib.h>
24 #define CPU_EXCEPTION_NUM 32
26 // Record exception handler information
30 UINTN ExceptionStubHeaderSize
;
31 } EXCEPTION_HANDLER_TEMPLATE_MAP
;
33 extern UINT32 mErrorCodeFlag
;
34 extern CONST UINTN mImageAlignSize
;
37 Return address map of exception handler template so that C code can generate
40 @param AddressMap Pointer to a buffer where the address map is returned.
44 GetTemplateAddressMap (
45 OUT EXCEPTION_HANDLER_TEMPLATE_MAP
*AddressMap
49 Internal function to setup CPU exception handlers.
53 InternalSetupCpuExceptionHandlers (
58 Prints a message to the serial port.
60 @param Format Format string for the message to print.
61 @param ... Variable argument list whose contents are accessed
62 based on the format string specified by Format.
67 InternalPrintMessage (
68 IN CONST CHAR8
*Format
,
73 Find and display image base address and return image base and its entry point.
75 @return EFI_SUCCESS Image base address.
76 @return 0 Image header cannot be found.
85 Display CPU information.
87 @param InterruptType Exception type.
88 @param SystemContext Pointer to EFI_SYSTEM_CONTEXT.
92 IN UINTN InterruptType
,
93 IN EFI_SYSTEM_CONTEXT SystemContext