2 Pei Core Reset System Support
4 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
13 Core version of the Reset System
16 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
18 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.
19 @retval EFI_DEVICE_ERROR Did not reset system.
20 Otherwise, resets the system.
26 IN CONST EFI_PEI_SERVICES
**PeiServices
30 EFI_PEI_RESET_PPI
*ResetPpi
;
33 // Attempt to use newer ResetSystem2(). If this returns, then ResetSystem2()
36 PeiResetSystem2 (EfiResetCold
, EFI_SUCCESS
, 0, NULL
);
39 // Look for PEI Reset System PPI
41 Status
= PeiServicesLocatePpi (
47 if (!EFI_ERROR (Status
)) {
48 return ResetPpi
->ResetSystem (PeiServices
);
52 // Report Status Code that Reset PPI is not available.
55 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
56 (EFI_SOFTWARE_PEI_CORE
| EFI_SW_PS_EC_RESET_NOT_AVAILABLE
)
60 // No reset PPIs are available yet.
62 return EFI_NOT_AVAILABLE_YET
;
66 Resets the entire platform.
68 @param[in] ResetType The type of reset to perform.
69 @param[in] ResetStatus The status code for the reset.
70 @param[in] DataSize The size, in bytes, of ResetData.
71 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown
72 the data buffer starts with a Null-terminated string, optionally
73 followed by additional binary data. The string is a description
74 that the caller may use to further indicate the reason for the
81 IN EFI_RESET_TYPE ResetType
,
82 IN EFI_STATUS ResetStatus
,
84 IN VOID
*ResetData OPTIONAL
88 EFI_PEI_RESET2_PPI
*Reset2Ppi
;
91 // Look for PEI Reset System 2 PPI
93 Status
= PeiServicesLocatePpi (
94 &gEfiPeiReset2PpiGuid
,
99 if (!EFI_ERROR (Status
)) {
100 Reset2Ppi
->ResetSystem (ResetType
, ResetStatus
, DataSize
, ResetData
);
105 // Report Status Code that Reset2 PPI is not available.
108 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
109 (EFI_SOFTWARE_PEI_CORE
| EFI_SW_PS_EC_RESET_NOT_AVAILABLE
)