9#ifndef _CPU_EXCEPTION_COMMON_H_
10#define _CPU_EXCEPTION_COMMON_H_
23#define CPU_EXCEPTION_NUM 32
24#define CPU_INTERRUPT_NUM 256
25#define HOOKAFTER_STUB_SIZE 18
30#define IA32_PF_EC_P BIT0
31#define IA32_PF_EC_WR BIT1
32#define IA32_PF_EC_US BIT2
33#define IA32_PF_EC_RSVD BIT3
34#define IA32_PF_EC_ID BIT4
35#define IA32_PF_EC_PK BIT5
36#define IA32_PF_EC_SS BIT6
37#define IA32_PF_EC_SGX BIT15
39#include "ArchInterruptDefs.h"
41#define CPU_STACK_SWITCH_EXCEPTION_NUMBER \
42 FixedPcdGetSize (PcdCpuStackSwitchExceptionList)
44#define CPU_STACK_SWITCH_EXCEPTION_LIST \
45 FixedPcdGetPtr (PcdCpuStackSwitchExceptionList)
47#define CPU_KNOWN_GOOD_STACK_SIZE \
48 FixedPcdGet32 (PcdCpuKnownGoodStackSize)
50#define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE)
57 UINTN ExceptionStubHeaderSize;
58 UINTN HookAfterStubHeaderStart;
68extern CONST UINT32 mErrorCodeFlag;
93 OUT IA32_IDT_GATE_DESCRIPTOR *IdtEntry,
105 IN IA32_IDT_GATE_DESCRIPTOR *IdtEntry
199 IN IA32_IDT_GATE_DESCRIPTOR *IdtTable,
243 IN VOID *NewVectorAddr,
245 IN VOID *OldVectorAddr
VOID(EFIAPI * EFI_CPU_INTERRUPT_HANDLER)(IN CONST EFI_EXCEPTION_TYPE InterruptType, IN CONST EFI_SYSTEM_CONTEXT SystemContext)
VOID ArchSaveExceptionContext(IN UINTN ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext, IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
VOID EFIAPI AsmVectorNumFixup(IN VOID *NewVectorAddr, IN UINT8 VectorNum, IN VOID *OldVectorAddr)
VOID ArchRestoreExceptionContext(IN UINTN ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext, IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
VOID DumpImageAndCpuContent(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI AsmGetTemplateAddressMap(OUT EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap)
UINTN ArchGetIdtHandler(IN IA32_IDT_GATE_DESCRIPTOR *IdtEntry)
EFI_STATUS ArchSetupExceptionStack(IN VOID *Buffer, IN OUT UINTN *BufferSize)
VOID DumpModuleImageInfo(IN UINTN CurrentEip)
EFI_STATUS RegisterCpuInterruptHandlerWorker(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler, IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
VOID UpdateIdtTable(IN IA32_IDT_GATE_DESCRIPTOR *IdtTable, IN EXCEPTION_HANDLER_TEMPLATE_MAP *TemplateMap, IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
EFI_STATUS ReadAndVerifyVectorInfo(IN EFI_VECTOR_HANDOFF_INFO *VectorInfo, OUT RESERVED_VECTORS_DATA *ReservedVector, IN UINTN VectorCount)
EFI_STATUS InitializeCpuExceptionHandlersWorker(IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, IN OUT EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
CONST CHAR8 * GetExceptionNameStr(IN EFI_EXCEPTION_TYPE ExceptionType)
VOID ArchUpdateIdtEntry(OUT IA32_IDT_GATE_DESCRIPTOR *IdtEntry, IN UINTN InterruptHandler)
VOID CommonExceptionHandlerWorker(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext, IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
VOID EFIAPI AsmGetTssTemplateMap(OUT EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap)
VOID EFIAPI InternalPrintMessage(IN CONST CHAR8 *Format,...)