+++ /dev/null
-/** @file\r
- Internal include file of PEI Services Table Pointer.\r
-\r
- Copyright (c) 2006, Intel Corporation<BR>\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-#ifndef __INTERNAL_PEI_SERVICES_TABLE_POINTER_H__\r
-#define __INTERNAL_PEI_SERVICES_TABLE_POINTER_H__\r
-\r
-\r
-#include <PiPei.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/PeiServicesTablePointerLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-\r
- \r
-#endif\r
\r
**/\r
\r
-#include "InternalPeiServicesTablePointer.h"\r
+#include <PiPei.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/PeiServicesTablePointerLib.h>\r
+#include <Library/DebugLib.h>\r
\r
/**\r
\r
IA32_DESCRIPTOR Idtr;\r
\r
AsmReadIdtr (&Idtr);\r
- PeiServices = (EFI_PEI_SERVICES **) (*(UINTN*)(Idtr.Base - 4));\r
+ PeiServices = (EFI_PEI_SERVICES **) (*(UINTN*)(Idtr.Base - sizeof (UINTN)));\r
ASSERT (PeiServices != NULL);\r
return PeiServices;\r
}\r
IA32_DESCRIPTOR Idtr;\r
\r
AsmReadIdtr (&Idtr);\r
- (*(UINTN*)(Idtr.Base - 4)) = (UINTN)PeiServicesTablePointer;\r
+ (*(UINTN*)(Idtr.Base - sizeof (UINTN))) = (UINTN)PeiServicesTablePointer;\r
}\r
\r
-/**\r
- After memory initialization in PEI phase, the IDT table in temporary memory should \r
- be migrated to memory, and the address of PeiServicesPointer also need to be updated \r
- immediately preceding the new IDT table.\r
- \r
- @param PeiServices The address of PeiServices pointer.\r
-**/\r
-VOID\r
-EFIAPI\r
-MigrateIdtTable (\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-{\r
- UINTN Size;\r
- VOID *NewBase;\r
- EFI_STATUS Status;\r
- IA32_DESCRIPTOR Idtr;\r
- \r
- AsmReadIdtr (&Idtr);\r
- \r
- Size = sizeof(UINTN) + (Idtr.Limit + 1); \r
- \r
- Status = PeiServicesAllocatePool (Size, &NewBase);\r
- ASSERT_EFI_ERROR (Status);\r
- \r
- CopyMem ((VOID*)((UINTN)NewBase + sizeof(UINTN)), (VOID*)Idtr.Base, (Idtr.Limit + 1));\r
- \r
- Idtr.Base = (UINTN)NewBase + sizeof(UINTN);\r
- AsmWriteIdtr (&Idtr);\r
- SetPeiServicesTablePointer(PeiServices); \r
-} \r
\r