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