ArmPkg: only attempt buildin MmCommunicationDxe for AArch64
[mirror_edk2.git] / EmbeddedPkg / ResetRuntimeDxe / reset.c
... / ...
CommitLineData
1/** @file\r
2\r
3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
4\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#include <PiDxe.h>\r
10#include <Protocol/Reset.h>\r
11#include <Library/DebugLib.h>\r
12#include <Library/UefiDriverEntryPoint.h>\r
13#include <Library/UefiBootServicesTableLib.h>\r
14#include <Library/EfiResetSystemLib.h>\r
15\r
16\r
17/**\r
18 Resets the entire platform.\r
19\r
20 @param ResetType The type of reset to perform.\r
21 @param ResetStatus The status code for the reset.\r
22 @param DataSize The size, in bytes, of WatchdogData.\r
23 @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r
24 EfiResetShutdown the data buffer starts with a Null-terminated\r
25 Unicode string, optionally followed by additional binary data.\r
26\r
27**/\r
28VOID\r
29EFIAPI\r
30ResetSystemViaLib (\r
31 IN EFI_RESET_TYPE ResetType,\r
32 IN EFI_STATUS ResetStatus,\r
33 IN UINTN DataSize,\r
34 IN VOID *ResetData OPTIONAL\r
35 )\r
36{\r
37 LibResetSystem (ResetType, ResetStatus, DataSize, ResetData);\r
38 return;\r
39}\r
40\r
41\r
42\r
43EFI_STATUS\r
44EFIAPI\r
45InitializeReset (\r
46 IN EFI_HANDLE ImageHandle,\r
47 IN EFI_SYSTEM_TABLE *SystemTable\r
48 )\r
49{\r
50 EFI_STATUS Status;\r
51 EFI_HANDLE Handle;\r
52\r
53 LibInitializeResetSystem (ImageHandle, SystemTable);\r
54\r
55 SystemTable->RuntimeServices->ResetSystem = ResetSystemViaLib;\r
56\r
57 Handle = NULL;\r
58 Status = gBS->InstallMultipleProtocolInterfaces (\r
59 &Handle,\r
60 &gEfiResetArchProtocolGuid,\r
61 NULL,\r
62 NULL\r
63 );\r
64 ASSERT_EFI_ERROR (Status);\r
65\r
66 return Status;\r
67}\r
68\r