]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/PlatformPei/PlatformPeim.c
ArmPlatformPkg: Fix builds
[mirror_edk2.git] / ArmPlatformPkg / PlatformPei / PlatformPeim.c
CommitLineData
1d5d0ae9 1/** @file\r
2*\r
3* Copyright (c) 2011, ARM Limited. All rights reserved.\r
4* \r
5* This program and the accompanying materials \r
6* are licensed and made available under the terms and conditions of the BSD License \r
7* which accompanies this distribution. The full text of the license may be found at \r
8* http://opensource.org/licenses/bsd-license.php \r
9*\r
10* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12*\r
13**/\r
14\r
1d5d0ae9 15#include <PiPei.h>\r
48835130 16\r
1d5d0ae9 17//\r
18// The protocols, PPI and GUID defintions for this module\r
19//\r
20#include <Ppi/MasterBootMode.h>\r
21#include <Ppi/BootInRecoveryMode.h>\r
22//\r
23// The Library classes this module consumes\r
24//\r
1d5d0ae9 25#include <Library/PeimEntryPoint.h>\r
26#include <Library/PcdLib.h>\r
48835130 27#include <Library/DebugLib.h>\r
28#include <Library/ArmPlatformLib.h>\r
1d5d0ae9 29\r
48835130 30EFI_STATUS\r
31EFIAPI\r
32InitializePlatformPeim (\r
33 IN EFI_PEI_FILE_HANDLE FileHandle,\r
34 IN CONST EFI_PEI_SERVICES **PeiServices\r
35 );\r
3723a71a 36 \r
37EFI_STATUS\r
38EFIAPI\r
39PlatformPeim (\r
40 VOID\r
41 );\r
1d5d0ae9 42\r
43//\r
44// Module globals\r
45//\r
46EFI_PEI_PPI_DESCRIPTOR mPpiListBootMode = {\r
47 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
48 &gEfiPeiMasterBootModePpiGuid,\r
49 NULL\r
50};\r
51\r
52EFI_PEI_PPI_DESCRIPTOR mPpiListRecoveryBootMode = {\r
53 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
54 &gEfiPeiBootInRecoveryModePpiGuid,\r
55 NULL\r
56};\r
57\r
1d5d0ae9 58/*++\r
59\r
60Routine Description:\r
61\r
62 \r
63\r
64Arguments:\r
65\r
66 FileHandle - Handle of the file being invoked.\r
67 PeiServices - Describes the list of possible PEI Services.\r
68 \r
69Returns:\r
70\r
71 Status - EFI_SUCCESS if the boot mode could be set\r
72\r
73--*/\r
48835130 74EFI_STATUS\r
75EFIAPI\r
76InitializePlatformPeim (\r
77 IN EFI_PEI_FILE_HANDLE FileHandle,\r
78 IN CONST EFI_PEI_SERVICES **PeiServices\r
79 )\r
1d5d0ae9 80{\r
81 EFI_STATUS Status;\r
82 UINTN BootMode;\r
83\r
84 DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));\r
85\r
48835130 86 PlatformPeim ();\r
1d5d0ae9 87 \r
a534d714 88 BootMode = ArmPlatformGetBootMode ();\r
1d5d0ae9 89 Status = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
90 ASSERT_EFI_ERROR (Status);\r
91\r
92 Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
93 ASSERT_EFI_ERROR (Status);\r
94\r
95 if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
96 Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
97 ASSERT_EFI_ERROR (Status);\r
98 }\r
99\r
100 return Status;\r
101}\r