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_
14 #include <Protocol/Reset.h>
15 #include <Protocol/ResetNotification.h>
16 #include <Protocol/PlatformSpecificResetFilter.h>
17 #include <Protocol/PlatformSpecificResetHandler.h>
18 #include <Guid/CapsuleVendor.h>
20 #include <Library/BaseLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/UefiLib.h>
23 #include <Library/UefiDriverEntryPoint.h>
24 #include <Library/UefiBootServicesTableLib.h>
25 #include <Library/UefiRuntimeLib.h>
26 #include <Library/UefiRuntimeServicesTableLib.h>
27 #include <Library/ResetSystemLib.h>
28 #include <Library/ReportStatusCodeLib.h>
29 #include <Library/MemoryAllocationLib.h>
32 // The maximum recurstion depth to ResetSystem() by reset notification handlers
34 #define MAX_RESET_NOTIFY_DEPTH 10
39 EFI_RESET_SYSTEM ResetNotify
;
41 #define RESET_NOTIFY_ENTRY_SIGNATURE SIGNATURE_32('r', 's', 't', 'n')
42 #define RESET_NOTIFY_ENTRY_FROM_LINK(a) CR (a, RESET_NOTIFY_ENTRY, Link, RESET_NOTIFY_ENTRY_SIGNATURE)
46 EFI_RESET_NOTIFICATION_PROTOCOL ResetNotification
;
47 LIST_ENTRY ResetNotifies
;
48 } RESET_NOTIFICATION_INSTANCE
;
49 #define RESET_NOTIFICATION_INSTANCE_SIGNATURE SIGNATURE_32('r', 's', 't', 'i')
50 #define RESET_NOTIFICATION_INSTANCE_FROM_THIS(a) \
51 CR (a, RESET_NOTIFICATION_INSTANCE, ResetNotification, RESET_NOTIFICATION_INSTANCE_SIGNATURE)
54 The driver's entry point.
56 It initializes the Reset Architectural Protocol.
58 @param[in] ImageHandle The firmware allocated handle for the EFI image.
59 @param[in] SystemTable A pointer to the EFI System Table.
61 @retval EFI_SUCCESS The entry point is executed successfully.
62 @retval other Cannot install ResetArch protocol.
67 InitializeResetSystem (
68 IN EFI_HANDLE ImageHandle
,
69 IN EFI_SYSTEM_TABLE
*SystemTable
73 Resets the entire platform.
75 @param[in] ResetType The type of reset to perform.
76 @param[in] ResetStatus The status code for the reset.
77 @param[in] DataSize The size, in bytes, of ResetData.
78 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
79 EfiResetShutdown the data buffer starts with a Null-terminated
80 string, optionally followed by additional binary data.
81 The string is a description that the caller may use to further
82 indicate the reason for the system reset.
83 For a ResetType of EfiResetPlatformSpecific the data buffer
84 also starts with a Null-terminated string that is followed
85 by an EFI_GUID that describes the specific type of reset to perform.
90 RuntimeServiceResetSystem (
91 IN EFI_RESET_TYPE ResetType
,
92 IN EFI_STATUS ResetStatus
,
94 IN VOID
*ResetData OPTIONAL