2 Template library implementation to support ResetSystem Runtime call.
4 Fill in the templates with what ever makes you system reset.
7 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
16 #include <Library/BaseLib.h>
17 #include <Library/IoLib.h>
18 #include <Library/EfiResetSystemLib.h>
22 Resets the entire platform.
24 @param ResetType The type of reset to perform.
25 @param ResetStatus The status code for the reset.
26 @param DataSize The size, in bytes, of WatchdogData.
27 @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
28 EfiResetShutdown the data buffer starts with a Null-terminated
29 Unicode string, optionally followed by additional binary data.
35 IN EFI_RESET_TYPE ResetType
,
36 IN EFI_STATUS ResetStatus
,
38 IN CHAR16
*ResetData OPTIONAL
49 // Example using IoLib functions to do IO.
51 Data
= MmioRead8 (Address
);
52 MmioWrite8 (Address
, Data
| 0x01);
54 // Note this is a bad example asa MmioOr8 (Address, 0x01) does the same thing
58 // not a full power cycle, maybe memory stays around.
59 // if not support do the same thing as EfiResetCold.
62 case EfiResetShutdown
:
63 // turn off the system.
64 // if not support do the same thing as EfiResetCold.
68 return EFI_INVALID_PARAMETER
;
72 // If we reset, we would not have returned...
74 return EFI_DEVICE_ERROR
;
80 Initialize any infrastructure required for LibResetSystem () to function.
82 @param ImageHandle The firmware allocated handle for the EFI image.
83 @param SystemTable A pointer to the EFI System Table.
85 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
90 LibInitializeResetSystem (
91 IN EFI_HANDLE ImageHandle
,
92 IN EFI_SYSTEM_TABLE
*SystemTable