]>
Commit | Line | Data |
---|---|---|
1fde2f61 | 1 | /** @file\r |
2 | Template library implementation to support ResetSystem Runtime call.\r | |
3 | \r | |
4 | Fill in the templates with what ever makes you system reset.\r | |
5 | \r | |
6 | \r | |
cf748a1a | 7 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r |
1fde2f61 | 8 | \r |
cf748a1a | 9 | This program and the accompanying materials\r |
1fde2f61 | 10 | are licensed and made available under the terms and conditions of the BSD License\r |
11 | which accompanies this distribution. The full text of the license may be found at\r | |
12 | http://opensource.org/licenses/bsd-license.php\r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
16 | \r | |
17 | **/\r | |
18 | \r | |
19 | \r | |
20 | #include <PiDxe.h>\r | |
21 | \r | |
22 | #include <Library/PcdLib.h>\r | |
1fde2f61 | 23 | #include <Library/DebugLib.h>\r |
24 | #include <Library/EfiResetSystemLib.h>\r | |
25 | \r | |
b76848cb | 26 | #include <ArmEb/ArmEb.h>\r |
1fde2f61 | 27 | \r |
28 | /**\r | |
29 | Resets the entire platform.\r | |
30 | \r | |
31 | @param ResetType The type of reset to perform.\r | |
32 | @param ResetStatus The status code for the reset.\r | |
33 | @param DataSize The size, in bytes, of WatchdogData.\r | |
34 | @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r | |
35 | EfiResetShutdown the data buffer starts with a Null-terminated\r | |
36 | Unicode string, optionally followed by additional binary data.\r | |
37 | \r | |
38 | **/\r | |
39 | EFI_STATUS\r | |
40 | EFIAPI\r | |
41 | LibResetSystem (\r | |
42 | IN EFI_RESET_TYPE ResetType,\r | |
43 | IN EFI_STATUS ResetStatus,\r | |
44 | IN UINTN DataSize,\r | |
45 | IN CHAR16 *ResetData OPTIONAL\r | |
46 | )\r | |
47 | {\r | |
48 | if (ResetData != NULL) {\r | |
49 | DEBUG ((EFI_D_ERROR, "%s", ResetData));\r | |
50 | }\r | |
51 | \r | |
52 | switch (ResetType) {\r | |
53 | case EfiResetWarm:\r | |
54 | // Map a warm reset into a cold reset\r | |
55 | case EfiResetCold:\r | |
56 | case EfiResetShutdown:\r | |
57 | default:\r | |
58 | break;\r | |
59 | }\r | |
60 | \r | |
61 | // If the reset didn't work, return an error.\r | |
62 | ASSERT (FALSE);\r | |
63 | return EFI_DEVICE_ERROR;\r | |
64 | }\r | |
65 | \r | |
66 | \r | |
67 | \r | |
68 | /**\r | |
69 | Initialize any infrastructure required for LibResetSystem () to function.\r | |
70 | \r | |
71 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
72 | @param SystemTable A pointer to the EFI System Table.\r | |
73 | \r | |
74 | @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r | |
75 | \r | |
76 | **/\r | |
77 | EFI_STATUS\r | |
78 | EFIAPI\r | |
79 | LibInitializeResetSystem (\r | |
80 | IN EFI_HANDLE ImageHandle,\r | |
81 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
82 | )\r | |
83 | {\r | |
84 | return EFI_SUCCESS;\r | |
85 | }\r | |
86 | \r |