3 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _RESET_SYSTEM_H_
10 #define _RESET_SYSTEM_H_
15 #include <Protocol/Reset.h>
16 #include <Protocol/ResetNotification.h>
17 #include <Protocol/PlatformSpecificResetFilter.h>
18 #include <Protocol/PlatformSpecificResetHandler.h>
19 #include <Guid/CapsuleVendor.h>
21 #include <Library/BaseLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/UefiLib.h>
24 #include <Library/UefiDriverEntryPoint.h>
25 #include <Library/UefiBootServicesTableLib.h>
26 #include <Library/UefiRuntimeLib.h>
27 #include <Library/UefiRuntimeServicesTableLib.h>
28 #include <Library/ResetSystemLib.h>
29 #include <Library/ReportStatusCodeLib.h>
30 #include <Library/MemoryAllocationLib.h>
33 // The maximum recurstion depth to ResetSystem() by reset notification handlers
35 #define MAX_RESET_NOTIFY_DEPTH 10
40 EFI_RESET_SYSTEM ResetNotify
;
42 #define RESET_NOTIFY_ENTRY_SIGNATURE SIGNATURE_32('r', 's', 't', 'n')
43 #define RESET_NOTIFY_ENTRY_FROM_LINK(a) CR (a, RESET_NOTIFY_ENTRY, Link, RESET_NOTIFY_ENTRY_SIGNATURE)
47 EFI_RESET_NOTIFICATION_PROTOCOL ResetNotification
;
48 LIST_ENTRY ResetNotifies
;
49 } RESET_NOTIFICATION_INSTANCE
;
50 #define RESET_NOTIFICATION_INSTANCE_SIGNATURE SIGNATURE_32('r', 's', 't', 'i')
51 #define RESET_NOTIFICATION_INSTANCE_FROM_THIS(a) \
52 CR (a, RESET_NOTIFICATION_INSTANCE, ResetNotification, RESET_NOTIFICATION_INSTANCE_SIGNATURE)
55 The driver's entry point.
57 It initializes the Reset Architectural Protocol.
59 @param[in] ImageHandle The firmware allocated handle for the EFI image.
60 @param[in] SystemTable A pointer to the EFI System Table.
62 @retval EFI_SUCCESS The entry point is executed successfully.
63 @retval other Cannot install ResetArch protocol.
68 InitializeResetSystem (
69 IN EFI_HANDLE ImageHandle
,
70 IN EFI_SYSTEM_TABLE
*SystemTable
74 Resets the entire platform.
76 @param[in] ResetType The type of reset to perform.
77 @param[in] ResetStatus The status code for the reset.
78 @param[in] DataSize The size, in bytes, of ResetData.
79 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
80 EfiResetShutdown the data buffer starts with a Null-terminated
81 string, optionally followed by additional binary data.
82 The string is a description that the caller may use to further
83 indicate the reason for the system reset.
84 For a ResetType of EfiResetPlatformSpecific the data buffer
85 also starts with a Null-terminated string that is followed
86 by an EFI_GUID that describes the specific type of reset to perform.
91 RuntimeServiceResetSystem (
92 IN EFI_RESET_TYPE ResetType
,
93 IN EFI_STATUS ResetStatus
,
95 IN VOID
*ResetData OPTIONAL