]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/KbcResetDxe/Ipf/IpfReset.c
Porting Duet module from EDKI to EDKII
[mirror_edk2.git] / DuetPkg / KbcResetDxe / Ipf / IpfReset.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13 IpfReset.c
14
15 Abstract:
16
17 --*/
18
19 #include "Cf9Reset.h"
20
21 SAL_RETURN_REGS
22 ResetEsalServicesClassCommonEntry (
23 IN UINT64 FunctionId,
24 IN UINT64 Arg2,
25 IN UINT64 Arg3,
26 IN UINT64 Arg4,
27 IN UINT64 Arg5,
28 IN UINT64 Arg6,
29 IN UINT64 Arg7,
30 IN UINT64 Arg8,
31 IN SAL_EXTENDED_SAL_PROC ExtendedSalProc,
32 IN BOOLEAN VirtualMode,
33 IN VOID *Global
34 )
35 /*++
36
37 Routine Description:
38
39 Main entry for Extended SAL Reset Services
40
41 Arguments:
42
43 FunctionId Function Id which needed to be called.
44 Arg2 EFI_RESET_TYPE, whether WARM of COLD reset
45 Arg3 Last EFI_STATUS
46 Arg4 Data Size of UNICODE STRING passed in ARG5
47 Arg5 Unicode String which CHAR16*
48
49 Returns:
50
51 SAL_RETURN_REGS
52
53 --*/
54 // TODO: Arg6 - add argument and description to function comment
55 // TODO: Arg7 - add argument and description to function comment
56 // TODO: Arg8 - add argument and description to function comment
57 // TODO: ExtendedSalProc - add argument and description to function comment
58 // TODO: VirtualMode - add argument and description to function comment
59 // TODO: Global - add argument and description to function comment
60 {
61 SAL_RETURN_REGS ReturnVal;
62
63 switch (FunctionId) {
64 case ResetSystem:
65 KbcResetSystem (Arg2, Arg3, (UINTN) Arg4, (VOID *) Arg5);
66 ReturnVal.Status = EFI_SUCCESS;
67 break;
68
69 default:
70 ReturnVal.Status = EFI_SAL_INVALID_ARGUMENT;
71 break;
72 }
73
74 return ReturnVal;
75 }
76
77 EFI_STATUS
78 EFIAPI
79 InitializeReset (
80 IN EFI_HANDLE ImageHandle,
81 IN EFI_SYSTEM_TABLE *SystemTable
82 )
83 /*++
84
85 Routine Description:
86
87 Initialize the state information for the Reset Architectural Protocol
88
89 Arguments:
90
91 ImageHandle of the loaded driver
92 Pointer to the System Table
93
94 Returns:
95
96 Status
97
98 EFI_SUCCESS - thread can be successfully created
99 EFI_OUT_OF_RESOURCES - cannot allocate protocol data structure
100 EFI_DEVICE_ERROR - cannot create the timer service
101
102 --*/
103 // TODO: SystemTable - add argument and description to function comment
104 {
105 EfiInitializeRuntimeDriverLib (ImageHandle, SystemTable, NULL);
106
107 RegisterEsalClass (
108 &gEfiExtendedSalResetServicesProtocolGuid,
109 NULL,
110 ResetEsalServicesClassCommonEntry,
111 ResetSystem,
112 NULL
113 );
114
115 return EFI_SUCCESS;
116 }
117