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