\r
#define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE)\r
\r
-#define CPU_EXCEPTION_INIT_DATA_REV 1\r
-\r
-typedef union {\r
- struct {\r
- //\r
- // Revision number of this structure.\r
- //\r
- UINT32 Revision;\r
- //\r
- // The address of top of known good stack reserved for *ALL* exceptions\r
- // listed in field StackSwitchExceptions.\r
- //\r
- UINTN KnownGoodStackTop;\r
- //\r
- // The size of known good stack for *ONE* exception only.\r
- //\r
- UINTN KnownGoodStackSize;\r
- //\r
- // Buffer of exception vector list for stack switch.\r
- //\r
- UINT8 *StackSwitchExceptions;\r
- //\r
- // Number of exception vectors in StackSwitchExceptions.\r
- //\r
- UINTN StackSwitchExceptionNumber;\r
- //\r
- // Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR.\r
- // Normally there's no need to change IDT table size.\r
- //\r
- VOID *IdtTable;\r
- //\r
- // Size of buffer for IdtTable.\r
- //\r
- UINTN IdtTableSize;\r
- //\r
- // Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR.\r
- //\r
- VOID *GdtTable;\r
- //\r
- // Size of buffer for GdtTable.\r
- //\r
- UINTN GdtTableSize;\r
- //\r
- // Pointer to start address of descriptor of exception task gate in the\r
- // GDT table. It must be type of IA32_TSS_DESCRIPTOR.\r
- //\r
- VOID *ExceptionTssDesc;\r
- //\r
- // Size of buffer for ExceptionTssDesc.\r
- //\r
- UINTN ExceptionTssDescSize;\r
- //\r
- // Buffer of task-state segment for exceptions. It must be type of\r
- // IA32_TASK_STATE_SEGMENT.\r
- //\r
- VOID *ExceptionTss;\r
- //\r
- // Size of buffer for ExceptionTss.\r
- //\r
- UINTN ExceptionTssSize;\r
- //\r
- // Flag to indicate if default handlers should be initialized or not.\r
- //\r
- BOOLEAN InitDefaultHandlers;\r
- } Ia32, X64;\r
+typedef struct {\r
+ //\r
+ // The address of top of known good stack reserved for *ALL* exceptions\r
+ // listed in field StackSwitchExceptions.\r
+ //\r
+ UINTN KnownGoodStackTop;\r
+ //\r
+ // The size of known good stack for *ONE* exception only.\r
+ //\r
+ UINTN KnownGoodStackSize;\r
+ //\r
+ // Buffer of exception vector list for stack switch.\r
+ //\r
+ UINT8 *StackSwitchExceptions;\r
+ //\r
+ // Number of exception vectors in StackSwitchExceptions.\r
+ //\r
+ UINTN StackSwitchExceptionNumber;\r
+ //\r
+ // Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR.\r
+ // Normally there's no need to change IDT table size.\r
+ //\r
+ VOID *IdtTable;\r
+ //\r
+ // Size of buffer for IdtTable.\r
+ //\r
+ UINTN IdtTableSize;\r
+ //\r
+ // Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR.\r
+ //\r
+ VOID *GdtTable;\r
+ //\r
+ // Size of buffer for GdtTable.\r
+ //\r
+ UINTN GdtTableSize;\r
+ //\r
+ // Pointer to start address of descriptor of exception task gate in the\r
+ // GDT table. It must be type of IA32_TSS_DESCRIPTOR.\r
+ //\r
+ VOID *ExceptionTssDesc;\r
+ //\r
+ // Size of buffer for ExceptionTssDesc.\r
+ //\r
+ UINTN ExceptionTssDescSize;\r
+ //\r
+ // Buffer of task-state segment for exceptions. It must be type of\r
+ // IA32_TASK_STATE_SEGMENT.\r
+ //\r
+ VOID *ExceptionTss;\r
+ //\r
+ // Size of buffer for ExceptionTss.\r
+ //\r
+ UINTN ExceptionTssSize;\r
} CPU_EXCEPTION_INIT_DATA;\r
\r
//\r
}\r
\r
AsmReadIdtr (&Idtr);\r
- EssData.X64.Revision = CPU_EXCEPTION_INIT_DATA_REV;\r
- EssData.X64.KnownGoodStackTop = StackTop;\r
- EssData.X64.KnownGoodStackSize = CPU_KNOWN_GOOD_STACK_SIZE;\r
- EssData.X64.StackSwitchExceptions = CPU_STACK_SWITCH_EXCEPTION_LIST;\r
- EssData.X64.StackSwitchExceptionNumber = CPU_STACK_SWITCH_EXCEPTION_NUMBER;\r
- EssData.X64.IdtTable = (VOID *)Idtr.Base;\r
- EssData.X64.IdtTableSize = Idtr.Limit + 1;\r
- EssData.X64.GdtTable = NewGdtTable;\r
- EssData.X64.GdtTableSize = CPU_TSS_DESC_SIZE + Gdtr.Limit + 1;\r
- EssData.X64.ExceptionTssDesc = NewGdtTable + Gdtr.Limit + 1;\r
- EssData.X64.ExceptionTssDescSize = CPU_TSS_DESC_SIZE;\r
- EssData.X64.ExceptionTss = NewGdtTable + Gdtr.Limit + 1 + CPU_TSS_DESC_SIZE;\r
- EssData.X64.ExceptionTssSize = CPU_TSS_SIZE;\r
+ EssData.KnownGoodStackTop = StackTop;\r
+ EssData.KnownGoodStackSize = CPU_KNOWN_GOOD_STACK_SIZE;\r
+ EssData.StackSwitchExceptions = CPU_STACK_SWITCH_EXCEPTION_LIST;\r
+ EssData.StackSwitchExceptionNumber = CPU_STACK_SWITCH_EXCEPTION_NUMBER;\r
+ EssData.IdtTable = (VOID *)Idtr.Base;\r
+ EssData.IdtTableSize = Idtr.Limit + 1;\r
+ EssData.GdtTable = NewGdtTable;\r
+ EssData.GdtTableSize = CPU_TSS_DESC_SIZE + Gdtr.Limit + 1;\r
+ EssData.ExceptionTssDesc = NewGdtTable + Gdtr.Limit + 1;\r
+ EssData.ExceptionTssDescSize = CPU_TSS_DESC_SIZE;\r
+ EssData.ExceptionTss = NewGdtTable + Gdtr.Limit + 1 + CPU_TSS_DESC_SIZE;\r
+ EssData.ExceptionTssSize = CPU_TSS_SIZE;\r
\r
return ArchSetupExceptionStack (&EssData);\r
}\r
/** @file\r
IA32 CPU Exception Handler functons.\r
\r
- Copyright (c) 2012 - 2019, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
EXCEPTION_HANDLER_TEMPLATE_MAP TemplateMap;\r
\r
if ((StackSwitchData == NULL) ||\r
- (StackSwitchData->Ia32.Revision != CPU_EXCEPTION_INIT_DATA_REV) ||\r
- (StackSwitchData->Ia32.KnownGoodStackTop == 0) ||\r
- (StackSwitchData->Ia32.KnownGoodStackSize == 0) ||\r
- (StackSwitchData->Ia32.StackSwitchExceptions == NULL) ||\r
- (StackSwitchData->Ia32.StackSwitchExceptionNumber == 0) ||\r
- (StackSwitchData->Ia32.StackSwitchExceptionNumber > CPU_EXCEPTION_NUM) ||\r
- (StackSwitchData->Ia32.GdtTable == NULL) ||\r
- (StackSwitchData->Ia32.IdtTable == NULL) ||\r
- (StackSwitchData->Ia32.ExceptionTssDesc == NULL) ||\r
- (StackSwitchData->Ia32.ExceptionTss == NULL))\r
+ (StackSwitchData->KnownGoodStackTop == 0) ||\r
+ (StackSwitchData->KnownGoodStackSize == 0) ||\r
+ (StackSwitchData->StackSwitchExceptions == NULL) ||\r
+ (StackSwitchData->StackSwitchExceptionNumber == 0) ||\r
+ (StackSwitchData->StackSwitchExceptionNumber > CPU_EXCEPTION_NUM) ||\r
+ (StackSwitchData->GdtTable == NULL) ||\r
+ (StackSwitchData->IdtTable == NULL) ||\r
+ (StackSwitchData->ExceptionTssDesc == NULL) ||\r
+ (StackSwitchData->ExceptionTss == NULL))\r
{\r
return EFI_INVALID_PARAMETER;\r
}\r
// one or newly allocated, has enough space to hold descriptors for exception\r
// task-state segments.\r
//\r
- if (((UINTN)StackSwitchData->Ia32.GdtTable & (IA32_GDT_ALIGNMENT - 1)) != 0) {\r
+ if (((UINTN)StackSwitchData->GdtTable & (IA32_GDT_ALIGNMENT - 1)) != 0) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if ((UINTN)StackSwitchData->Ia32.ExceptionTssDesc < (UINTN)(StackSwitchData->Ia32.GdtTable)) {\r
+ if ((UINTN)StackSwitchData->ExceptionTssDesc < (UINTN)(StackSwitchData->GdtTable)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if ((UINTN)StackSwitchData->Ia32.ExceptionTssDesc + StackSwitchData->Ia32.ExceptionTssDescSize >\r
- ((UINTN)(StackSwitchData->Ia32.GdtTable) + StackSwitchData->Ia32.GdtTableSize))\r
+ if ((UINTN)StackSwitchData->ExceptionTssDesc + StackSwitchData->ExceptionTssDescSize >\r
+ ((UINTN)(StackSwitchData->GdtTable) + StackSwitchData->GdtTableSize))\r
{\r
return EFI_INVALID_PARAMETER;\r
}\r
// We need one descriptor and one TSS for current task and every exception\r
// specified.\r
//\r
- if (StackSwitchData->Ia32.ExceptionTssDescSize <\r
- sizeof (IA32_TSS_DESCRIPTOR) * (StackSwitchData->Ia32.StackSwitchExceptionNumber + 1))\r
+ if (StackSwitchData->ExceptionTssDescSize <\r
+ sizeof (IA32_TSS_DESCRIPTOR) * (StackSwitchData->StackSwitchExceptionNumber + 1))\r
{\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (StackSwitchData->Ia32.ExceptionTssSize <\r
- sizeof (IA32_TASK_STATE_SEGMENT) * (StackSwitchData->Ia32.StackSwitchExceptionNumber + 1))\r
+ if (StackSwitchData->ExceptionTssSize <\r
+ sizeof (IA32_TASK_STATE_SEGMENT) * (StackSwitchData->StackSwitchExceptionNumber + 1))\r
{\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- TssDesc = StackSwitchData->Ia32.ExceptionTssDesc;\r
- Tss = StackSwitchData->Ia32.ExceptionTss;\r
+ TssDesc = StackSwitchData->ExceptionTssDesc;\r
+ Tss = StackSwitchData->ExceptionTss;\r
\r
//\r
// Initialize new GDT table and/or IDT table, if any\r
\r
GdtSize = (UINTN)TssDesc +\r
sizeof (IA32_TSS_DESCRIPTOR) *\r
- (StackSwitchData->Ia32.StackSwitchExceptionNumber + 1) -\r
- (UINTN)(StackSwitchData->Ia32.GdtTable);\r
- if ((UINTN)StackSwitchData->Ia32.GdtTable != Gdtr.Base) {\r
- CopyMem (StackSwitchData->Ia32.GdtTable, (VOID *)Gdtr.Base, Gdtr.Limit + 1);\r
- Gdtr.Base = (UINTN)StackSwitchData->Ia32.GdtTable;\r
+ (StackSwitchData->StackSwitchExceptionNumber + 1) -\r
+ (UINTN)(StackSwitchData->GdtTable);\r
+ if ((UINTN)StackSwitchData->GdtTable != Gdtr.Base) {\r
+ CopyMem (StackSwitchData->GdtTable, (VOID *)Gdtr.Base, Gdtr.Limit + 1);\r
+ Gdtr.Base = (UINTN)StackSwitchData->GdtTable;\r
Gdtr.Limit = (UINT16)GdtSize - 1;\r
}\r
\r
- if ((UINTN)StackSwitchData->Ia32.IdtTable != Idtr.Base) {\r
- Idtr.Base = (UINTN)StackSwitchData->Ia32.IdtTable;\r
+ if ((UINTN)StackSwitchData->IdtTable != Idtr.Base) {\r
+ Idtr.Base = (UINTN)StackSwitchData->IdtTable;\r
}\r
\r
- if (StackSwitchData->Ia32.IdtTableSize > 0) {\r
- Idtr.Limit = (UINT16)(StackSwitchData->Ia32.IdtTableSize - 1);\r
+ if (StackSwitchData->IdtTableSize > 0) {\r
+ Idtr.Limit = (UINT16)(StackSwitchData->IdtTableSize - 1);\r
}\r
\r
//\r
// Fixup exception task descriptor and task-state segment\r
//\r
AsmGetTssTemplateMap (&TemplateMap);\r
- StackTop = StackSwitchData->Ia32.KnownGoodStackTop - CPU_STACK_ALIGNMENT;\r
+ StackTop = StackSwitchData->KnownGoodStackTop - CPU_STACK_ALIGNMENT;\r
StackTop = (UINTN)ALIGN_POINTER (StackTop, CPU_STACK_ALIGNMENT);\r
- IdtTable = StackSwitchData->Ia32.IdtTable;\r
- for (Index = 0; Index < StackSwitchData->Ia32.StackSwitchExceptionNumber; ++Index) {\r
+ IdtTable = StackSwitchData->IdtTable;\r
+ for (Index = 0; Index < StackSwitchData->StackSwitchExceptionNumber; ++Index) {\r
TssDesc += 1;\r
Tss += 1;\r
\r
//\r
// Fixup TSS\r
//\r
- Vector = StackSwitchData->Ia32.StackSwitchExceptions[Index];\r
+ Vector = StackSwitchData->StackSwitchExceptions[Index];\r
if ((Vector >= CPU_EXCEPTION_NUM) ||\r
(Vector >= (Idtr.Limit + 1) / sizeof (IA32_IDT_GATE_DESCRIPTOR)))\r
{\r
Tss->FS = AsmReadFs ();\r
Tss->GS = AsmReadGs ();\r
\r
- StackTop -= StackSwitchData->Ia32.KnownGoodStackSize;\r
+ StackTop -= StackSwitchData->KnownGoodStackSize;\r
\r
//\r
// Update IDT to use Task Gate for given exception\r
//\r
// Load current task\r
//\r
- AsmWriteTr ((UINT16)((UINTN)StackSwitchData->Ia32.ExceptionTssDesc - Gdtr.Base));\r
+ AsmWriteTr ((UINT16)((UINTN)StackSwitchData->ExceptionTssDesc - Gdtr.Base));\r
\r
//\r
// Publish IDT\r
NewGdtTable = ALIGN_POINTER (StackTop, sizeof (IA32_TSS_DESCRIPTOR));\r
\r
AsmReadIdtr (&Idtr);\r
- EssData.X64.Revision = CPU_EXCEPTION_INIT_DATA_REV;\r
- EssData.X64.KnownGoodStackTop = StackTop;\r
- EssData.X64.KnownGoodStackSize = CPU_KNOWN_GOOD_STACK_SIZE;\r
- EssData.X64.StackSwitchExceptions = CPU_STACK_SWITCH_EXCEPTION_LIST;\r
- EssData.X64.StackSwitchExceptionNumber = CPU_STACK_SWITCH_EXCEPTION_NUMBER;\r
- EssData.X64.IdtTable = (VOID *)Idtr.Base;\r
- EssData.X64.IdtTableSize = Idtr.Limit + 1;\r
- EssData.X64.GdtTable = NewGdtTable;\r
- EssData.X64.GdtTableSize = CPU_TSS_DESC_SIZE + Gdtr.Limit + 1;\r
- EssData.X64.ExceptionTssDesc = NewGdtTable + Gdtr.Limit + 1;\r
- EssData.X64.ExceptionTssDescSize = CPU_TSS_DESC_SIZE;\r
- EssData.X64.ExceptionTss = NewGdtTable + Gdtr.Limit + 1 + CPU_TSS_DESC_SIZE;\r
- EssData.X64.ExceptionTssSize = CPU_TSS_SIZE;\r
+ EssData.KnownGoodStackTop = StackTop;\r
+ EssData.KnownGoodStackSize = CPU_KNOWN_GOOD_STACK_SIZE;\r
+ EssData.StackSwitchExceptions = CPU_STACK_SWITCH_EXCEPTION_LIST;\r
+ EssData.StackSwitchExceptionNumber = CPU_STACK_SWITCH_EXCEPTION_NUMBER;\r
+ EssData.IdtTable = (VOID *)Idtr.Base;\r
+ EssData.IdtTableSize = Idtr.Limit + 1;\r
+ EssData.GdtTable = NewGdtTable;\r
+ EssData.GdtTableSize = CPU_TSS_DESC_SIZE + Gdtr.Limit + 1;\r
+ EssData.ExceptionTssDesc = NewGdtTable + Gdtr.Limit + 1;\r
+ EssData.ExceptionTssDescSize = CPU_TSS_DESC_SIZE;\r
+ EssData.ExceptionTss = NewGdtTable + Gdtr.Limit + 1 + CPU_TSS_DESC_SIZE;\r
+ EssData.ExceptionTssSize = CPU_TSS_SIZE;\r
\r
return ArchSetupExceptionStack (&EssData);\r
}\r
/** @file\r
x64 CPU Exception Handler.\r
\r
- Copyright (c) 2012 - 2019, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
UINTN GdtSize;\r
\r
if ((StackSwitchData == NULL) ||\r
- (StackSwitchData->Ia32.Revision != CPU_EXCEPTION_INIT_DATA_REV) ||\r
- (StackSwitchData->X64.KnownGoodStackTop == 0) ||\r
- (StackSwitchData->X64.KnownGoodStackSize == 0) ||\r
- (StackSwitchData->X64.StackSwitchExceptions == NULL) ||\r
- (StackSwitchData->X64.StackSwitchExceptionNumber == 0) ||\r
- (StackSwitchData->X64.StackSwitchExceptionNumber > CPU_EXCEPTION_NUM) ||\r
- (StackSwitchData->X64.GdtTable == NULL) ||\r
- (StackSwitchData->X64.IdtTable == NULL) ||\r
- (StackSwitchData->X64.ExceptionTssDesc == NULL) ||\r
- (StackSwitchData->X64.ExceptionTss == NULL))\r
+ (StackSwitchData->KnownGoodStackTop == 0) ||\r
+ (StackSwitchData->KnownGoodStackSize == 0) ||\r
+ (StackSwitchData->StackSwitchExceptions == NULL) ||\r
+ (StackSwitchData->StackSwitchExceptionNumber == 0) ||\r
+ (StackSwitchData->StackSwitchExceptionNumber > CPU_EXCEPTION_NUM) ||\r
+ (StackSwitchData->GdtTable == NULL) ||\r
+ (StackSwitchData->IdtTable == NULL) ||\r
+ (StackSwitchData->ExceptionTssDesc == NULL) ||\r
+ (StackSwitchData->ExceptionTss == NULL))\r
{\r
return EFI_INVALID_PARAMETER;\r
}\r
// one or newly allocated, has enough space to hold descriptors for exception\r
// task-state segments.\r
//\r
- if (((UINTN)StackSwitchData->X64.GdtTable & (IA32_GDT_ALIGNMENT - 1)) != 0) {\r
+ if (((UINTN)StackSwitchData->GdtTable & (IA32_GDT_ALIGNMENT - 1)) != 0) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if ((UINTN)StackSwitchData->X64.ExceptionTssDesc < (UINTN)(StackSwitchData->X64.GdtTable)) {\r
+ if ((UINTN)StackSwitchData->ExceptionTssDesc < (UINTN)(StackSwitchData->GdtTable)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (((UINTN)StackSwitchData->X64.ExceptionTssDesc + StackSwitchData->X64.ExceptionTssDescSize) >\r
- ((UINTN)(StackSwitchData->X64.GdtTable) + StackSwitchData->X64.GdtTableSize))\r
+ if (((UINTN)StackSwitchData->ExceptionTssDesc + StackSwitchData->ExceptionTssDescSize) >\r
+ ((UINTN)(StackSwitchData->GdtTable) + StackSwitchData->GdtTableSize))\r
{\r
return EFI_INVALID_PARAMETER;\r
}\r
//\r
// One task gate descriptor and one task-state segment are needed.\r
//\r
- if (StackSwitchData->X64.ExceptionTssDescSize < sizeof (IA32_TSS_DESCRIPTOR)) {\r
+ if (StackSwitchData->ExceptionTssDescSize < sizeof (IA32_TSS_DESCRIPTOR)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (StackSwitchData->X64.ExceptionTssSize < sizeof (IA32_TASK_STATE_SEGMENT)) {\r
+ if (StackSwitchData->ExceptionTssSize < sizeof (IA32_TASK_STATE_SEGMENT)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
//\r
// Interrupt stack table supports only 7 vectors.\r
//\r
- TssDesc = StackSwitchData->X64.ExceptionTssDesc;\r
- Tss = StackSwitchData->X64.ExceptionTss;\r
- if (StackSwitchData->X64.StackSwitchExceptionNumber > ARRAY_SIZE (Tss->IST)) {\r
+ TssDesc = StackSwitchData->ExceptionTssDesc;\r
+ Tss = StackSwitchData->ExceptionTss;\r
+ if (StackSwitchData->StackSwitchExceptionNumber > ARRAY_SIZE (Tss->IST)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
AsmReadGdtr (&Gdtr);\r
\r
GdtSize = (UINTN)TssDesc + sizeof (IA32_TSS_DESCRIPTOR) -\r
- (UINTN)(StackSwitchData->X64.GdtTable);\r
- if ((UINTN)StackSwitchData->X64.GdtTable != Gdtr.Base) {\r
- CopyMem (StackSwitchData->X64.GdtTable, (VOID *)Gdtr.Base, Gdtr.Limit + 1);\r
- Gdtr.Base = (UINTN)StackSwitchData->X64.GdtTable;\r
+ (UINTN)(StackSwitchData->GdtTable);\r
+ if ((UINTN)StackSwitchData->GdtTable != Gdtr.Base) {\r
+ CopyMem (StackSwitchData->GdtTable, (VOID *)Gdtr.Base, Gdtr.Limit + 1);\r
+ Gdtr.Base = (UINTN)StackSwitchData->GdtTable;\r
Gdtr.Limit = (UINT16)GdtSize - 1;\r
}\r
\r
- if ((UINTN)StackSwitchData->X64.IdtTable != Idtr.Base) {\r
- Idtr.Base = (UINTN)StackSwitchData->X64.IdtTable;\r
+ if ((UINTN)StackSwitchData->IdtTable != Idtr.Base) {\r
+ Idtr.Base = (UINTN)StackSwitchData->IdtTable;\r
}\r
\r
- if (StackSwitchData->X64.IdtTableSize > 0) {\r
- Idtr.Limit = (UINT16)(StackSwitchData->X64.IdtTableSize - 1);\r
+ if (StackSwitchData->IdtTableSize > 0) {\r
+ Idtr.Limit = (UINT16)(StackSwitchData->IdtTableSize - 1);\r
}\r
\r
//\r
// Fixup exception task descriptor and task-state segment\r
//\r
ZeroMem (Tss, sizeof (*Tss));\r
- StackTop = StackSwitchData->X64.KnownGoodStackTop - CPU_STACK_ALIGNMENT;\r
+ StackTop = StackSwitchData->KnownGoodStackTop - CPU_STACK_ALIGNMENT;\r
StackTop = (UINTN)ALIGN_POINTER (StackTop, CPU_STACK_ALIGNMENT);\r
- IdtTable = StackSwitchData->X64.IdtTable;\r
- for (Index = 0; Index < StackSwitchData->X64.StackSwitchExceptionNumber; ++Index) {\r
+ IdtTable = StackSwitchData->IdtTable;\r
+ for (Index = 0; Index < StackSwitchData->StackSwitchExceptionNumber; ++Index) {\r
//\r
// Fixup IST\r
//\r
Tss->IST[Index] = StackTop;\r
- StackTop -= StackSwitchData->X64.KnownGoodStackSize;\r
+ StackTop -= StackSwitchData->KnownGoodStackSize;\r
\r
//\r
// Set the IST field to enable corresponding IST\r
//\r
- Vector = StackSwitchData->X64.StackSwitchExceptions[Index];\r
+ Vector = StackSwitchData->StackSwitchExceptions[Index];\r
if ((Vector >= CPU_EXCEPTION_NUM) ||\r
(Vector >= (Idtr.Limit + 1) / sizeof (IA32_IDT_GATE_DESCRIPTOR)))\r
{\r
//\r
// Load current task\r
//\r
- AsmWriteTr ((UINT16)((UINTN)StackSwitchData->X64.ExceptionTssDesc - Gdtr.Base));\r
+ AsmWriteTr ((UINT16)((UINTN)StackSwitchData->ExceptionTssDesc - Gdtr.Base));\r
\r
//\r
// Publish IDT\r