TianoCore EDK2 master
Loading...
Searching...
No Matches
ResetSystem.c File Reference
#include "ResetSystem.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI RegisterResetNotify (IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI *This, IN EFI_RESET_SYSTEM ResetFunction)
 
EFI_STATUS EFIAPI UnregisterResetNotify (IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI *This, IN EFI_RESET_SYSTEM ResetFunction)
 
EFI_STATUS EFIAPI InitializeResetSystem (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
 
VOID EFIAPI ResetSystem2 (IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 * mResetTypeStr []
 
EFI_PEI_RESET2_PPI mPpiReset2
 
EFI_GUIDmProcessingOrder []
 
RESET_FILTER_INSTANCE mResetFilter
 
RESET_FILTER_INSTANCE mResetNotification
 
RESET_FILTER_INSTANCE mResetHandler
 
EFI_PEI_PPI_DESCRIPTOR mPpiListReset []
 

Detailed Description

Implementation of Reset2, ResetFilter and ResetHandler PPIs.

Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file ResetSystem.c.

Function Documentation

◆ InitializeResetSystem()

EFI_STATUS EFIAPI InitializeResetSystem ( IN EFI_PEI_FILE_HANDLE  FileHandle,
IN CONST EFI_PEI_SERVICES **  PeiServices 
)

The PEIM's entry point.

It initializes the Reset2, ResetFilter and ResetHandler PPIs.

Parameters
[in]FileHandleHandle of the file being invoked.
[in]PeiServicesDescribes the list of possible PEI Services.
Return values
EFI_SUCCESSThe entry point is executed successfully.
EFI_ALREADY_STARTEDThe Reset2 PPI was already installed.
othersStatus code returned from PeiServicesInstallPpi().

Definition at line 243 of file ResetSystem.c.

◆ RegisterResetNotify()

EFI_STATUS EFIAPI RegisterResetNotify ( IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI This,
IN EFI_RESET_SYSTEM  ResetFunction 
)

Register a notification function to be called when ResetSystem() is called.

The RegisterResetNotify() function registers a notification function that is called when ResetSystem() is called and prior to completing the reset of the platform. The registered functions must not perform a platform reset themselves. These notifications are intended only for the notification of components which may need some special-purpose maintenance prior to the platform resetting. The list of registered reset notification functions are processed if ResetSystem()is called before ExitBootServices(). The list of registered reset notification functions is ignored if ResetSystem() is called after ExitBootServices().

Parameters
[in]ThisA pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.
[in]ResetFunctionPoints to the function to be called when a ResetSystem() is executed.
Return values
EFI_SUCCESSThe reset notification function was successfully registered.
EFI_INVALID_PARAMETERResetFunction is NULL.
EFI_OUT_OF_RESOURCESThere are not enough resources available to register the reset notification function.
EFI_ALREADY_STARTEDThe reset notification function specified by ResetFunction has already been registered.

Definition at line 96 of file ResetSystem.c.

◆ ResetSystem2()

VOID EFIAPI ResetSystem2 ( IN EFI_RESET_TYPE  ResetType,
IN EFI_STATUS  ResetStatus,
IN UINTN  DataSize,
IN VOID *ResetData  OPTIONAL 
)

Resets the entire platform.

Parameters
[in]ResetTypeThe type of reset to perform.
[in]ResetStatusThe status code for the reset.
[in]DataSizeThe size, in bytes, of ResetData.
[in]ResetDataFor 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. For a ResetType of EfiResetPlatformSpecific the data buffer also starts with a Null-terminated string that is followed by an EFI_GUID that describes the specific type of reset to perform.

Definition at line 278 of file ResetSystem.c.

◆ UnregisterResetNotify()

EFI_STATUS EFIAPI UnregisterResetNotify ( IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI This,
IN EFI_RESET_SYSTEM  ResetFunction 
)

Unregister a notification function.

The UnregisterResetNotify() function removes the previously registered notification using RegisterResetNotify().

Parameters
[in]ThisA pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.
[in]ResetFunctionThe pointer to the ResetFunction being unregistered.
Return values
EFI_SUCCESSThe reset notification function was unregistered.
EFI_INVALID_PARAMETERResetFunction is NULL.
EFI_INVALID_PARAMETERThe reset notification function specified by ResetFunction was not previously registered using RegisterResetNotify().

Definition at line 186 of file ResetSystem.c.

Variable Documentation

◆ mPpiListReset

EFI_PEI_PPI_DESCRIPTOR mPpiListReset[]
Initial value:
= {
{
EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEfiPeiReset2PpiGuid,
&mPpiReset2
},
{
EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEdkiiPlatformSpecificResetFilterPpiGuid,
&mResetFilter.ResetFilter
},
{
EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEdkiiPlatformSpecificResetNotificationPpiGuid,
&mResetNotification.ResetFilter
},
{
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
&gEdkiiPlatformSpecificResetHandlerPpiGuid,
&mResetHandler.ResetFilter
}
}

Definition at line 50 of file ResetSystem.c.

◆ mPpiReset2

EFI_PEI_RESET2_PPI mPpiReset2
Initial value:
= {
}
VOID EFIAPI ResetSystem2(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
Definition: ResetSystem.c:278

Definition at line 16 of file ResetSystem.c.

◆ mProcessingOrder

EFI_GUID* mProcessingOrder[]
Initial value:
= {
&gEdkiiPlatformSpecificResetFilterPpiGuid,
&gEdkiiPlatformSpecificResetNotificationPpiGuid,
&gEdkiiPlatformSpecificResetHandlerPpiGuid
}

Definition at line 20 of file ResetSystem.c.

◆ mResetFilter

RESET_FILTER_INSTANCE mResetFilter
Initial value:
= {
{
},
&gEdkiiPlatformSpecificResetFilterPpiGuid
}
EFI_STATUS EFIAPI RegisterResetNotify(IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI *This, IN EFI_RESET_SYSTEM ResetFunction)
Definition: ResetSystem.c:96
EFI_STATUS EFIAPI UnregisterResetNotify(IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI *This, IN EFI_RESET_SYSTEM ResetFunction)
Definition: ResetSystem.c:186

Definition at line 26 of file ResetSystem.c.

◆ mResetHandler

RESET_FILTER_INSTANCE mResetHandler
Initial value:
= {
{
},
&gEdkiiPlatformSpecificResetHandlerPpiGuid
}

Definition at line 42 of file ResetSystem.c.

◆ mResetNotification

RESET_FILTER_INSTANCE mResetNotification
Initial value:
= {
{
},
&gEdkiiPlatformSpecificResetNotificationPpiGuid
}

Definition at line 34 of file ResetSystem.c.

◆ mResetTypeStr

GLOBAL_REMOVE_IF_UNREFERENCED CHAR16* mResetTypeStr[]
Initial value:
= {
L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific"
}

Definition at line 12 of file ResetSystem.c.