]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Reset/Reset.c
MdeModulePkg PeiCore: Correct the comments of PeiResetSystem2
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Reset / Reset.c
index 793244b3916032e19f6ba441a201680b6b212136..7440eefd78461c163ca16c38e31abd2fe94e99e5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pei Core Reset System Support\r
   \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -58,3 +58,51 @@ PeiResetSystem (
   return  EFI_NOT_AVAILABLE_YET;\r
 }\r
 \r
+/**\r
+  Resets the entire platform.\r
+\r
+  @param[in] ResetType      The type of reset to perform.\r
+  @param[in] ResetStatus    The status code for the reset.\r
+  @param[in] DataSize       The size, in bytes, of ResetData.\r
+  @param[in] ResetData      For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown\r
+                            the data buffer starts with a Null-terminated string, optionally\r
+                            followed by additional binary data. The string is a description\r
+                            that the caller may use to further indicate the reason for the\r
+                            system reset. ResetData is only valid if ResetStatus is something\r
+                            other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific\r
+                            where a minimum amount of ResetData is always required.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PeiResetSystem2 (\r
+  IN EFI_RESET_TYPE     ResetType,\r
+  IN EFI_STATUS         ResetStatus,\r
+  IN UINTN              DataSize,\r
+  IN VOID               *ResetData OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS            Status;\r
+  EFI_PEI_RESET2_PPI    *Reset2Ppi;\r
+\r
+  Status = PeiServicesLocatePpi (\r
+             &gEfiPeiReset2PpiGuid,\r
+             0,\r
+             NULL,\r
+             (VOID **)&Reset2Ppi\r
+             );\r
+\r
+  if (!EFI_ERROR (Status)) {\r
+    Reset2Ppi->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);\r
+    return;\r
+  }\r
+\r
+  //\r
+  // Report Status Code that Reset2 PPI is not available.\r
+  //\r
+  REPORT_STATUS_CODE (\r
+    EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+    (EFI_SOFTWARE_PEI_CORE | EFI_SW_PS_EC_RESET_NOT_AVAILABLE)\r
+    );\r
+}\r
+\r