2 Reset Architectural Protocol as defined in UEFI/PI under Emulation
4 Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
5 Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include <Library/BaseLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/UefiLib.h>
21 #include <Library/UefiDriverEntryPoint.h>
22 #include <Library/MemoryAllocationLib.h>
23 #include <Library/UefiBootServicesTableLib.h>
24 #include <Library/EmuThunkLib.h>
26 #include <Protocol/Reset.h>
32 IN EFI_RESET_TYPE ResetType
,
33 IN EFI_STATUS ResetStatus
,
35 IN VOID
*ResetData OPTIONAL
40 EFI_HANDLE
*HandleBuffer
;
46 Status
= gBS
->LocateHandleBuffer (
53 if (!EFI_ERROR (Status
)) {
54 for (Index
= 0; Index
< HandleCount
; Index
++) {
55 Status
= gBS
->DisconnectController (HandleBuffer
[Index
], NULL
, NULL
);
58 gBS
->FreePool (HandleBuffer
);
63 // Discard ResetType, always return 0 as exit code
68 // Should never go here
80 IN EFI_HANDLE ImageHandle
,
81 IN EFI_SYSTEM_TABLE
*SystemTable
90 ImageHandle of the loaded driver
91 Pointer to the System Table
101 SystemTable
->RuntimeServices
->ResetSystem
= EmuResetSystem
;
104 Status
= gBS
->InstallMultipleProtocolInterfaces (
106 &gEfiResetArchProtocolGuid
,
110 ASSERT_EFI_ERROR (Status
);