]>
Commit | Line | Data |
---|---|---|
1e57a462 | 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 | |
7 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r | |
8 | \r | |
9 | This program and the accompanying materials\r | |
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 | #include <PiDxe.h>\r | |
20 | \r | |
21 | #include <Library/BaseLib.h>\r | |
22 | #include <Library/DebugLib.h>\r | |
23 | #include <Library/EfiResetSystemLib.h>\r | |
24 | #include <Library/ArmPlatformSysConfigLib.h>\r | |
25 | \r | |
26 | #include <ArmPlatform.h>\r | |
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 | switch (ResetType) {\r | |
49 | case EfiResetWarm:\r | |
50 | // Map a warm reset into a cold reset\r | |
51 | case EfiResetCold:\r | |
52 | case EfiResetShutdown:\r | |
53 | // Send the REBOOT function to the platform microcontroller\r | |
54 | ArmPlatformSysConfigSet (SYS_CFG_REBOOT, 0);\r | |
55 | \r | |
56 | // We should never be here\r | |
57 | while(1);\r | |
58 | }\r | |
59 | \r | |
60 | ASSERT(FALSE);\r | |
61 | return EFI_UNSUPPORTED;\r | |
62 | }\r | |
63 | \r | |
64 | /**\r | |
65 | Initialize any infrastructure required for LibResetSystem () to function.\r | |
66 | \r | |
67 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
68 | @param SystemTable A pointer to the EFI System Table.\r | |
69 | \r | |
70 | @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r | |
71 | \r | |
72 | **/\r | |
73 | EFI_STATUS\r | |
74 | EFIAPI\r | |
75 | LibInitializeResetSystem (\r | |
76 | IN EFI_HANDLE ImageHandle,\r | |
77 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
78 | )\r | |
79 | {\r | |
80 | return EFI_SUCCESS;\r | |
81 | }\r |