X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FPei%2FReset%2FReset.c;h=7440eefd78461c163ca16c38e31abd2fe94e99e5;hp=0bd016b8d484bc76bf8f278fa00935ceaf8987e7;hb=c8721bb215d276269555a5dcb96342064789c505;hpb=dc857d5641883b98e4f73c9da6fb131d43962bb8 diff --git a/MdeModulePkg/Core/Pei/Reset/Reset.c b/MdeModulePkg/Core/Pei/Reset/Reset.c index 0bd016b8d4..7440eefd78 100644 --- a/MdeModulePkg/Core/Pei/Reset/Reset.c +++ b/MdeModulePkg/Core/Pei/Reset/Reset.c @@ -1,8 +1,8 @@ /** @file Pei Core Reset System Support -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+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 @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "PeiMain.h" /** @@ -48,6 +48,61 @@ PeiResetSystem ( if (!EFI_ERROR (Status)) { return ResetPpi->ResetSystem (PeiServices); } + // + // Report Status Code that Reset PPI is not available + // + REPORT_STATUS_CODE ( + EFI_ERROR_CODE | EFI_ERROR_MINOR, + (EFI_SOFTWARE_PEI_CORE | EFI_SW_PS_EC_RESET_NOT_AVAILABLE) + ); return EFI_NOT_AVAILABLE_YET; } +/** + Resets the entire platform. + + @param[in] ResetType The type of reset to perform. + @param[in] ResetStatus The status code for the reset. + @param[in] DataSize The size, in bytes, of ResetData. + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown + the data buffer starts with a Null-terminated string, optionally + followed by additional binary data. The string is a description + that the caller may use to further indicate the reason for the + system reset. ResetData is only valid if ResetStatus is something + other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific + where a minimum amount of ResetData is always required. + +**/ +VOID +EFIAPI +PeiResetSystem2 ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN UINTN DataSize, + IN VOID *ResetData OPTIONAL + ) +{ + EFI_STATUS Status; + EFI_PEI_RESET2_PPI *Reset2Ppi; + + Status = PeiServicesLocatePpi ( + &gEfiPeiReset2PpiGuid, + 0, + NULL, + (VOID **)&Reset2Ppi + ); + + if (!EFI_ERROR (Status)) { + Reset2Ppi->ResetSystem (ResetType, ResetStatus, DataSize, ResetData); + return; + } + + // + // Report Status Code that Reset2 PPI is not available. + // + REPORT_STATUS_CODE ( + EFI_ERROR_CODE | EFI_ERROR_MINOR, + (EFI_SOFTWARE_PEI_CORE | EFI_SW_PS_EC_RESET_NOT_AVAILABLE) + ); +} +