]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PlatformPei/PlatformPeim.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPlatformPkg / PlatformPei / PlatformPeim.c
old mode 100755 (executable)
new mode 100644 (file)
index 5921e35..62d1faf
@@ -1,31 +1,29 @@
 /** @file\r
-*\r
-*  Copyright (c) 2011, ARM Limited. All rights reserved.\r
-*  \r
-*  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
+  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
 **/\r
 \r
 #include <PiPei.h>\r
 \r
 //\r
-// The protocols, PPI and GUID defintions for this module\r
+// The protocols, PPI and GUID definitions for this module\r
 //\r
 #include <Ppi/MasterBootMode.h>\r
 #include <Ppi/BootInRecoveryMode.h>\r
+#include <Ppi/GuidedSectionExtraction.h>\r
 //\r
 // The Library classes this module consumes\r
 //\r
+#include <Library/ArmPlatformLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/HobLib.h>\r
 #include <Library/PeimEntryPoint.h>\r
+#include <Library/PeiServicesLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/ArmPlatformLib.h>\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -33,7 +31,7 @@ InitializePlatformPeim (
   IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
   IN CONST EFI_PEI_SERVICES     **PeiServices\r
   );\r
-  \r
+\r
 EFI_STATUS\r
 EFIAPI\r
 PlatformPeim (\r
@@ -43,13 +41,13 @@ PlatformPeim (
 //\r
 // Module globals\r
 //\r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListBootMode = {\r
+CONST EFI_PEI_PPI_DESCRIPTOR  mPpiListBootMode = {\r
   (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
   &gEfiPeiMasterBootModePpiGuid,\r
   NULL\r
 };\r
 \r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListRecoveryBootMode = {\r
+CONST EFI_PEI_PPI_DESCRIPTOR  mPpiListRecoveryBootMode = {\r
   (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
   &gEfiPeiBootInRecoveryModePpiGuid,\r
   NULL\r
@@ -59,13 +57,13 @@ EFI_PEI_PPI_DESCRIPTOR  mPpiListRecoveryBootMode = {
 \r
 Routine Description:\r
 \r
-  \r
+\r
 \r
 Arguments:\r
 \r
   FileHandle  - Handle of the file being invoked.\r
   PeiServices - Describes the list of possible PEI Services.\r
-    \r
+\r
 Returns:\r
 \r
   Status -  EFI_SUCCESS if the boot mode could be set\r
@@ -78,22 +76,24 @@ InitializePlatformPeim (
   IN CONST EFI_PEI_SERVICES     **PeiServices\r
   )\r
 {\r
-  EFI_STATUS                    Status;\r
-  UINTN                         BootMode;\r
+  EFI_STATUS     Status;\r
+  EFI_BOOT_MODE  BootMode;\r
 \r
-  DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));\r
+  DEBUG ((DEBUG_LOAD | DEBUG_INFO, "Platform PEIM Loaded\n"));\r
+\r
+  Status = PeiServicesSetBootMode (ArmPlatformGetBootMode ());\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   PlatformPeim ();\r
-  \r
-  BootMode  = ArmPlatformGetBootMode ();\r
-  Status    = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
+\r
+  Status = PeiServicesGetBootMode (&BootMode);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
+  Status = PeiServicesInstallPpi (&mPpiListBootMode);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
-    Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
+    Status = PeiServicesInstallPpi (&mPpiListRecoveryBootMode);\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r