]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/BootMode/BootMode.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Core / Pei / BootMode / BootMode.c
index afa3c89ebca10dded67c195e949e53900f4479c4..100942ecd08e10a7f27a1f0d46f0c25845ffbbac 100644 (file)
 /** @file\r
+  This module provide function for ascertaining and updating the boot mode:\r
+  GetBootMode()\r
+  SetBootMode()\r
+  See PI Specification volume I, chapter 9 Boot Paths for additional information\r
+  on the boot mode.\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
-Module Name:\r
-\r
-  BootMode.c\r
-\r
-Abstract:\r
+**/\r
 \r
-  EFI PEI Core Boot Mode services\r
+#include "PeiMain.h"\r
 \r
+/**\r
+  This service enables PEIMs to ascertain the present value of the boot mode.\r
 \r
+  @param PeiServices            An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param BootMode               A pointer to contain the value of the boot mode.\r
 \r
-Revision History\r
+  @retval EFI_SUCCESS           The boot mode was returned successfully.\r
+  @retval EFI_INVALID_PARAMETER BootMode is NULL.\r
 \r
 **/\r
-\r
-#include <PeiMain.h>\r
-\r
 EFI_STATUS\r
 EFIAPI\r
 PeiGetBootMode (\r
-  IN CONST EFI_PEI_SERVICES  **PeiServices,\r
-  OUT EFI_BOOT_MODE          *BootMode\r
+  IN  CONST EFI_PEI_SERVICES  **PeiServices,\r
+  IN  OUT   EFI_BOOT_MODE     *BootMode\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This service enables PEIMs to ascertain the present value of the boot mode.  \r
-\r
-Arguments:\r
-\r
-  PeiServices    - The PEI core services table.\r
-  BootMode       - A pointer to contain the value of the boot mode. \r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The boot mode was returned successfully.\r
-  EFI_INVALID_PARAMETER - BootMode is NULL.\r
-\r
---*/\r
 {\r
-  PEI_CORE_INSTANCE                    *PrivateData;    \r
-  EFI_HOB_HANDOFF_INFO_TABLE    *HandOffHob;\r
-\r
+  PEI_CORE_INSTANCE           *PrivateData;\r
+  EFI_HOB_HANDOFF_INFO_TABLE  *HandOffHob;\r
 \r
   if (BootMode == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r
-  \r
-  HandOffHob  = (PrivateData->HobList.HandoffInformationTable);\r
-  \r
-  *BootMode   = HandOffHob->BootMode;\r
-  \r
+  PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
+\r
+  HandOffHob = (PrivateData->HobList.HandoffInformationTable);\r
 \r
-  return EFI_SUCCESS;   \r
+  *BootMode = HandOffHob->BootMode;\r
+\r
+  return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  This service enables PEIMs to update the boot mode variable.\r
+\r
+\r
+  @param PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param BootMode         The value of the boot mode to set.\r
+\r
+  @return EFI_SUCCESS     The value was successfully updated\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiSetBootMode (\r
   IN CONST EFI_PEI_SERVICES  **PeiServices,\r
   IN EFI_BOOT_MODE           BootMode\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This service enables PEIMs to update the boot mode variable.    \r
-\r
-Arguments:\r
-\r
-  PeiServices    - The PEI core services table.\r
-  BootMode       - The value of the boot mode to set.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS    - The value was successfully updated\r
-\r
---*/\r
 {\r
-  PEI_CORE_INSTANCE                    *PrivateData;    \r
-  EFI_HOB_HANDOFF_INFO_TABLE    *HandOffHob;\r
+  PEI_CORE_INSTANCE           *PrivateData;\r
+  EFI_HOB_HANDOFF_INFO_TABLE  *HandOffHob;\r
 \r
+  PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
 \r
-  PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r
-  \r
-  HandOffHob  = (PrivateData->HobList.HandoffInformationTable);\r
-  \r
-  HandOffHob->BootMode = BootMode;\r
+  HandOffHob = (PrivateData->HobList.HandoffInformationTable);\r
 \r
+  HandOffHob->BootMode = BootMode;\r
 \r
-  return EFI_SUCCESS;   \r
+  return EFI_SUCCESS;\r
 }\r