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 |
ebeffc42 |
58 | CpuDeadLoop ();\r |
1fde2f61 |
59 | break;\r |
60 | }\r |
61 | \r |
62 | // If the reset didn't work, return an error.\r |
63 | ASSERT (FALSE);\r |
64 | return EFI_DEVICE_ERROR;\r |
65 | }\r |
66 | \r |
67 | \r |
68 | \r |
69 | /**\r |
70 | Initialize any infrastructure required for LibResetSystem () to function.\r |
71 | \r |
72 | @param ImageHandle The firmware allocated handle for the EFI image.\r |
73 | @param SystemTable A pointer to the EFI System Table.\r |
74 | \r |
75 | @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r |
76 | \r |
77 | **/\r |
78 | EFI_STATUS\r |
79 | EFIAPI\r |
80 | LibInitializeResetSystem (\r |
81 | IN EFI_HANDLE ImageHandle,\r |
82 | IN EFI_SYSTEM_TABLE *SystemTable\r |
83 | )\r |
84 | {\r |
85 | return EFI_SUCCESS;\r |
86 | }\r |
87 | \r |