2009-12-06 02:57:05 +01:00
|
|
|
/** @file
|
|
|
|
|
2010-04-29 14:40:51 +02:00
|
|
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
2014-08-19 15:29:52 +02:00
|
|
|
|
2019-04-04 01:03:38 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2009-12-06 02:57:05 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#include <PiDxe.h>
|
|
|
|
#include <Protocol/Reset.h>
|
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/UefiDriverEntryPoint.h>
|
|
|
|
#include <Library/UefiBootServicesTableLib.h>
|
|
|
|
#include <Library/EfiResetSystemLib.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
Resets the entire platform.
|
|
|
|
|
|
|
|
@param ResetType The type of reset to perform.
|
|
|
|
@param ResetStatus The status code for the reset.
|
|
|
|
@param DataSize The size, in bytes, of WatchdogData.
|
|
|
|
@param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
|
|
|
|
EfiResetShutdown the data buffer starts with a Null-terminated
|
|
|
|
Unicode string, optionally followed by additional binary data.
|
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
ResetSystemViaLib (
|
|
|
|
IN EFI_RESET_TYPE ResetType,
|
|
|
|
IN EFI_STATUS ResetStatus,
|
|
|
|
IN UINTN DataSize,
|
|
|
|
IN VOID *ResetData OPTIONAL
|
|
|
|
)
|
|
|
|
{
|
|
|
|
LibResetSystem (ResetType, ResetStatus, DataSize, ResetData);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
InitializeReset (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
)
|
|
|
|
{
|
|
|
|
EFI_STATUS Status;
|
|
|
|
EFI_HANDLE Handle;
|
|
|
|
|
|
|
|
LibInitializeResetSystem (ImageHandle, SystemTable);
|
2014-08-19 15:29:52 +02:00
|
|
|
|
2009-12-06 02:57:05 +01:00
|
|
|
SystemTable->RuntimeServices->ResetSystem = ResetSystemViaLib;
|
|
|
|
|
|
|
|
Handle = NULL;
|
|
|
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
|
|
|
&Handle,
|
|
|
|
&gEfiResetArchProtocolGuid,
|
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
);
|
|
|
|
ASSERT_EFI_ERROR (Status);
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|