UefiCpuPkg: Simplify the struct definition of CPU_EXCEPTION_INIT_DATA
CPU_EXCEPTION_INIT_DATA is now an internal implementation of CpuExceptionHandlerLib. Union can be removed since Ia32 and X64 have the same definition. Also, two fields (Revision and InitDefaultHandlers)are useless, can be removed. Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
9a24c3546e
commit
f1688ec9da
@@ -49,71 +49,59 @@
|
||||
|
||||
#define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE)
|
||||
|
||||
#define CPU_EXCEPTION_INIT_DATA_REV 1
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
//
|
||||
// Revision number of this structure.
|
||||
//
|
||||
UINT32 Revision;
|
||||
//
|
||||
// The address of top of known good stack reserved for *ALL* exceptions
|
||||
// listed in field StackSwitchExceptions.
|
||||
//
|
||||
UINTN KnownGoodStackTop;
|
||||
//
|
||||
// The size of known good stack for *ONE* exception only.
|
||||
//
|
||||
UINTN KnownGoodStackSize;
|
||||
//
|
||||
// Buffer of exception vector list for stack switch.
|
||||
//
|
||||
UINT8 *StackSwitchExceptions;
|
||||
//
|
||||
// Number of exception vectors in StackSwitchExceptions.
|
||||
//
|
||||
UINTN StackSwitchExceptionNumber;
|
||||
//
|
||||
// Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR.
|
||||
// Normally there's no need to change IDT table size.
|
||||
//
|
||||
VOID *IdtTable;
|
||||
//
|
||||
// Size of buffer for IdtTable.
|
||||
//
|
||||
UINTN IdtTableSize;
|
||||
//
|
||||
// Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR.
|
||||
//
|
||||
VOID *GdtTable;
|
||||
//
|
||||
// Size of buffer for GdtTable.
|
||||
//
|
||||
UINTN GdtTableSize;
|
||||
//
|
||||
// Pointer to start address of descriptor of exception task gate in the
|
||||
// GDT table. It must be type of IA32_TSS_DESCRIPTOR.
|
||||
//
|
||||
VOID *ExceptionTssDesc;
|
||||
//
|
||||
// Size of buffer for ExceptionTssDesc.
|
||||
//
|
||||
UINTN ExceptionTssDescSize;
|
||||
//
|
||||
// Buffer of task-state segment for exceptions. It must be type of
|
||||
// IA32_TASK_STATE_SEGMENT.
|
||||
//
|
||||
VOID *ExceptionTss;
|
||||
//
|
||||
// Size of buffer for ExceptionTss.
|
||||
//
|
||||
UINTN ExceptionTssSize;
|
||||
//
|
||||
// Flag to indicate if default handlers should be initialized or not.
|
||||
//
|
||||
BOOLEAN InitDefaultHandlers;
|
||||
} Ia32, X64;
|
||||
typedef struct {
|
||||
//
|
||||
// The address of top of known good stack reserved for *ALL* exceptions
|
||||
// listed in field StackSwitchExceptions.
|
||||
//
|
||||
UINTN KnownGoodStackTop;
|
||||
//
|
||||
// The size of known good stack for *ONE* exception only.
|
||||
//
|
||||
UINTN KnownGoodStackSize;
|
||||
//
|
||||
// Buffer of exception vector list for stack switch.
|
||||
//
|
||||
UINT8 *StackSwitchExceptions;
|
||||
//
|
||||
// Number of exception vectors in StackSwitchExceptions.
|
||||
//
|
||||
UINTN StackSwitchExceptionNumber;
|
||||
//
|
||||
// Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR.
|
||||
// Normally there's no need to change IDT table size.
|
||||
//
|
||||
VOID *IdtTable;
|
||||
//
|
||||
// Size of buffer for IdtTable.
|
||||
//
|
||||
UINTN IdtTableSize;
|
||||
//
|
||||
// Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR.
|
||||
//
|
||||
VOID *GdtTable;
|
||||
//
|
||||
// Size of buffer for GdtTable.
|
||||
//
|
||||
UINTN GdtTableSize;
|
||||
//
|
||||
// Pointer to start address of descriptor of exception task gate in the
|
||||
// GDT table. It must be type of IA32_TSS_DESCRIPTOR.
|
||||
//
|
||||
VOID *ExceptionTssDesc;
|
||||
//
|
||||
// Size of buffer for ExceptionTssDesc.
|
||||
//
|
||||
UINTN ExceptionTssDescSize;
|
||||
//
|
||||
// Buffer of task-state segment for exceptions. It must be type of
|
||||
// IA32_TASK_STATE_SEGMENT.
|
||||
//
|
||||
VOID *ExceptionTss;
|
||||
//
|
||||
// Size of buffer for ExceptionTss.
|
||||
//
|
||||
UINTN ExceptionTssSize;
|
||||
} CPU_EXCEPTION_INIT_DATA;
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user