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
;
36 if (BootMode
== NULL
) {
37 return EFI_INVALID_PARAMETER
;
40 PrivateData
= PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices
);
42 HandOffHob
= (PrivateData
->HobList
.HandoffInformationTable
);
44 *BootMode
= HandOffHob
->BootMode
;
52 This service enables PEIMs to update the boot mode variable.
55 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
56 @param BootMode The value of the boot mode to set.
58 @return EFI_SUCCESS The value was successfully updated
64 IN CONST EFI_PEI_SERVICES
**PeiServices
,
65 IN EFI_BOOT_MODE BootMode
68 PEI_CORE_INSTANCE
*PrivateData
;
69 EFI_HOB_HANDOFF_INFO_TABLE
*HandOffHob
;
72 PrivateData
= PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices
);
74 HandOffHob
= (PrivateData
->HobList
.HandoffInformationTable
);
76 HandOffHob
->BootMode
= BootMode
;