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 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include <Library/BaseLib.h>
13 #include <Library/DebugLib.h>
14 #include <Library/UefiLib.h>
15 #include <Library/UefiDriverEntryPoint.h>
16 #include <Library/MemoryAllocationLib.h>
17 #include <Library/UefiBootServicesTableLib.h>
18 #include <Library/EmuThunkLib.h>
20 #include <Protocol/Reset.h>
26 IN EFI_RESET_TYPE ResetType
,
27 IN EFI_STATUS ResetStatus
,
29 IN VOID
*ResetData OPTIONAL
34 EFI_HANDLE
*HandleBuffer
;
40 Status
= gBS
->LocateHandleBuffer (
47 if (!EFI_ERROR (Status
)) {
48 for (Index
= 0; Index
< HandleCount
; Index
++) {
49 Status
= gBS
->DisconnectController (HandleBuffer
[Index
], NULL
, NULL
);
52 gBS
->FreePool (HandleBuffer
);
57 // Discard ResetType, always return 0 as exit code
62 // Should never go here
74 IN EFI_HANDLE ImageHandle
,
75 IN EFI_SYSTEM_TABLE
*SystemTable
84 ImageHandle of the loaded driver
85 Pointer to the System Table
95 SystemTable
->RuntimeServices
->ResetSystem
= EmuResetSystem
;
98 Status
= gBS
->InstallMultipleProtocolInterfaces (
100 &gEfiResetArchProtocolGuid
,
104 ASSERT_EFI_ERROR (Status
);