]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | \r | |
3 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
4 | \r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _RESET_SYSTEM_H_\r | |
16 | #define _RESET_SYSTEM_H_\r | |
17 | \r | |
18 | \r | |
19 | #include <PiDxe.h>\r | |
20 | \r | |
21 | #include <Protocol/Reset.h>\r | |
22 | #include <Protocol/ResetNotification.h>\r | |
23 | #include <Protocol/PlatformSpecificResetFilter.h>\r | |
24 | #include <Protocol/PlatformSpecificResetHandler.h>\r | |
25 | #include <Guid/CapsuleVendor.h>\r | |
26 | \r | |
27 | #include <Library/BaseLib.h>\r | |
28 | #include <Library/DebugLib.h>\r | |
29 | #include <Library/UefiLib.h>\r | |
30 | #include <Library/UefiDriverEntryPoint.h>\r | |
31 | #include <Library/UefiBootServicesTableLib.h>\r | |
32 | #include <Library/UefiRuntimeLib.h>\r | |
33 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
34 | #include <Library/ResetSystemLib.h>\r | |
35 | #include <Library/ReportStatusCodeLib.h>\r | |
36 | #include <Library/MemoryAllocationLib.h>\r | |
37 | \r | |
38 | //\r | |
39 | // The maximum recurstion depth to ResetSystem() by reset notification handlers\r | |
40 | //\r | |
41 | #define MAX_RESET_NOTIFY_DEPTH 10\r | |
42 | \r | |
43 | typedef struct {\r | |
44 | UINT32 Signature;\r | |
45 | LIST_ENTRY Link;\r | |
46 | EFI_RESET_SYSTEM ResetNotify;\r | |
47 | } RESET_NOTIFY_ENTRY;\r | |
48 | #define RESET_NOTIFY_ENTRY_SIGNATURE SIGNATURE_32('r', 's', 't', 'n')\r | |
49 | #define RESET_NOTIFY_ENTRY_FROM_LINK(a) CR (a, RESET_NOTIFY_ENTRY, Link, RESET_NOTIFY_ENTRY_SIGNATURE)\r | |
50 | \r | |
51 | typedef struct {\r | |
52 | UINT32 Signature;\r | |
53 | EFI_RESET_NOTIFICATION_PROTOCOL ResetNotification;\r | |
54 | LIST_ENTRY ResetNotifies;\r | |
55 | } RESET_NOTIFICATION_INSTANCE;\r | |
56 | #define RESET_NOTIFICATION_INSTANCE_SIGNATURE SIGNATURE_32('r', 's', 't', 'i')\r | |
57 | #define RESET_NOTIFICATION_INSTANCE_FROM_THIS(a) \\r | |
58 | CR (a, RESET_NOTIFICATION_INSTANCE, ResetNotification, RESET_NOTIFICATION_INSTANCE_SIGNATURE)\r | |
59 | \r | |
60 | /**\r | |
61 | The driver's entry point.\r | |
62 | \r | |
63 | It initializes the Reset Architectural Protocol.\r | |
64 | \r | |
65 | @param[in] ImageHandle The firmware allocated handle for the EFI image.\r | |
66 | @param[in] SystemTable A pointer to the EFI System Table.\r | |
67 | \r | |
68 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
69 | @retval other Cannot install ResetArch protocol.\r | |
70 | \r | |
71 | **/\r | |
72 | EFI_STATUS\r | |
73 | EFIAPI\r | |
74 | InitializeResetSystem (\r | |
75 | IN EFI_HANDLE ImageHandle,\r | |
76 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
77 | );\r | |
78 | \r | |
79 | /**\r | |
80 | Resets the entire platform.\r | |
81 | \r | |
82 | @param[in] ResetType The type of reset to perform.\r | |
83 | @param[in] ResetStatus The status code for the reset.\r | |
84 | @param[in] DataSize The size, in bytes, of ResetData.\r | |
85 | @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r | |
86 | EfiResetShutdown the data buffer starts with a Null-terminated\r | |
87 | string, optionally followed by additional binary data.\r | |
88 | The string is a description that the caller may use to further\r | |
89 | indicate the reason for the system reset. ResetData is only\r | |
90 | valid if ResetStatus is something other than EFI_SUCCESS\r | |
91 | unless the ResetType is EfiResetPlatformSpecific\r | |
92 | where a minimum amount of ResetData is always required.\r | |
93 | For a ResetType of EfiResetPlatformSpecific the data buffer\r | |
94 | also starts with a Null-terminated string that is followed\r | |
95 | by an EFI_GUID that describes the specific type of reset to perform.\r | |
96 | \r | |
97 | **/\r | |
98 | VOID\r | |
99 | EFIAPI\r | |
100 | ResetSystem (\r | |
101 | IN EFI_RESET_TYPE ResetType,\r | |
102 | IN EFI_STATUS ResetStatus,\r | |
103 | IN UINTN DataSize,\r | |
104 | IN VOID *ResetData OPTIONAL\r | |
105 | );\r | |
106 | \r | |
107 | #endif\r |