2 This module provide function for ascertaining and updating the boot mode:
5 See PI Specification volume I, chapter 9 Boot Paths for additional information
8 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
9 This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 This service enables PEIMs to ascertain the present value of the boot mode.
24 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
25 @param BootMode A pointer to contain the value of the boot mode.
27 @retval EFI_SUCCESS The boot mode was returned successfully.
28 @retval EFI_INVALID_PARAMETER BootMode is NULL.
34 IN CONST EFI_PEI_SERVICES
**PeiServices
,
35 IN OUT EFI_BOOT_MODE
*BootMode
38 PEI_CORE_INSTANCE
*PrivateData
;
39 EFI_HOB_HANDOFF_INFO_TABLE
*HandOffHob
;
42 if (BootMode
== NULL
) {
43 return EFI_INVALID_PARAMETER
;
46 PrivateData
= PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices
);
48 HandOffHob
= (PrivateData
->HobList
.HandoffInformationTable
);
50 *BootMode
= HandOffHob
->BootMode
;
58 This service enables PEIMs to update the boot mode variable.
61 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
62 @param BootMode The value of the boot mode to set.
64 @return EFI_SUCCESS The value was successfully updated
70 IN CONST EFI_PEI_SERVICES
**PeiServices
,
71 IN EFI_BOOT_MODE BootMode
74 PEI_CORE_INSTANCE
*PrivateData
;
75 EFI_HOB_HANDOFF_INFO_TABLE
*HandOffHob
;
78 PrivateData
= PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices
);
80 HandOffHob
= (PrivateData
->HobList
.HandoffInformationTable
);
82 HandOffHob
->BootMode
= BootMode
;