3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
12 Tiano PEIM to provide the platform support functionality within Windows
19 // The package level header files this module uses
23 // The protocols, PPI and GUID defintions for this module
25 #include <Ppi/MasterBootMode.h>
26 #include <Ppi/BootInRecoveryMode.h>
28 // The Library classes this module consumes
30 #include <Library/DebugLib.h>
31 #include <Library/PeimEntryPoint.h>
37 EFI_PEI_PPI_DESCRIPTOR mPpiListBootMode
= {
38 (EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
39 &gEfiPeiMasterBootModePpiGuid
,
43 EFI_PEI_PPI_DESCRIPTOR mPpiListRecoveryBootMode
= {
44 (EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
45 &gEfiPeiBootInRecoveryModePpiGuid
,
52 IN EFI_PEI_FILE_HANDLE FileHandle
,
53 IN CONST EFI_PEI_SERVICES
**PeiServices
59 Peform the boot mode determination logic
63 FileHandle - Handle of the file being invoked.
64 PeiServices - Describes the list of possible PEI Services.
68 Status - EFI_SUCCESS if the boot mode could be set
75 DEBUG ((EFI_D_ERROR
, "NT32 Boot Mode PEIM Loaded\n"));
78 // Let's assume things are OK if not told otherwise
79 // Should we read an environment variable in order to easily change this?
81 BootMode
= BOOT_WITH_FULL_CONFIGURATION
;
83 Status
= (**PeiServices
).SetBootMode (PeiServices
, (UINT8
) BootMode
);
84 ASSERT_EFI_ERROR (Status
);
86 Status
= (**PeiServices
).InstallPpi (PeiServices
, &mPpiListBootMode
);
87 ASSERT_EFI_ERROR (Status
);
89 if (BootMode
== BOOT_IN_RECOVERY_MODE
) {
90 Status
= (**PeiServices
).InstallPpi (PeiServices
, &mPpiListRecoveryBootMode
);
91 ASSERT_EFI_ERROR (Status
);