PeiServicesAllocatePages () will output sizeof (EFI_PHYSICAL_ADDRESS) value.
IdtTableForX64 is sizeof (UINTN) local variable. It will overwrite other local
variable.
This issue is found when we dump BaseOfStack value.
Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Status = PeiServicesAllocatePages (\r
EfiBootServicesData,\r
EFI_SIZE_TO_PAGES(sizeof (X64_IDT_TABLE) + SizeOfTemplate * IDT_ENTRY_COUNT),\r
- (EFI_PHYSICAL_ADDRESS *) &IdtTableForX64\r
+ &VectorAddress\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
// Store EFI_PEI_SERVICES** in the 4 bytes immediately preceding IDT to avoid that\r
// it may not be gotten correctly after IDT register is re-written.\r
//\r
+ IdtTableForX64 = (X64_IDT_TABLE *) (UINTN) VectorAddress;\r
IdtTableForX64->PeiService = GetPeiServicesTablePointer ();\r
\r
VectorAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) (IdtTableForX64 + 1);\r