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
15 #include <Library/BaseLib.h>
16 #include <Library/IoLib.h>
17 #include <Library/EfiResetSystemLib.h>
20 Resets the entire platform.
22 @param ResetType The type of reset to perform.
23 @param ResetStatus The status code for the reset.
24 @param DataSize The size, in bytes, of WatchdogData.
25 @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
26 EfiResetShutdown the data buffer starts with a Null-terminated
27 Unicode string, optionally followed by additional binary data.
33 IN EFI_RESET_TYPE ResetType
,
34 IN EFI_STATUS ResetStatus
,
36 IN CHAR16
*ResetData OPTIONAL
46 // Example using IoLib functions to do IO.
48 Data
= MmioRead8 (Address
);
49 MmioWrite8 (Address
, Data
| 0x01);
51 // Note this is a bad example asa MmioOr8 (Address, 0x01) does the same thing
55 // not a full power cycle, maybe memory stays around.
56 // if not support do the same thing as EfiResetCold.
59 case EfiResetShutdown
:
60 // turn off the system.
61 // if not support do the same thing as EfiResetCold.
65 return EFI_INVALID_PARAMETER
;
69 // If we reset, we would not have returned...
71 return EFI_DEVICE_ERROR
;
75 Initialize any infrastructure required for LibResetSystem () to function.
77 @param ImageHandle The firmware allocated handle for the EFI image.
78 @param SystemTable A pointer to the EFI System Table.
80 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
85 LibInitializeResetSystem (
86 IN EFI_HANDLE ImageHandle
,
87 IN EFI_SYSTEM_TABLE
*SystemTable