]> git.proxmox.com Git - mirror_edk2.git/blame - EmbeddedPkg/ResetRuntimeDxe/reset.c
OvmfPkg/QemuVideoDxe: Bypass NULL pointer detection during VBE SHIM installing
[mirror_edk2.git] / EmbeddedPkg / ResetRuntimeDxe / reset.c
CommitLineData
2ef2b01e
A
1/** @file\r
2\r
60274cca 3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
3402aac7 4\r
60274cca 5 This program and the accompanying materials\r
2ef2b01e
A
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#include <PiDxe.h>\r
16#include <Protocol/Reset.h>\r
17#include <Library/DebugLib.h>\r
18#include <Library/UefiDriverEntryPoint.h>\r
19#include <Library/UefiBootServicesTableLib.h>\r
20#include <Library/EfiResetSystemLib.h>\r
21\r
22\r
23/**\r
24 Resets the entire platform.\r
25\r
26 @param ResetType The type of reset to perform.\r
27 @param ResetStatus The status code for the reset.\r
28 @param DataSize The size, in bytes, of WatchdogData.\r
29 @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r
30 EfiResetShutdown the data buffer starts with a Null-terminated\r
31 Unicode string, optionally followed by additional binary data.\r
32\r
33**/\r
34VOID\r
35EFIAPI\r
36ResetSystemViaLib (\r
37 IN EFI_RESET_TYPE ResetType,\r
38 IN EFI_STATUS ResetStatus,\r
39 IN UINTN DataSize,\r
40 IN VOID *ResetData OPTIONAL\r
41 )\r
42{\r
43 LibResetSystem (ResetType, ResetStatus, DataSize, ResetData);\r
44 return;\r
45}\r
46\r
47\r
48\r
49EFI_STATUS\r
50EFIAPI\r
51InitializeReset (\r
52 IN EFI_HANDLE ImageHandle,\r
53 IN EFI_SYSTEM_TABLE *SystemTable\r
54 )\r
55{\r
56 EFI_STATUS Status;\r
57 EFI_HANDLE Handle;\r
58\r
59 LibInitializeResetSystem (ImageHandle, SystemTable);\r
3402aac7 60\r
2ef2b01e
A
61 SystemTable->RuntimeServices->ResetSystem = ResetSystemViaLib;\r
62\r
63 Handle = NULL;\r
64 Status = gBS->InstallMultipleProtocolInterfaces (\r
65 &Handle,\r
66 &gEfiResetArchProtocolGuid,\r
67 NULL,\r
68 NULL\r
69 );\r
70 ASSERT_EFI_ERROR (Status);\r
71\r
72 return Status;\r
73}\r
74\r