]> git.proxmox.com Git - mirror_edk2.git/blame - Nt32Pkg/BootModePei/BootModePei.c
Update PEIM entry point to follow PEIM entry point.
[mirror_edk2.git] / Nt32Pkg / BootModePei / BootModePei.c
CommitLineData
6ae81428 1/**@file\r
89b6542c 2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 BootMode.c\r
15 \r
16Abstract:\r
17\r
18 Tiano PEIM to provide the platform support functionality within Windows\r
19\r
6ae81428 20**/\r
89b6542c 21\r
22\r
23\r
24//\r
25// The package level header files this module uses\r
26//\r
27#include <PiPei.h>\r
28//\r
29// The protocols, PPI and GUID defintions for this module\r
30//\r
31#include <Ppi/MasterBootMode.h>\r
32#include <Ppi/BootInRecoveryMode.h>\r
33//\r
34// The Library classes this module consumes\r
35//\r
36#include <Library/DebugLib.h>\r
37#include <Library/PeimEntryPoint.h>\r
38\r
39\r
40//\r
41// Module globals\r
42//\r
43EFI_PEI_PPI_DESCRIPTOR mPpiListBootMode = {\r
44 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
45 &gEfiPeiMasterBootModePpiGuid,\r
46 NULL\r
47};\r
48\r
49EFI_PEI_PPI_DESCRIPTOR mPpiListRecoveryBootMode = {\r
50 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
51 &gEfiPeiBootInRecoveryModePpiGuid,\r
52 NULL\r
53};\r
54\r
55EFI_STATUS\r
56EFIAPI\r
57InitializeBootMode (\r
f0ba8fda
LG
58 IN EFI_PEI_FILE_HANDLE FileHandle,\r
59 IN CONST EFI_PEI_SERVICES **PeiServices\r
89b6542c 60 )\r
61/*++\r
62\r
63Routine Description:\r
64\r
65 Peform the boot mode determination logic\r
66\r
67Arguments:\r
68\r
f0ba8fda
LG
69 FileHandle - Handle of the file being invoked.\r
70 PeiServices - Describes the list of possible PEI Services.\r
89b6542c 71 \r
72Returns:\r
73\r
74 Status - EFI_SUCCESS if the boot mode could be set\r
75\r
76--*/\r
89b6542c 77{\r
78 EFI_STATUS Status;\r
79 UINTN BootMode;\r
80\r
81 DEBUG ((EFI_D_ERROR, "NT32 Boot Mode PEIM Loaded\n"));\r
82\r
83 //\r
84 // Let's assume things are OK if not told otherwise\r
85 // Should we read an environment variable in order to easily change this?\r
86 //\r
87 BootMode = BOOT_WITH_FULL_CONFIGURATION;\r
88\r
f0ba8fda 89 Status = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
89b6542c 90 ASSERT_EFI_ERROR (Status);\r
91\r
f0ba8fda 92 Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
89b6542c 93 ASSERT_EFI_ERROR (Status);\r
94\r
95 if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
f0ba8fda 96 Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
89b6542c 97 ASSERT_EFI_ERROR (Status);\r
98 }\r
99\r
100 return Status;\r
101}\r