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 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
16 This service enables PEIMs to ascertain the present value of the boot mode.
18 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
19 @param BootMode A pointer to contain the value of the boot mode.
21 @retval EFI_SUCCESS The boot mode was returned successfully.
22 @retval EFI_INVALID_PARAMETER BootMode is NULL.
28 IN CONST EFI_PEI_SERVICES
**PeiServices
,
29 IN OUT EFI_BOOT_MODE
*BootMode
32 PEI_CORE_INSTANCE
*PrivateData
;
33 EFI_HOB_HANDOFF_INFO_TABLE
*HandOffHob
;
35 if (BootMode
== NULL
) {
36 return EFI_INVALID_PARAMETER
;
39 PrivateData
= PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices
);
41 HandOffHob
= (PrivateData
->HobList
.HandoffInformationTable
);
43 *BootMode
= HandOffHob
->BootMode
;
49 This service enables PEIMs to update the boot mode variable.
52 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
53 @param BootMode The value of the boot mode to set.
55 @return EFI_SUCCESS The value was successfully updated
61 IN CONST EFI_PEI_SERVICES
**PeiServices
,
62 IN EFI_BOOT_MODE BootMode
65 PEI_CORE_INSTANCE
*PrivateData
;
66 EFI_HOB_HANDOFF_INFO_TABLE
*HandOffHob
;
68 PrivateData
= PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices
);
70 HandOffHob
= (PrivateData
->HobList
.HandoffInformationTable
);
72 HandOffHob
->BootMode
= BootMode
;