2 Driver entry for KbcReset driver.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Library/DebugLib.h>
17 #include <Library/UefiBootServicesTableLib.h>
18 #include <Library/ResetSystemLib.h>
20 #include <Protocol/Reset.h>
23 // The handle onto which the Reset Architectural Protocol is installed
25 EFI_HANDLE mResetHandle
= NULL
;
30 @param ResetType warm or cold
31 @param ResetStatus possible cause of reset
32 @param DataSize Size of ResetData in bytes
33 @param ResetData Optional Unicode string
39 IN EFI_RESET_TYPE ResetType
,
40 IN EFI_STATUS ResetStatus
,
42 IN VOID
*ResetData OPTIONAL
52 case EfiResetShutdown
:
60 // Given we should have reset getting here would be bad
66 Initialize the state information for the Reset Architectural Protocol.
68 @param ImageHandle Handle of the loaded driver
69 @param SystemTable Pointer to the System Table
71 @retval EFI_SUCCESS Thread can be successfully created
72 @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure
73 @retval EFI_DEVICE_ERROR Cannot create the timer service
79 IN EFI_HANDLE ImageHandle
,
80 IN EFI_SYSTEM_TABLE
*SystemTable
86 // Make sure the Reset Architectural Protocol is not already installed in the system
88 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiResetArchProtocolGuid
);
91 // Hook the runtime service table
93 SystemTable
->RuntimeServices
->ResetSystem
= KbcResetSystem
;
96 // Now install the Reset RT AP on a new handle
98 Status
= gBS
->InstallMultipleProtocolInterfaces (
100 &gEfiResetArchProtocolGuid
, NULL
,
103 ASSERT_EFI_ERROR (Status
);