]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Core/Pei/BootMode/BootMode.c
Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.
[mirror_edk2.git] / EdkModulePkg / Core / 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 EFI PEI Core Boot Mode services\r
19\r
20\r
21\r
22Revision History\r
23\r
24--*/\r
25\r
26#include <PeiMain.h>\r
27\r
28EFI_STATUS\r
29EFIAPI\r
30PeiGetBootMode (\r
31 IN EFI_PEI_SERVICES **PeiServices,\r
32 OUT EFI_BOOT_MODE *BootMode\r
33 )\r
34/*++\r
35\r
36Routine Description:\r
37\r
38 This service enables PEIMs to ascertain the present value of the boot mode. \r
39\r
40Arguments:\r
41\r
42 PeiServices - The PEI core services table.\r
43 BootMode - A pointer to contain the value of the boot mode. \r
44\r
45Returns:\r
46\r
47 EFI_SUCCESS - The boot mode was returned successfully.\r
48 EFI_INVALID_PARAMETER - BootMode is NULL.\r
49\r
50--*/\r
51{\r
52 PEI_CORE_INSTANCE *PrivateData; \r
53 EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;\r
54\r
55\r
56 if (BootMode == NULL) {\r
57 return EFI_INVALID_PARAMETER;\r
58 }\r
59\r
60 PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r
61 \r
62 HandOffHob = (PrivateData->HobList.HandoffInformationTable);\r
63 \r
64 *BootMode = HandOffHob->BootMode;\r
65 \r
66\r
67 return EFI_SUCCESS; \r
1cc8ee78 68}\r
878ddf1f 69\r
70\r
71EFI_STATUS\r
72EFIAPI\r
73PeiSetBootMode (\r
74 IN EFI_PEI_SERVICES **PeiServices,\r
75 IN EFI_BOOT_MODE BootMode\r
76 )\r
77/*++\r
78\r
79Routine Description:\r
80\r
81 This service enables PEIMs to update the boot mode variable. \r
82\r
83Arguments:\r
84\r
85 PeiServices - The PEI core services table.\r
86 BootMode - The value of the boot mode to set.\r
87\r
88Returns:\r
89\r
90 EFI_SUCCESS - The value was successfully updated\r
91\r
92--*/\r
93{\r
94 PEI_CORE_INSTANCE *PrivateData; \r
95 EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;\r
96\r
97\r
98 PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r
99 \r
100 HandOffHob = (PrivateData->HobList.HandoffInformationTable);\r
101 \r
102 HandOffHob->BootMode = BootMode;\r
103\r
104\r
105 return EFI_SUCCESS; \r
1cc8ee78 106}\r