Change NT32 to new XML Schema.
[mirror_edk2.git] / EdkNt32Pkg / Pei / BootMode / BootMode.c
CommitLineData
878ddf1f 1/*++\r
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
20--*/\r
21\r
22\r
23\r
24//\r
25// Module globals\r
26//\r
27EFI_PEI_PPI_DESCRIPTOR mPpiListBootMode = {\r
28 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
29 &gEfiPeiMasterBootModePpiGuid,\r
30 NULL\r
31};\r
32\r
33EFI_PEI_PPI_DESCRIPTOR mPpiListRecoveryBootMode = {\r
34 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
35 &gEfiPeiBootInRecoveryModePpiGuid,\r
36 NULL\r
37};\r
38\r
39EFI_STATUS\r
40EFIAPI\r
41InitializeBootMode (\r
42 IN EFI_FFS_FILE_HEADER *FfsHeader,\r
43 IN EFI_PEI_SERVICES **PeiServices\r
44 )\r
45/*++\r
46\r
47Routine Description:\r
48\r
49 Peform the boot mode determination logic\r
50\r
51Arguments:\r
52\r
53 PeiServices - General purpose services available to every PEIM.\r
54 \r
55Returns:\r
56\r
57 Status - EFI_SUCCESS if the boot mode could be set\r
58\r
59--*/\r
60// TODO: FfsHeader - add argument and description to function comment\r
61{\r
62 EFI_STATUS Status;\r
63 UINTN BootMode;\r
64\r
65 DEBUG ((EFI_D_ERROR, "NT32 Boot Mode PEIM Loaded\n"));\r
66\r
67 //\r
68 // Let's assume things are OK if not told otherwise\r
69 // Should we read an environment variable in order to easily change this?\r
70 //\r
71 BootMode = BOOT_WITH_FULL_CONFIGURATION;\r
72\r
73 Status = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
74 ASSERT_EFI_ERROR (Status);\r
75\r
76 Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
77 ASSERT_EFI_ERROR (Status);\r
78\r
79 if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
80 Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
81 ASSERT_EFI_ERROR (Status);\r
82 }\r
83\r
84 return Status;\r
85}\r