]>
Commit | Line | Data |
---|---|---|
615c6dd0 | 1 | /** @file\r |
b1f6a7c6 | 2 | This module provide function for ascertaining and updating the boot mode:\r |
3 | GetBootMode()\r | |
4 | SetBootMode()\r | |
cfc8865f | 5 | See PI Specification volume I, chapter 9 Boot Paths for additional information\r |
b1f6a7c6 | 6 | on the boot mode.\r |
7 | \r | |
cd5ebaa0 HT |
8 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
9 | This program and the accompanying materials \r | |
192f6d4c | 10 | are licensed and made available under the terms and conditions of the BSD License \r |
11 | which accompanies this distribution. The full text of the license may be found at \r | |
12 | http://opensource.org/licenses/bsd-license.php \r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
16 | \r | |
b1f6a7c6 | 17 | **/\r |
192f6d4c | 18 | \r |
0d516397 | 19 | #include "PeiMain.h"\r |
192f6d4c | 20 | \r |
b1f6a7c6 | 21 | /**\r |
22 | This service enables PEIMs to ascertain the present value of the boot mode.\r | |
192f6d4c | 23 | \r |
dc857d56 | 24 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r |
b1f6a7c6 | 25 | @param BootMode A pointer to contain the value of the boot mode.\r |
192f6d4c | 26 | \r |
b1f6a7c6 | 27 | @retval EFI_SUCCESS The boot mode was returned successfully.\r |
28 | @retval EFI_INVALID_PARAMETER BootMode is NULL.\r | |
192f6d4c | 29 | \r |
615c6dd0 | 30 | **/\r |
192f6d4c | 31 | EFI_STATUS\r |
32 | EFIAPI\r | |
33 | PeiGetBootMode (\r | |
b1f6a7c6 | 34 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
d976bf31 | 35 | IN OUT EFI_BOOT_MODE *BootMode\r |
192f6d4c | 36 | )\r |
192f6d4c | 37 | {\r |
b1f6a7c6 | 38 | PEI_CORE_INSTANCE *PrivateData; \r |
192f6d4c | 39 | EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;\r |
40 | \r | |
41 | \r | |
42 | if (BootMode == NULL) {\r | |
43 | return EFI_INVALID_PARAMETER;\r | |
44 | }\r | |
45 | \r | |
46 | PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r | |
47 | \r | |
48 | HandOffHob = (PrivateData->HobList.HandoffInformationTable);\r | |
49 | \r | |
50 | *BootMode = HandOffHob->BootMode;\r | |
51 | \r | |
52 | \r | |
53 | return EFI_SUCCESS; \r | |
54 | }\r | |
55 | \r | |
56 | \r | |
b1f6a7c6 | 57 | /**\r |
58 | This service enables PEIMs to update the boot mode variable.\r | |
59 | \r | |
60 | \r | |
dc857d56 | 61 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r |
62 | @param BootMode The value of the boot mode to set.\r | |
b1f6a7c6 | 63 | \r |
dc857d56 | 64 | @return EFI_SUCCESS The value was successfully updated\r |
b1f6a7c6 | 65 | \r |
66 | **/\r | |
192f6d4c | 67 | EFI_STATUS\r |
68 | EFIAPI\r | |
69 | PeiSetBootMode (\r | |
0c2b5da8 | 70 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
71 | IN EFI_BOOT_MODE BootMode\r | |
192f6d4c | 72 | )\r |
192f6d4c | 73 | {\r |
74 | PEI_CORE_INSTANCE *PrivateData; \r | |
75 | EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;\r | |
76 | \r | |
77 | \r | |
78 | PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r | |
79 | \r | |
80 | HandOffHob = (PrivateData->HobList.HandoffInformationTable);\r | |
81 | \r | |
82 | HandOffHob->BootMode = BootMode;\r | |
83 | \r | |
84 | \r | |
85 | return EFI_SUCCESS; \r | |
86 | }\r |