]>
Commit | Line | Data |
---|---|---|
1 | /*++\r | |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | BootMode.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | EFI PEI Core Boot Mode services\r | |
19 | \r | |
20 | \r | |
21 | \r | |
22 | Revision History\r | |
23 | \r | |
24 | --*/\r | |
25 | \r | |
26 | #include <PeiMain.h>\r | |
27 | \r | |
28 | EFI_STATUS\r | |
29 | EFIAPI\r | |
30 | PeiGetBootMode (\r | |
31 | IN EFI_PEI_SERVICES **PeiServices,\r | |
32 | OUT EFI_BOOT_MODE *BootMode\r | |
33 | )\r | |
34 | /*++\r | |
35 | \r | |
36 | Routine Description:\r | |
37 | \r | |
38 | This service enables PEIMs to ascertain the present value of the boot mode. \r | |
39 | \r | |
40 | Arguments:\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 | |
45 | Returns:\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 | |
68 | }\r | |
69 | \r | |
70 | \r | |
71 | EFI_STATUS\r | |
72 | EFIAPI\r | |
73 | PeiSetBootMode (\r | |
74 | IN EFI_PEI_SERVICES **PeiServices,\r | |
75 | IN EFI_BOOT_MODE BootMode\r | |
76 | )\r | |
77 | /*++\r | |
78 | \r | |
79 | Routine Description:\r | |
80 | \r | |
81 | This service enables PEIMs to update the boot mode variable. \r | |
82 | \r | |
83 | Arguments:\r | |
84 | \r | |
85 | PeiServices - The PEI core services table.\r | |
86 | BootMode - The value of the boot mode to set.\r | |
87 | \r | |
88 | Returns:\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 | |
106 | }\r |