diff options
author | Jeff Fan <jeff.fan@intel.com> | 2017-04-01 14:16:41 +0800 |
---|---|---|
committer | Jeff Fan <jeff.fan@intel.com> | 2017-04-07 09:43:44 +0800 |
commit | 1b2f7b3e4906fbee727677e827dacee7a9fc9b7f (patch) | |
tree | b3e87dda2960dab24821048db19dbc8cf0bd645d /UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h | |
parent | e2884d2cd07174f987c5932c6eebac71cf4376f9 (diff) | |
download | edk2-platforms-1b2f7b3e4906fbee727677e827dacee7a9fc9b7f.tar.xz |
UefiCpuPkg/CpuExceptionHandlerLib: Add DumpCpuContext() implementation
Export DumpCpuCotext() to display CPU Context. We will invoke
PeCoffGetEntrypointLib's PeCoffSerachImageBase() to get PE/COFF image base.
Display exception data bit value for page fault exception.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h')
-rw-r--r-- | UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h index 4639ed2d90..e66a5df864 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h @@ -1,7 +1,7 @@ /** @file
Common header file for CPU Exception Handler Library.
- Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,11 +24,23 @@ #include <Library/PeCoffGetEntryPointLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/SynchronizationLib.h>
+#include <Library/CpuExceptionHandlerLib.h>
#define CPU_EXCEPTION_NUM 32
#define CPU_INTERRUPT_NUM 256
#define HOOKAFTER_STUB_SIZE 16
+//
+// Exception Error Code of Page-Fault Exception
+//
+#define IA32_PF_EC_P BIT0
+#define IA32_PF_EC_WR BIT1
+#define IA32_PF_EC_US BIT2
+#define IA32_PF_EC_RSVD BIT3
+#define IA32_PF_EC_ID BIT4
+#define IA32_PF_EC_PK BIT5
+#define IA32_PF_EC_SGX BIT15
+
#include "ArchInterruptDefs.h"
#define CPU_EXCEPTION_HANDLER_LIB_HOB_GUID \
@@ -53,7 +65,6 @@ typedef struct { } EXCEPTION_HANDLER_DATA;
extern CONST UINT32 mErrorCodeFlag;
-extern CONST UINTN mImageAlignSize;
extern CONST UINTN mDoFarReturnFlag;
/**
@@ -112,15 +123,11 @@ InternalPrintMessage ( Find and display image base address and return image base and its entry point.
@param CurrentEip Current instruction pointer.
- @param EntryPoint Return module entry point if module header is found.
- @return !0 Image base address.
- @return 0 Image header cannot be found.
**/
-UINTN
-FindModuleImageBase (
- IN UINTN CurrentEip,
- OUT UINTN *EntryPoint
+VOID
+DumpModuleImageInfo (
+ IN UINTN CurrentEip
);
/**
@@ -130,7 +137,7 @@ FindModuleImageBase ( @param SystemContext Pointer to EFI_SYSTEM_CONTEXT.
**/
VOID
-DumpCpuContent (
+DumpImageAndCpuContent (
IN EFI_EXCEPTION_TYPE ExceptionType,
IN EFI_SYSTEM_CONTEXT SystemContext
);
|