- if (FeaturePcdGet (PcdFrameworkCompatibilitySupport)) {\r
- //\r
- // On some platform, such as ECP, a dispatch node in boot script table may execute a 32-bit PEIM which may need PeiServices\r
- // pointer. So PeiServices need preserve in (IDTBase- sizeof (UINTN)).\r
- //\r
- IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile);\r
- //\r
- // Make sure the newly allocated IDT align with 16-bytes\r
- //\r
- IdtBuffer = AllocatePages (EFI_SIZE_TO_PAGES((IdtDescriptor->Limit + 1) + 16));\r
- if (IdtBuffer == NULL) {\r
- REPORT_STATUS_CODE (\r
- EFI_ERROR_CODE | EFI_ERROR_MAJOR,\r
- (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_S3_RESUME_FAILED)\r
- );\r
- ASSERT (FALSE);\r
- }\r
- //\r
- // Additional 16 bytes allocated to save IA32 IDT descriptor and Pei Service Table Pointer\r
- // IA32 IDT descriptor will be used to setup IA32 IDT table for 32-bit Framework Boot Script code\r
- //\r
- ZeroMem (IdtBuffer, 16);\r
- AsmReadIdtr ((IA32_DESCRIPTOR *)IdtBuffer);\r
- CopyMem ((VOID*)((UINT8*)IdtBuffer + 16),(VOID*)(IdtDescriptor->Base), (IdtDescriptor->Limit + 1));\r
- IdtDescriptor->Base = (UINTN)((UINT8*)IdtBuffer + 16);\r
- *(UINTN*)(IdtDescriptor->Base - sizeof(UINTN)) = (UINTN)GetPeiServicesTablePointer ();\r
- }\r
-\r