2008-03-19 10:01:03 +01:00
|
|
|
/** @file
|
2008-07-16 11:40:06 +02:00
|
|
|
This module provide function for ascertaining and updating the boot mode:
|
|
|
|
GetBootMode()
|
|
|
|
SetBootMode()
|
2008-12-03 10:08:05 +01:00
|
|
|
See PI Specification volume I, chapter 9 Boot Paths for additional information
|
2008-07-16 11:40:06 +02:00
|
|
|
on the boot mode.
|
2018-06-27 15:08:52 +02:00
|
|
|
|
|
|
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-07-04 09:51:48 +02:00
|
|
|
|
2008-07-16 11:40:06 +02:00
|
|
|
**/
|
2007-07-04 09:51:48 +02:00
|
|
|
|
2008-10-31 05:35:02 +01:00
|
|
|
#include "PeiMain.h"
|
2007-07-04 09:51:48 +02:00
|
|
|
|
2008-07-16 11:40:06 +02:00
|
|
|
/**
|
|
|
|
This service enables PEIMs to ascertain the present value of the boot mode.
|
2007-07-04 09:51:48 +02:00
|
|
|
|
2008-08-08 03:37:44 +02:00
|
|
|
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
|
2008-07-16 11:40:06 +02:00
|
|
|
@param BootMode A pointer to contain the value of the boot mode.
|
2007-07-04 09:51:48 +02:00
|
|
|
|
2008-07-16 11:40:06 +02:00
|
|
|
@retval EFI_SUCCESS The boot mode was returned successfully.
|
|
|
|
@retval EFI_INVALID_PARAMETER BootMode is NULL.
|
2007-07-04 09:51:48 +02:00
|
|
|
|
2008-03-19 10:01:03 +01:00
|
|
|
**/
|
2007-07-04 09:51:48 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
PeiGetBootMode (
|
2008-07-16 11:40:06 +02:00
|
|
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
2008-10-20 15:33:43 +02:00
|
|
|
IN OUT EFI_BOOT_MODE *BootMode
|
2007-07-04 09:51:48 +02:00
|
|
|
)
|
|
|
|
{
|
2018-06-27 15:08:52 +02:00
|
|
|
PEI_CORE_INSTANCE *PrivateData;
|
2007-07-04 09:51:48 +02:00
|
|
|
EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
|
|
|
|
|
|
|
|
|
|
|
|
if (BootMode == NULL) {
|
|
|
|
return EFI_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|
|
|
|
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
|
2018-06-27 15:08:52 +02:00
|
|
|
|
2007-07-04 09:51:48 +02:00
|
|
|
HandOffHob = (PrivateData->HobList.HandoffInformationTable);
|
2018-06-27 15:08:52 +02:00
|
|
|
|
2007-07-04 09:51:48 +02:00
|
|
|
*BootMode = HandOffHob->BootMode;
|
|
|
|
|
2018-06-27 15:08:52 +02:00
|
|
|
|
|
|
|
return EFI_SUCCESS;
|
2007-07-04 09:51:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-16 11:40:06 +02:00
|
|
|
/**
|
|
|
|
This service enables PEIMs to update the boot mode variable.
|
|
|
|
|
|
|
|
|
2008-08-08 03:37:44 +02:00
|
|
|
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
|
|
|
|
@param BootMode The value of the boot mode to set.
|
2008-07-16 11:40:06 +02:00
|
|
|
|
2008-08-08 03:37:44 +02:00
|
|
|
@return EFI_SUCCESS The value was successfully updated
|
2008-07-16 11:40:06 +02:00
|
|
|
|
|
|
|
**/
|
2007-07-04 09:51:48 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
PeiSetBootMode (
|
2007-09-04 08:12:48 +02:00
|
|
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
|
|
|
IN EFI_BOOT_MODE BootMode
|
2007-07-04 09:51:48 +02:00
|
|
|
)
|
|
|
|
{
|
2018-06-27 15:08:52 +02:00
|
|
|
PEI_CORE_INSTANCE *PrivateData;
|
2007-07-04 09:51:48 +02:00
|
|
|
EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
|
|
|
|
|
|
|
|
|
|
|
|
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
|
2018-06-27 15:08:52 +02:00
|
|
|
|
2007-07-04 09:51:48 +02:00
|
|
|
HandOffHob = (PrivateData->HobList.HandoffInformationTable);
|
2018-06-27 15:08:52 +02:00
|
|
|
|
2007-07-04 09:51:48 +02:00
|
|
|
HandOffHob->BootMode = BootMode;
|
|
|
|
|
|
|
|
|
2018-06-27 15:08:52 +02:00
|
|
|
return EFI_SUCCESS;
|
2007-07-04 09:51:48 +02:00
|
|
|
}
|