]>
Commit | Line | Data |
---|---|---|
51a0c5f2 | 1 | /** @file\r |
2 | \r | |
e2531da3 | 3 | Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r |
51a0c5f2 | 4 | \r |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
51a0c5f2 | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _RESET_SYSTEM_H_\r | |
10 | #define _RESET_SYSTEM_H_\r | |
11 | \r | |
51a0c5f2 | 12 | #include <PiDxe.h>\r |
13 | \r | |
14 | #include <Protocol/Reset.h>\r | |
cf6da556 | 15 | #include <Protocol/ResetNotification.h>\r |
99a6529e MK |
16 | #include <Protocol/PlatformSpecificResetFilter.h>\r |
17 | #include <Protocol/PlatformSpecificResetHandler.h>\r | |
51a0c5f2 | 18 | #include <Guid/CapsuleVendor.h>\r |
19 | \r | |
20 | #include <Library/BaseLib.h>\r | |
21 | #include <Library/DebugLib.h>\r | |
22 | #include <Library/UefiLib.h>\r | |
51a0c5f2 | 23 | #include <Library/UefiDriverEntryPoint.h>\r |
24 | #include <Library/UefiBootServicesTableLib.h>\r | |
25 | #include <Library/UefiRuntimeLib.h>\r | |
26 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
27 | #include <Library/ResetSystemLib.h>\r | |
37623a5c | 28 | #include <Library/ReportStatusCodeLib.h>\r |
cf6da556 RN |
29 | #include <Library/MemoryAllocationLib.h>\r |
30 | \r | |
99a6529e MK |
31 | //\r |
32 | // The maximum recurstion depth to ResetSystem() by reset notification handlers\r | |
33 | //\r | |
1436aea4 | 34 | #define MAX_RESET_NOTIFY_DEPTH 10\r |
99a6529e | 35 | \r |
cf6da556 | 36 | typedef struct {\r |
1436aea4 MK |
37 | UINT32 Signature;\r |
38 | LIST_ENTRY Link;\r | |
39 | EFI_RESET_SYSTEM ResetNotify;\r | |
cf6da556 | 40 | } RESET_NOTIFY_ENTRY;\r |
1436aea4 MK |
41 | #define RESET_NOTIFY_ENTRY_SIGNATURE SIGNATURE_32('r', 's', 't', 'n')\r |
42 | #define RESET_NOTIFY_ENTRY_FROM_LINK(a) CR (a, RESET_NOTIFY_ENTRY, Link, RESET_NOTIFY_ENTRY_SIGNATURE)\r | |
cf6da556 RN |
43 | \r |
44 | typedef struct {\r | |
1436aea4 MK |
45 | UINT32 Signature;\r |
46 | EFI_RESET_NOTIFICATION_PROTOCOL ResetNotification;\r | |
47 | LIST_ENTRY ResetNotifies;\r | |
cf6da556 | 48 | } RESET_NOTIFICATION_INSTANCE;\r |
1436aea4 | 49 | #define RESET_NOTIFICATION_INSTANCE_SIGNATURE SIGNATURE_32('r', 's', 't', 'i')\r |
cf6da556 RN |
50 | #define RESET_NOTIFICATION_INSTANCE_FROM_THIS(a) \\r |
51 | CR (a, RESET_NOTIFICATION_INSTANCE, ResetNotification, RESET_NOTIFICATION_INSTANCE_SIGNATURE)\r | |
51a0c5f2 | 52 | \r |
53 | /**\r | |
54 | The driver's entry point.\r | |
55 | \r | |
56 | It initializes the Reset Architectural Protocol.\r | |
57 | \r | |
d1102dba | 58 | @param[in] ImageHandle The firmware allocated handle for the EFI image.\r |
51a0c5f2 | 59 | @param[in] SystemTable A pointer to the EFI System Table.\r |
d1102dba | 60 | \r |
51a0c5f2 | 61 | @retval EFI_SUCCESS The entry point is executed successfully.\r |
62 | @retval other Cannot install ResetArch protocol.\r | |
63 | \r | |
64 | **/\r | |
65 | EFI_STATUS\r | |
66 | EFIAPI\r | |
67 | InitializeResetSystem (\r | |
68 | IN EFI_HANDLE ImageHandle,\r | |
69 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
70 | );\r | |
71 | \r | |
72 | /**\r | |
73 | Resets the entire platform.\r | |
74 | \r | |
75 | @param[in] ResetType The type of reset to perform.\r | |
76 | @param[in] ResetStatus The status code for the reset.\r | |
eeeabe40 | 77 | @param[in] DataSize The size, in bytes, of ResetData.\r |
51a0c5f2 | 78 | @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r |
79 | EfiResetShutdown the data buffer starts with a Null-terminated\r | |
80 | string, optionally followed by additional binary data.\r | |
eeeabe40 | 81 | The string is a description that the caller may use to further\r |
f69cb108 | 82 | indicate the reason for the system reset.\r |
eeeabe40 SZ |
83 | For a ResetType of EfiResetPlatformSpecific the data buffer\r |
84 | also starts with a Null-terminated string that is followed\r | |
85 | by an EFI_GUID that describes the specific type of reset to perform.\r | |
51a0c5f2 | 86 | \r |
87 | **/\r | |
88 | VOID\r | |
89 | EFIAPI\r | |
e2531da3 | 90 | RuntimeServiceResetSystem (\r |
1436aea4 MK |
91 | IN EFI_RESET_TYPE ResetType,\r |
92 | IN EFI_STATUS ResetStatus,\r | |
93 | IN UINTN DataSize,\r | |
94 | IN VOID *ResetData OPTIONAL\r | |
51a0c5f2 | 95 | );\r |
96 | \r | |
51a0c5f2 | 97 | #endif\r |