]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/KbcResetDxe/x64/x64Reset.c
Porting Duet module from EDKI to EDKII
[mirror_edk2.git] / DuetPkg / KbcResetDxe / x64 / x64Reset.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 x64Reset.c
14
15 Abstract:
16
17 --*/
18
19 #include "Reset.h"
20
21 //
22 // The handle onto which the Reset Architectural Protocol is installed
23 //
24 EFI_HANDLE mResetHandle = NULL;
25
26
27 EFI_STATUS
28 EFIAPI
29 InitializeReset (
30 IN EFI_HANDLE ImageHandle,
31 IN EFI_SYSTEM_TABLE *SystemTable
32 )
33 /*++
34
35 Routine Description:
36
37 Initialize the state information for the Reset Architectural Protocol
38
39 Arguments:
40
41 ImageHandle of the loaded driver
42 Pointer to the System Table
43
44 Returns:
45
46 Status
47
48 EFI_SUCCESS - thread can be successfully created
49 EFI_OUT_OF_RESOURCES - cannot allocate protocol data structure
50 EFI_DEVICE_ERROR - cannot create the timer service
51
52 --*/
53 // TODO: SystemTable - add argument and description to function comment
54 {
55 EFI_STATUS Status;
56
57 //
58 // Make sure the Reset Architectural Protocol is not already installed in the system
59 //
60 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiResetArchProtocolGuid);
61
62 //
63 // Hook the runtime service table
64 //
65 SystemTable->RuntimeServices->ResetSystem = KbcResetSystem;
66
67 //
68 // Now install the Reset RT AP on a new handle
69 //
70 Status = gBS->InstallMultipleProtocolInterfaces (
71 &mResetHandle,
72 &gEfiResetArchProtocolGuid,
73 NULL,
74 NULL
75 );
76 ASSERT_EFI_ERROR (Status);
77
78 return Status;
79 }