diff options
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c')
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c index f91a2f582a..ca75a9493d 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c @@ -38,8 +38,16 @@ GetPeiServicesTablePointer ( )
{
EFI_PEI_SERVICES **PeiServices;
+#if (PI_SPECIFICATION_VERSION >= 0x00010000)
+ IA32_DESCRIPTOR Idtr;
+#endif
+#if (PI_SPECIFICATION_VERSION < 0x00010000)
PeiServices = (EFI_PEI_SERVICES **)(UINTN)AsmReadMm7 ();
+#else
+ AsmReadIdtr (&Idtr);
+ PeiServices = (EFI_PEI_SERVICES **)(UINTN)(*(UINTN*)(Idtr.Base - sizeof (UINTN)));
+#endif
ASSERT (PeiServices != NULL);
return PeiServices;
}
@@ -63,6 +71,8 @@ PeiServicesTablePointerLibConstructor ( IN EFI_PEI_SERVICES **PeiServices
)
{
+#if (PI_SPECIFICATION_VERSION < 0x00010000)
AsmWriteMm7 ((UINT64)(UINTN)PeiServices);
+#endif
return EFI_SUCCESS;
}
|